Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?



An 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#Examp...


OK. It sounded to me like the comment I originally replied to (https://news.ycombinator.com/item?id=34400296) suggested to implement multiplication as naive repeated addition.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: