Hi All,
i've read a lot about of theory about implementing multiplications using add and shift but i still cant seem to crack it when i'm putting it into code. from my understanding:
we have 2 variables, a multiplier and a multiplicand
we want to test the LSB of the multiplicand, if its 0 we dont add, simply shift the multiplicand in the results vector
IF its a one we add the multiplier to what ever result we currently have, check that there has been no carry in the status register and wrap around the loop until the multiplicand reg is all zeros.
i've spent all day reading pseudo code but still cant seem to crack it. i know i'm not storing the result correctly and something to do with my use of the partial products is off too..
could someone give me the rundown.
i've read a lot about of theory about implementing multiplications using add and shift but i still cant seem to crack it when i'm putting it into code. from my understanding:
we have 2 variables, a multiplier and a multiplicand
we want to test the LSB of the multiplicand, if its 0 we dont add, simply shift the multiplicand in the results vector
IF its a one we add the multiplier to what ever result we currently have, check that there has been no carry in the status register and wrap around the loop until the multiplicand reg is all zeros.
i've spent all day reading pseudo code but still cant seem to crack it. i know i'm not storing the result correctly and something to do with my use of the partial products is off too..
could someone give me the rundown.