3 ms·
not quite sure what your getting at here...on a simple 8 bit like the 6502, you were generally dealing with plain binary, not some IEEE standard, so you get at
by mech422 5y ago
not quite sure what your getting at here...on a simple 8 bit like the 6502, you were generally dealing with plain binary, not some IEEE standard, so you get at most a single addition (if the multiplicand was odd), and just threw an 'overflow error' at the end if the carry/overflow bit was set...
Now arbitrary length BCD...THAT was a PITA
But again, it was 30 years ago so my memory may be fuzzy.
Edit: Hmm - if I recall, it was something like:
and the value with x01 to check LSB,
asl value, (multiplicand masked with LSB=0),
if LSB check was true, add value to result,
check overflow flag ?
Again, this was simple binary data usually of a fixed 1 byte or 2 byte length. we used BCD for 'real work' and I can't even remember how that was done...
- tremon 5y agoHow 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 :-)