2 ms·
If you've never multiplied numbers in balanced ternary, work out the algorithm and try it on some simple numbers. It's a real pleasure. The sense in which it's
by kragen 7y ago
If you've never multiplied numbers in balanced ternary, work out the algorithm and try it on some simple numbers. It's a real pleasure.
The sense in which it's “optimal” is that if you consider a one-hot encoding for each digit, well, for numbers up to a quintillion you need 18×10=180 vacuum tubes in base 10 (like that abortion the ENIAC), 2×60=120 in base 2, and only 3×39=117 in balanced ternary. If your base 2 is also signed, the crossover happens earlier (you need 122 vacuum tubes in that case), but either way, it's not a large difference.
Still, there are a number of things that come out pleasingly simpler in balanced ternary: in addition to multiplication, there are comparison results, rounding (as mentioned in the linked paper), numerical type ranges, and negation. It's easy to imagine a world where ternary had come out on top.