# Ternary processing instead of Binary

Most of the computers available today are designed to work with binary system. It comes from the fact that information comes in two natural form, true or false.

We humans accept another form of information called "maybe" :)

I know there are ternary processing computers but not much information about them.

1. What is the advantages / disadvantages of designing and using ternary or higher levels of data signals in computers?
2. Is it feasible?
3. In which domain can it be better than classic binary systems?
4. Can we give computers the chance to make mistakes and expect to see performance improvements in most situations by this way? (I think performance gains can be observed if computers are not so strict about being absolutely correct)

EDIT: Are there difficulties differentiating between 3 levels of signal? Would it be too hard to keep data in memory since memory voltage is frequently released and loaded, (maybe hundreds of time a second?).

• See for example this question on cstheory.SE. – Dave Clarke May 24 '12 at 9:21
• Are you thinking about applications (in which case fuzzy logic may be pertinent) or implementation of computers in hardware? – AProgrammer May 24 '12 at 10:08
• I am asking about both because I am wondering the benefits it would give. Check my edit please. – Mert Akcakaya May 24 '12 at 10:47
• Brian Hayes covered ternary in a 2001 column in American Scientist: americanscientist.org/issues/… That's a not-very-mathematical overview. – Bruce Ediger May 24 '12 at 15:14
• For question 4, there was a recent article published talking about a computer which when allowed to make mistakes ended up 15x more efficient than a standard processor: tweaktown.com/news/24183/… – Julien Lebot May 26 '12 at 6:26

Are there difficulties differentiating between 3 levels of signal?

That's more electronic than computer science (and the issue could be different with other technology). The 2 levels signals we use are generated by putting transistors in a saturation state(*). They behave like switches and the whole technology is driven to optimize this behavior(+). Even without considering that historical skew, generating an intermediate level at a fixed value is more difficult than using saturation, will consume more power (a big part of the power is currently consumed in the transition between saturating state, you will need to stay in that mode where power leaks a lot), reduce the resistance to noise (can be reduced by increasing the supply voltage and thus the power consumption) leading to reduced fabrication yield.

(*) Historically, there has been computer working with transistor in a non saturated state. There is a speed advantage to that. Power consumption (and needs for dissipation) killed the practice.

(+) Analog circuits are made with different processes which are deemed unsuitable for large digital circuits and even small one which don't need an analog part.

• That said, analog DSP is a very widely deployed application used in any form of communications (phone,ethernet,radio,etc.). Granted, the analog component is usually small and tends to shift any computationally intensive code to a binary chip. – edA-qa mort-ora-y May 25 '12 at 5:32
• fiber optics, dark is 0, two orthogonal values of light will be 1 and -1 so that's easy – John Demetriou Nov 16 '15 at 14:32

A ternary hardware system could about something else than $\{\mbox{yes},\mbox{no},\mbox{maybe}\}$ but using arbitrary $\{0,1,2\}$ or $\{0,1,-1\}$. The main inconvenient about such a thing is that the cost of reading a ternary digit is way bigger than for a bit for the same risk of error. (Bigger enough to be less efficient than using two bits to encode a ternary digit.) Therefore such systems would not provide any improvement as is. In particular I really doubt a ternary system would lead to a more compact representation.

However in the redundant binary representation, $\{0,1,-1\}$ is used to improve performances on operations on big integers, making them highly parallelizable because of a way less demanding carry mechanism (the most significant bit of the result does not depend on the least significant bits of the operands).

Side note: if you talk about the meaning of $\{\mbox{yes},\mbox{no},\mbox{maybe}\}$ as a logical thing, you might be interested in fuzzy logic. (You probably already have seen three-valued logic).

• Thanks for the fuzzy logic suggestion. I'll have a look at that. – Mert Akcakaya May 24 '12 at 12:23

There is some information in the article "Ternary computer" on Wikipedia. To address some of your specific questions:

• Feasibility: Yes.
• Memory: Can be implemented via a Josephson junction.
• Advantages: Higher density of information per bit can lead to more compact data representations.

There is one usage of a ternary alphabet $\{\mbox{yes}, \mbox{no}, \mbox{maybe}\}$. In signal transferring you can use $\mbox{maybe}$ result of the transfer to increase the capacity of an information channel.

The channel where you have a probability $\alpha$ that $\mbox{yes}\rightarrow\mbox{no}$ or $\mbox{no}\rightarrow\mbox{yes}$ has much lower capacity per bit than a channel where the transitions are $\mbox{yes}\rightarrow\mbox{maybe}$ or $\mbox{no}\rightarrow\mbox{maybe}$. The capacities are $1-\mathcal O(\alpha)$ compared to much better $1-\mathcal O(\alpha^2)$.

Knuth considered this idea in V1 of TAoCP. He observed that we would need a new device to replace the flip-flop, and he proposed calling it the flip-flap-flop. Was he serious? Well, Knuth has quite a sense of humor.

But it looks like somebody has implemented the flip-flap-flop with 3 NOR gates, which is not that big a deal. So it doesn't require any new technology, but without new hardware it is also not any more compact than the flip-flop, requiring the same density of circuits on an information-theoretic basis.

Of course, there's always Muppet technology.

This article demonstrates the efficiency of various bases for numbering. Base 3 is more efficient in terms of the actual number of characters needed to express any given number on average. So a computer that uses a trinary system to represent integers will be more efficient on average than a binary computer, if it is used to express a wide enough range of number.

Interestingly, the most efficient number out of all of them is e.

In a web book about multi value switches, peter lablans states that N.value transistor switches create truth tables, which are mostly useful for scrambling and descrambling data.

Recently quantum dots have been integrated into amorphous zinc oxide gates (zinc being a non oxidizing metal?!) To make silicon ready 3/4 state switches for current CPUs, and its promoted as a quantum interface, not as an efficient logic process. https://lemmatalogic.com/multivaluedlogic/images/

He has a vb program here https://lemmatalogic.com/multivaluedlogic/#scr

]3