3 ms·
Are you doing the equivalent of repeated squaring here? Otherwise, you'd need up to 255 (or so) additions to multiply two 8 bit numbers, I think?
by eru 4y ago
Are you doing the equivalent of repeated squaring here?
Otherwise, you'd need up to 255 (or so) additions to multiply two 8 bit numbers, I think?
- adwn 4y agoAn 8x8 bit multiplication only requires 7 additions, either in parallel or sequentially. Remember long-form multiplication? [1] It's the same principle. Of course, high-speed digital multiplication circuits use a much more optimized, much more complex implementation. [1] https://en.wikipedia.org/wiki/Multiplication_algorithm#Example https://en.wikipedia.org/wiki/Multiplication_algorithm#Examp...
- eru 4y agoOK. It sounded to me like the comment I originally replied to (https://news.ycombinator.com/item?id=34400296 https://news.ycombinator.com/item?id=34400296) suggested to implement multiplication as naive repeated addition.