# Building The First Ternary Microprocessor

Your computer uses ones and zeros to represent data. There’s no real reason for the basic unit of information in a computer to be only a one or zero, though. It’s a historical choice that is common because of convention, like driving on one side of the road or having right-hand threads on bolts and screws. In fact, computers can be more efficient if they’re built using different number systems. Base 3, or ternary, computing is more efficient at computation and actually makes the design of the computer easier.

For the 2016 Hackaday Superconference, Jessie Tank gave a talk on what she’s been working on for the past few years. It’s a ternary computer, built with ones, zeros, and negative ones. This balanced ternary system is, ‘Perhaps the prettiest number system of all,’ writes Donald Knuth, and now this number system has made it into silicon as a real microprocessor.

After sixty or seventy years of computing with only ones and zeros, why would anyone want to move from bits to trits? Radix economy, or the number of digits required to express a number in a particular base, plays a big part. The most efficient number system isn’t binary or ternary – it’s base e, or 2.718. Barring the invention of an irrational number of transistors, base three is the most efficient way to store numbers in memory.

Given that ternary computing is so efficient, why hasn’t it ever been done before? Well, it has. The SETUN was a ternary computer built by a Soviet university in the late 1950s. Like Jessie’s computer, it used a balanced ternary design using vacuum tubes. The SETUN is the most modern ternary computer that has ever made it to production, until now.

For the last few years Jessie has been working on a ternary computer based on ICs and integrated circuits, making it much smaller than its vacuum tube ancestor. Basically, the design for this ternary logic relies on split rails – a negative voltage, a positive voltage, and ground. The logic is still just NANDs and NORs (ternary logic does provide more than two universal logic gates, but that’s just needlessly complicated), and ternary muxes, adders, and XORs are built just like their binary counterparts.

This isn’t the first time we’ve heard about Jessie’s ternary computer. It was an entry for the Hackaday Prize two years ago, and she made it down to our 10th-anniversary conference to speak on this weird computer architecture. Over the last two years, Jessie found a team and funding to turn these sketches on engineering notebook paper into circuits on real silicon. Turning this chip into a real computer – think something along the lines of a microcomputer trainer from the 1970s – will really only require a few switches, LEDs, and a nice enclosure.

Where will the ternary computer go in the future? According to Jessie, the Internet of Things. This elicited a few groans in the audience during her talk, but it does make sense: that’s a growing market where efficiency matters, and we’re more than happy to see something questioning the foundations of computer architecture make it to market.

## 81 thoughts on “Building The First Ternary Microprocessor”

1. TeachingBudha says:

Computers use 0 and 1 because of how diodes and transistors work. Before unsubscribing / unfollowing hackaday please specify if “There’s no real reason for be the basic unit of information in a computer to be only a one or zero, though. ” is a quote and not an author statement.

1. rastersoft says:

The interesting point for using ternary system in the SETUN was to take advantage of the three states allowed by a memory core: magnetized clockwise, counter-clockwise, and no magnetized. In my opinion, at a pure electrical level the binary form is the most eficient.

1. SavannahLion says:

We’re throwing away 1/3 additional er… state width?

To put it another way, given a collection of standard IC’s and comparable controllers to ARM with the same as comparable binary controllers and IC’s. How much additional circuit board space is required beyond the negative power rail to a comparable binary board?

8 states would require only 2 pins on a ternary while it takes 3 on a binary. Seems to me, it would save on board space allowing us to create much better toys to play with.

I don’t think binary systems should go away, but I don’t think it should be the only player.

1. SavannahLion says:

Damn… bad edit on “controllers and ICs.” Should just read IC’s. blah blah blah. You get the idea.

2. BrightBlueJim says:

Yes, it is possible for a magnetic core to have many states, and it might seem obvious to use CW, CCW, and “none”, but in practice it’s very hard to get to “none”. Due to the hysteresis of the materials used for magnetic core memory, it would rather flip from one direction to the other than just find a nice comfortable in-between state. It’s like trying to make a toggle switch stop in the half-way position – you can do it, but not easily.

2. Gavin Rowley says:

I’ve been thinking about this over and over untill I googled if someone was making a ternary computer. If I’m right, even at 32 bits across and half the clock speed, a ternary computer is 5×10^15 times as powerful as a modern binary computer. It increases dramatically from there, obviously. 3^64 is insanely powerful.
We use thyristors. That’s a 3 state device. We’ve had them for a very long time. We really sold ourselves short with binary. Simpler?
I’m not sure that’s necessarily true. I mean, It’s a got to be some simpler, but not like achieving the same power with binary. That’s not even possible. So in that regard, ternary is a requirement for computing advancement at some point.
Turing’ss computer had 6 states, if I’m not mistaken. (It’s been a long time for me, folks). That poses some issues today. But in ternary, If you’re laptop was 5×10^15 times more powerful, even at half the clock speed, your laptop would outcompute all the supercomputers in the world, COMBINED.
Maybe my math is off. Check it. It’s easy math on a calculator.

1. Gavin Rowley says:

The issue of ternary computingbis less a matter of efficiency than it is about power. As I said, even a 32 bit width and half a modern clock speed we’d have 5×10^15 times as much power was binary. This a a rebirth in computing. It’s not some incremental carrot on a stick. Remember 2x CDROM the 4x, the 8x, then 24, then…. they were milking us for money back then. A ternary computer is like having a sentient computing platform to start with, if you’ll forgive the hyperbole. It can easily outcompute the fastest binary computers, solving the world’s toughest problems as a screensaver or in the background. It’s not a matter IF we SHOULD. we must, if we are to grow at the rates we were growing in the 90s. We’ve become much smaller and more efficient but in computing power, we haven’t seen a REAL breakthrough since we went from 32 bits to 64. If we need problems to solve that would require ternary computing, then start with the biology and gene science, cold fusion simulation, the data sent to and from vessels sent into deep space (that is efficiency), ask any scientist what the world could do with computers that are on the order of 10^15 times as powerful in their laptop. If it’s there, people will use it.

2. DV82XL says:

One of the most intractable truths in many domains is that good enough is the enemy of better usually expressed as the cost/benefit ratio. While there are some features of using ternary in computing that are advantageous the real question (as always) is if it is worth it.

1. Internet says:

For many general purpose applications, generally not. But as is typical, there are always niche cases where certain things don’t weigh as heavily. Most consumer products are a far cry from being “perfect” if there even is such a thing but this comes into play far more often than you would think. Even for such mundane things as roofing materials. Pay a “little” now for a cheap roof or pay a lot now for a better roof but have it hold up for several decades or more. Or the use of extremely specialized and niche mechanical devices when the need for them is there and cost is less of a concern. Surgery, space flight, F1 racing, etc.

3. Thopter says:

“a ternary computer based on ICs and integrated circuits”

Will it be put to use in ATMs and automatic teller machines?

1. Justin says:

Nice

2. franksemails.com says:

Yes but it might be put in ATM machines as well.

3. Those things you put your PIN Numbers into ?

1. BrightBlueJim says:

I’m a little concerned about the performance you can get from a ternary computer. How many MIPS per second do you suppose they can do?

4. JIm B says:

“There’s no real reason for be the basic unit of information in a computer to be only a one or zero, though.”

What!? There are very good, very real reasons why binary is used. Saturating transistors can be used, which reduces power. Having only two voltages to work with reduces power rails. And having only one threshold to worry about makes the noise margins better for a given voltage swing, and allows for simpler and faster circuits. Those advantages outweigh the benefits of a higher radix encoding.

Now, if what Jessie is doing is using pairs of binary circuits to encode three states (akin to how some hardware uses base-16 encoding of floating point numbers), I’m unconvinced how that is more efficient than encoding four states with two binary circuits.

1. Unferium says:

Don’t forget that someone would need at least two transistors per trite-bit (tit?) and maybe a way to stop accidental follow through (both on at same time) and then the address bus decode being a high tit decode and a low tit decode presuming a zero tit meaning unused (off).
So how would you determine if the tit is high, low or extra low (damn that’s low)? Via voltage references and/or opto-iso feedback?

Binary can be just two transistors and a current limit resistor (oldskool discrete transistor logic)

(tits weren’t meant as a pun :D)

1. SavannahLion says:

I would’ve gone for “tit” strictly because it fits in the same visual space as a bit. But I guess since a trit is bigger than a bit, that makes sense.

1. Greenaum says:

Didn’t you or the guy above read the article here? She uses +V, GND, and -V for the three states, so the device needs a positive and negative rail. Nothing’s stored as binary, otherwise it’d be a binary computer with a load of pointless intermediate convertors and unconvertors.

1. David says:

Storing two sets of binary is still storing two sets of binary. All you’ve done is hide that implementation detail from the user. But we’re not the users, we’re here to discuss the actual implementation detail. Moreover, it’s the exact reason why there is a very good reason we use binary – it’s the natural way our current electrical components work. For a microprocessor to be ternary you’d need to use fundamental components that offer that property natively; not through various workarounds such as what they discussed in this video to “simulate” such property. Turns out it’s not exactly a trivial task. So really, we can say they’ve developed a binary electrical circuit that simulates a ternary circuit.

2. Unferium says:

Quote:
“She uses +V, GND, and -V”

That was the basis of my thinking:

+V is high (or very high)
GND is unused state (or low/high relative to what you want)
-V is low (or very low if you want)

now:
0 3 6
0 0 0 = 0
+ 0 0 = 1
– 0 0 = 2
0 + 0 = 3
+ + 0 = 4
– + 0 = 5
and so on.

My comment is how would you use such a thing as an address line, as in how does the address translate the + and – voltages without lots of transistors.

Also in theory, yes it is efficient…. Only if you look at the table above.
Now that we are in the habit of Jordan Maxwell-ifying facts here:

One could look at the 2.718 value and say that 2.X means two states are efficient and 0.718 means it is about 72% efficient with the remainder being the glue logic to make it work. However that is using the same logic as a guy (Jordan Maxwell) who takes an ancient name, Krishna, and claims it came from Christ (Jesus Christ) which would only of worked if English was older than say Latin, Arabic or Sanskrit, That among his other New-agism Hipster agenda pushing blag of a technique.

Next someone here will say “ternary computers…. because aliens did it”

Bludi hipsta logik!!!!!

2. Anonymous(ppv) says:

Well using a high z state instead if the negative rails would make more sense I guess???

5. Unferium says:

I can count to 512 on just two hands…. And…. probably get arrested for public disorder sticking two middle fingers up in public when counting in base two on my hands.

The problem will be having to learn a whole numbering system. Binary seems easy to count.

Ternary, well I can’t be asked to traipse the internet on how to count past 2 in base 3 when I’ll never have use for it as far as I can see to my future.

1. dizot says:

Sorry to hear that you’re missing a finger. WIth all ten of my fingers, I can count to 1023 in binary :D

1. Unferium says:

Cheers for the error correction, Just realized that this morning. LOL

2. some guy says:

[quote]I can count to 512 on just two hands…. And…. probably get arrested for public disorder sticking two middle fingers up in public when counting in base two on my hands.[/quote]
This one is very good! Could be a handy excuse in front of a judge, “i wasn’t insulting him, i was counting in binary!” :-) Not sure if it will be accepted though…

6. Nah! says:

Why not different between + 0 and -0 uhuhu

1. To simplify the answer, because zero has no direction.

1. Rob says:

of course negative zero is a thing but afaik mainly in IEEE 754 floating point maths (already well abstracted above/away from processor physics), not in logic levels or voltages.

1. Erin says:

-0 makes the most sense when 0 was arrived at from rounding–knowing which side of zero you came from can be useful in those situations.

1. It also makes sense in limit math, but those are only going to be approximated in a digital system anyhow.

7. Rodney McKay says:

There are only three kinds of people…

1. guest says:

Only 10 kinds of people in my book. Those who use binary and those who don’t.

1. Only 10 kinds of people in my book also:
1. Those who use binary,
2. those who use ternary
10. those who don’t use anything.

1. Alpheus says:

There’s only 10 kinds of people in my book:

1. Those who use binary,
2. Those who use ternary,
3. Those who use quaternary,
….
9. Those who use decimal,

8. First? Yeah, let’s forget history. Don’t check even Wikipedia, because clickbait.

You guys (editors here) can be such idiots sometimes. Shame on you.

1. You… You realize I linked to Setun in the article, right? It’s almost as if you’re only reading the headline, and complaining the headline is inaccurate.

NOW HIRING: BETTER TROLLS. Please send your application in the form of a brick thrown through my front window.

1. Jonathan says:

Any particular type of brick? There’s quite a wide variety of types, shapes and materials to choose from :)

2. Alpheus says:

I didn’t know that the Setun used a microprocessor! I could have sworn that it used tubes.

And the Ternac doesn’t count — it’s merely a simulator written in Fortran, rather than an actual computer.

9. danjovic says:

there are 10 types of people in this world, those who understand ternary, those who don’t and other just heard about it.

1. Rodney McKay says:

That made no more sense than my failed attempt.

1. danjovic says:

It seems that we wrote the comment at the same time, LOL!!

2. Okay,I’ll get in trouble for this, but …

There’s also those that don’t care ;-)

1. danjovic says:

I was saving ‘Don’t care’ people is for Quaternary. You ruined my joke, LOL!!!!!!

10. Dan says:

Aren’t quantum computers potentially base whatever-you-want?

1. dru says:

So are regular computers if you design them that way.

Qubits are still inherently base 2. Qutrits (https://en.wikipedia.org/wiki/Qutrit) are a thing, and I suppose you could extend the idea to base n in principle.

11. Pusalieth says:

Me thinks there is encrypted data in the sound stream at the end of video.

12. The best reason to use something other than binary is so that we could reduce the number of traces needed to convey instruction sets and memory locations. Say for example that you had a new kind of diode that would not just give high or low from a voltage, but it could distinguish between many many different voltage levels that means you could theoretically create a computer where the instruction, and addresses locations could be transmitted in a single channel single clock cycle.

But as someone above mentioned, you get voltage drift and resistance can lower the signal voltage etc, so it would be really hard to control, but it could be really really small since you would need fewer channels.

We are doing something similar with fiber lines. Usually its just red light on or off, but there is some experimentation using RGB and breaking it apart on the other end. It would essentially be the same thing.

Another correlation is radar detectors used to just use a single point bounce, to measure distance twice and determine speed. Now they send a hamming pattern and then when they receive it, they can actually get much more precision by looking at the pattern when the signal is returned.

1. pablo says:

Some signaling protocols use more than two voltage levels – your ground return quality matters more and your signal eyes are smaller, but it’s a valid strategy for trading off clock speed, number of signals and bit rate.

13. RÖB says:

Ah! There are 10 types of people: those who understand binary, those who don’t and those who don’t care!

1. Turing Complete Machine Machine Machine Mach.... says:

There are 10 type of people: those who understand binary, those who don’t and Nikolay Brusentsov.

It’s funny that this applies to any base (10 in base X is equal to X).
So besides the first use (related to base 2) when the joke come from people being used only to read 10 like ten in base ten and it was something new, now i don’t see it funny anymore.

1. Piz says:

My favorite is “There are 10 types of people: those who can extrapolate from incomplete data.”

2. Except for better educated IT and math guys, most people don’t even know about other bases. If their school system does teach them about it, converting between two or more systems is somewhat hard to them. So in my book joke with 10 people is always funny.

14. rohare says:

Just wanted to point out that we already use “more than binary” in lots of practical applications right now. Just not in processors.

Some modern DRAM cells can represent as many as 6 different states. That’s six states, not six bits. The DRAM controller handles the translation from binary to whatever n-ary the RAM uses. Some of you may have such memory in your computer right now.

There are non-binary Flash memories. If you have an SSD in your computer it is likely that you have a multi-level NAND Flash drive.

IBM had mainframe tape drives that used 10 bits per symbol. In the 1983.

Telecommunications technology has been doing this for just as long, if not longer.

The US Army had a radio system that used a modulation method that had more than two states per symbol in the 1940’s.

56K modems? 3 bits per symbol.

802.11ac wifi? 512 bits per symbol.

“But those are ANALOG!” you say. Okay, maybe you can argue that a digital modulation method over radio or old phone lines isn’t “fully” digital. So how about Fiber Channel? 10 bits per symbol.

Long story short: Many of our digital systems have already gone beyond binary. It’s mostly just our microprocessors that haven’t.

1. Ostracus says:

Microprocessors with a constellation.

15. BrightBlueJim says:

I was disappointed to see nothing but block diagrams, especially since those looked just like the diagrams for binary logic and arithmetic. Show us some transistors implementing a gate!

And how about flip-flops? Flip-flap-flops, I mean? So much of computing (aside from high density storage and communications protocols) take advantage of how easy it is to make two-state circuits. So show us how easy it is to make three state circuits!

16. Nik says:

We can use 0, 1 and -1
Ground, +4v., -4v.

17. edrandom says:

See also Thomas Fowler’s 1840 ternary calculating machine – he needed to calculate parish contributions to poor relief by reducing pounds, shillings and pence to farthings. There’s a demo of a reconstruction online.

18. ever says:

Why stop there? Let’s go back to analog computing. Even within zero and 1 you get access to an infinite number of states.

1. ellisgl says:

That would would be Base E, the most efficient. But try to make a “digital CPU” around that…

19. Mike C says:

Now to build a Ternary computer and get Midori running on it! Optimal efficiency!

1. Mike C says:

Project Midori (the OS) to disambiguate.

20. Balanced ternary is the most efficient computing base if the circuit complexity follows radix x length. But it may not. If we look at the number of possible gates for example:
Binary Ternary
1 input 4 27
2 input 16 729
3 input 64 19,683
Now many of these gates are not useful, the only useful 1 input binary gate is an inverter, the other 3 are always 1 always 0 and same as input are not really gates. But if the complexity of the circuit to implement these gates relates to the number of possible gates then binary wins out over ternary.

21. ellisgl says:

https://en.wikipedia.org/wiki/Radix_economy – Look under “Computer hardware inefficiencies”, Base 2 would be 39.20 N=m in tubes, while Base 3 would be 38.32 N=m. So the transistor count could go down, if you built a transistor that take in an input and compare it to ground…

22. WOW I am not nearly as knowledgeable as you guys but I do buy into ternary computing. First by sticking with alternating current we save a fortune in power waste and usage. by introducing a third option we can modify the logic of present AI and create AI that has a creative ability. Think about it. Mr Spock is logic based but on occasion his human (third option) jumps in and the party changes.

1. ellisgl says:

While yes that is possible, but I think the target for this design is to reduce the amount of interconnections of the bus, which in theory would reduce the foot print of a die. I think what you are referring to is fuzzy logic.

23. The only time I encountered ternary data was for the maerklin digital control systems for model trains. It sends data in trits (although, inefficiently, encoded back into binary, so what is the point?).
Maybe this new IC would have an application in model railroad control :)

This site uses Akismet to reduce spam. Learn how your comment data is processed.