3 ms·
How do you get to "at most a single addition"? Even when multiplying any N with a 4-bit number like 14 (0b1110), you'd get at least two additions: (N << 1) + (N
by tremon 5y ago
How do you get to "at most a single addition"? Even when multiplying any N with a 4-bit number like 14 (0b1110), you'd get at least two additions: (N << 1) + (N << 2) + (N << 3). And that is assuming you already have spent the additional lookahead logic to skip the addition step if the source operand has a 0 bit (which most implementations don't do, because the zero detection logic requires even more logic gates in addition to the adder tree).
- mech422 5y agoAhh - yeah, my bad... I always remember it being much simpler then it appears it was. Guess I'm getting rusty from using fancy languages with built in multiply instructions :-)