Section 9.9: Integer Multiplication (Frame 4)                     [prev][home][next]

The algorithm proceeds as follows: Assign one value to the multiplier slot, the other to the multiplicand slot. Set the product to 0 initially and have a counter that is initially set to 8. Then do the following algorithm:

while the counter  0
     if the msb of multiplier is 1 then
          add the multiplicand to the product
     else add 0 to the product
     shift the multiplier one bit left
     subtract 1 from the counter
     if the counter > 0 then
          shift the product one bit to the left

Though it might not seem like it, this is almost the same algorithm as we learned in 3rd grade to multiply two large numbers.