Multiplication by Shift & Add Algorithm
Multiplication by Shift & Add Algorithm
START SET NO OF BITS OF MULTIPLIER AS COUNT (R4) SET INITIAL PRODUCT AS 0000 0000 (R6) CHECK MSB OF MULTIPLIER IS MSB=0 No
Yes
DECREMENT R4
No
pdfMachine Is a pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, if you can print from a windows application you can use pdfMachine. Get yours now!
EXAMPLE
Q) 05 x 05 (0101 x 0101) STEPS:Initial Product: Multiplier MSB- 0 Initial Product: Multiplier MSB- 1 Initial Product: 0000 0000 + (after rotation) 0101 0000 0101 Multiplier MSB- 0 Initial Product: Multiplier MSB- 1 Initial Product: 0001 0100 + (after rotation) 0101 0001 1001 0000 1010 (after rotation) Count: 01 Count: 02 0000 0000 (after rotation) Count: 03 0000 0000 Count: 04
Count: 00
pdfMachine Is a pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, if you can print from a windows application you can use pdfMachine. Get yours now!
PROGRAM
org 4100h mov r4,#04h mov r6,#00h mov r0,31h mov r1,32h mov a,r1 swap a mov r1,a clr c mov a,r1 rlc a mov r1,a jc l1 sjmp l2 mov a,r6 clr c rlc a add a,r0 mov r6,a sjmp l4 mov a,r6 clr c rlc a mov r6,a djnz r4,l3 sjmp hlt
l3:
l1:
l2:
l4: hlt:
pdfMachine Is a pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, if you can print from a windows application you can use pdfMachine. Get yours now!