logoalt Hacker News

6510today at 8:39 AM1 replyview on HN

If you do it in binary you only need addition.

12 × 34 = 0xC x 0x22 = 1100 x 100010

Only two 1's!

1100 add 5 zeroes + 1100 add one zero = 110011000 = 408

ta-daa!


Replies

cvosstoday at 1:12 PM

Addition and conditional bit shifting (which is multiplication by powers of 2).