logoalt Hacker News

nobrainstoday at 8:46 AM2 repliesview on HN

Why do we make computers multiply single digit numbers, instead of taking the result from a lookup table, like humans do? To answer my own question, I am assuming it would be because multiplying would still be faster than reading from a lookup table? Any ideas?


Replies

sparky_ztoday at 8:49 AM

In a sense, they do exactly that! But since there are only two single-digit numbers in binary, it makes for a pretty short table.

show 1 reply
Someonetoday at 11:28 AM

> I am assuming it would be because multiplying would still be faster than reading from a lookup table?

Even if it isn’t, it still would be a lot cheaper. With 32-bit integers, the lookup table would have 2⁶⁴ 64-bit values. If my math six right, that is 128 exabytes of read-only memory. With 64-but integers, it truly would be impractical, at 2¹²⁸ 128-bit values.

show 2 replies