0 Members and 1 Guest are viewing this topic.
An example may help: 11001100 = a × 10010110 = b ---------- 00000000 11001100 11001100 00000000 11001100 00000000 00000000+ 00000000----------------- 111011110001000So as you can see, in binary, for each bit you add either 0 or a (shifted by some amount), depending on the corresponding bit in b.The way this is usually done is: 1. shift the running total left one bit 2. check the msb of b 3. if set, add a to the running total 4. shift b left one bit 5. repeat steps 1-4 for each bit in b 6. the answer is the current running total