Search This Blog

2025/04/01

Poem - Shatrubodh

Shatrubodh

ershe purmesha ne jo harla shiv shivashi
dhadili klishtyata bahu shiv sansari
ladhati putra pityachi,mata putrashi
pati patnishi,patni patnishi
bhav bhavashi,aptya eshatya eka meke

pari shiva swaicchene banala raja sarvacha
rakishito hit jo bharat vanshache
shartubodh khara karine tarka dushtya
thevava bhav shivanshi pandhirivari jo shivsakha
yudhya-samayi dhadila dhartivar prajahita

ruktacha sandun sada,rakshila hirva chuda
rakshito soundrya bharatiche sosat war
chahu vedhila parkiye ani skaviye buddhi-bhrashta
mata jis shatru vatato bara buddhi tinhe bahu kashitli
ershe karanyas bhed bharata lekura,aanit aav matrutyvacha

shresht bharatputra to shiva
paravatit vasato dweshya zara tayachya
thai thai tis diste maher
mhanun magun hi tij nahi milala putra shiva saman
pativrtya parvatiche dav ha begadi,
tij hava putra jo nagavi jagas houn gulam ticha

savatra jari tayasi lekure patichi
japala prajabhav kshtriye Jivapad
kela nyay prasangi houn jivawar udhar
ershe nasavile lekuri bharatichi parvitine
tij pasi bharata che gyan sarva sada sarvada
parvati khele shivashi khel rakta-charit

Kona nase soyare sutak krandanate satat
ma bharati oaze tijvari
santati klechashache ,apure panache
pari sattabrasht tichi lekare tyaas bhase swa-janani savatra
gojiri ti savat parvati tine kele ankit bharatichi lekure

prem bharatiche atarkya
lekaru udand wanshavelivari
lekaras priya sasar je dharile savate
je udhalte dhan kale nasavina shtratej bhart vanshache
raja sharire bahu kashitila parvate pari nahi harila

ladhti je ya udandate virrudha
putra jari te khare bharatiche
sambraham baharala bharati
saundraya dhurta te che lobhas
shtrateja rakshiti mata bhumiputra

Bhartis priya savatra lekure
dura sarite swatache matrutya
kartvya jari shreshtya pari
dolhas kartvya sangito karmya yog
Tygave te pativryata je aviveki

shreshtvya kartya kathorcha sakha
pari tayacha sos kari veda pisa
pariksha keli kartya kathorchi sawali
parmeshu heva bharatputrancha

nakarti lekare parmesha bahu sayase
jari annaile song shreshtyacha
usane jivan ,udhar shrimanti
bahugyani zalye dushtya chor
para tayasi nahi bharat putrachi sar


Yuti parvati chi aani je je irshe harile
shiva chya shreshtve,parmeshu bahu aanadi
tayache patni-putra asun sare gyan pari
tyansi hava sopa marg jyat nakot kahi kashtya
parmeshu khelavitio swa kutumba houn sam asam

shiva priya shtreya,santati sukha,sharir swastya
shatra tej,brahma tej,pragati prani matra
shiva aveharle khote parmeshu,praja sukhe aanila sanatanu
jayat nahi vyakti bhed anaisargeek
je rakshil prajela vikshipt parmeshapasun


2025/03/13

Multiplcation of Decimal using Matrix

Here is my another implementation of multiplication of decimal
number.As my previous blog i am using matrix & tables of 1to 9,
to complete whole multiplication.
Multiplication of rational numbercan also be implemented using
same algorithm just by converting those fractions by sufficient
power of ten & then readjusting result decimal point.

Code:

from collections import defaultdict
import math


decimalMultiplicand: int = 378
decimalMultiplier: int = 24
# 378/23 = 8694

def decimalToArray(n):
return [int(digit) for digit in str(n)]

def getMultiplication(multiplicand: int, multiplier: int):
try:
multiplicandArray = decimalToArray(decimalMultiplicand)
multiplierArray = decimalToArray(multiplier)

alternateMultiplicationSequenceDict = defaultdict(list)

# finding size of each decimal number
multiplicandLength = len(multiplicandArray)
multiplierLength = len(multiplierArray)

total = multiplicandLength + multiplierLength
muliplicationMatrix = [[] * total for _ in range(total)]

print(f"Multiplying:'{multiplicand}' by '{multiplier}'")

# i counter for operand & j counter for operator
i = 0
while i < multiplicandLength:
j = 0
while j < multiplierLength:
k = multiplicandArray[multiplicandLength - i - 1]
l = multiplierArray[multiplierLength - j - 1]

multiplication = k * l
zeroPosition = multiplication % 10
onePosition = multiplication // 10

alternateMultiplicationSequenceDict[zeroPosition].append({
"operandDecimalPosition": i,
"operatorDecimalPosition": j,
"multipleOfTen": False
})

alternateMultiplicationSequenceDict[onePosition].append({
"operandDecimalPosition": i,
"operatorDecimalPosition": j,
"multipleOfTen": True
})

muliplicationMatrix[i+j].append(zeroPosition)
muliplicationMatrix[i+j+1].append(onePosition)

j = j+1

i = i+1

i = 0
rowSum =0
multiplication = 0
while i < total:
j = 0
while j < len(muliplicationMatrix[i]):
rowSum = rowSum + muliplicationMatrix[i][j]
j=j+1
zeroPosition = rowSum % 10
onePosition = rowSum // 10

rowSum = onePosition
if multiplication <= 0:
multiplication =zeroPosition
else:
multiplication = zeroPosition * 10 ** i + multiplication
i=i+1

print(f"Result:{multiplicand} * {multiplier}={multiplication}")
except Exception as e:
print(f"An error occured:{e}")
raise

getMultiplication(decimalMultiplicand, decimalMultiplier)


Code seems to useful to build decimal circuit that can replace binary circuit
for specific purpose of mathematical calculations.