

Ask HN: Why is binary used instead of ternary? - niche

Is ternary not the next logical step in computing?
======
mathgeek
Stack Overflow already has a great thread on this very question.
[http://stackoverflow.com/questions/764439/why-binary-and-
not...](http://stackoverflow.com/questions/764439/why-binary-and-not-ternary-
computing)

------
jeffwass
I think I heard this in a Unix fortune 15 years ago :

When engineers implement base-4 logic, will they call it quits?

------
kedean
It's completely possible, but it's just not worth it. The information density
of ternary is higher than binary, sure, but you now need 3 states to represent
it. This applies to ternary vs base 4, and so on. As it turns out, it's been
proven that binary has the optimal ratio of info density to symbols, and any
higher of a base gives you no net benefit. Unfortunately I don't have a link
to the proof on hand, but if someone else does I'd appreciate it.

We would also lose decades of knowledge on binary operations and how best to
do it. Two's complement is out the window, for instance.

Additionally, the entire CS mindset is built around boolean logic. Exclusive-
or, for instance, makes no sense when you remove binary operation. There's not
much to gain from it either, since any sort of ternary operation can be
implemented as a binary operation without that much overhead.

~~~
mcshaner1
I think the optimal base is actually the natural log e, or about 2.71. I saw a
derivation of this before but can't find the reference. Ternary actually comes
about a bit better from an information density standpoint, but all the other
points you made about difficulties with base 3 and benefits of base 2 still
stand.

~~~
kedean
Good point, 2 is the optimal integer base.

------
alain94040
If you think in terms of voltage on a pin, how you would implement ternary?
Binary is simple: 0V, or 5V (at least a long time ago...). Transitioning from
one state to the other is obvious. How would you do it with ternary logic?

~~~
niche
You could have predefined gates 0V-1V= 0 1V-2V= 1 2V-3V= 2 / -1

Do negative voltages exist?

Positive voltage, negative voltage, no voltage

Ternary allows for measurements of relativity at the pin level whereas binary
is a yes/no...

------
lazylester
OK, let's try ternary. Oh, why not go to quaternary, or quinary (I mighta made
that word up), and so on. Before you know it, we're back to analog!

------
niche
nob: not only binary 10W "1" "0" "Whatever" (not to be mistaken for power
measurement)

Could a binary computer teach itself to build ternary circuits?

Base(4) is effectively base~2, base_e is purportedly optimal, base`pi is
compelling

Is 3 a concept best grasped by humans?

binary within ternary or ternary within binary?

------
victorhn
log2(n) == c * log3(n)

