logoalt Hacker News

nobrainslast Sunday at 8:46 AM3 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_zlast Sunday 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
alok-gyesterday at 12:31 AM

Every combinational logic function can be implemented as a look up table, which can be implemented as a hardware ROM. It is common to consider speed-power-area tradeoffs to find good implementations.

Someonelast Sunday 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