Could anyone tell me how to multiply two 4 Bit binary numbers with repeated addition on the Intel 4004?
the addition code is:
FIM R0R1, 0x78 ; initialize: R0=8 R1=7
LD R0 ; load R0 into accumulator
ADD R1 ; add R1 into accumulator
XCH R1 ; and store in R1 done:
JUN done ; endless loop as end of program
I think logic is that: Multiplication can be done by repeated addition.
- Initialize memory pointer to data location.
- Move multiplicand to a register.
- Move the multiplier to another register.
- Clear the accumulator.
- Add multiplicand to accumulator
- Decrement multiplier
- Repeat step 5 till multiplier comes to zero.
- The result, which is in the accumulator, is stored in a memory location.
instruction set is in this link to reach: http://www.e4004.szyc.org/iset.html
I spent so much time to understand, but i can not. I would be really so appreciated if somebody helps.