📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

The System That Could Replace Binary And Change Computers FOREVER

Codeolences9:22

Transcription

What if every chip and every device you own, your phone, your laptop, even the servers hosting this video were built on the wrong foundation? What if instead of zeros and ones, we used zeros, ones, and twos?

In the 1950s, a small group of Soviet scientists asked that same question, and what they invented still has the potential to change computing forever. Computers today use binary to represent information, which is a base two number system. This means each digit or bit can only take two values: zero or one. To represent larger numbers, we chain these bits together, and each one carries a weight based on the power of two.

Think of it like a light switch. Off is zero, on is one. Now imagine lining up billions of these switches in a row. Each one representing a tiny piece of information. By flipping them in the right order, you can describe anything: a number, a letter, even the pixels of this video. At the hardware level, that's all computers do. They manipulate large strings of zeros and ones at incredible speeds.

But this isn't some recent innovation. The roots of binaries stretch all the way back to the 16th century. But wait, before you click off, don't worry. I'm not going to give you an entire history lecture. I just want to talk about one specific invention, maybe the most important one of all time: the transistor. It was invented in 1947, and it allowed the creation of binary logic circuits. With that, modern computing began. Billions of transistors built everything from the very first calculators all the way to the supercomputers of today.

To summarize, binary has a lot of history behind it. But you see, it's not perfect. The base 2 system wasn't chosen because it was the best. It was chosen because it was convenient at the time. Even to this day, electrical systems are very noisy. Therefore, distinguishing between a growing number of voltage thresholds becomes increasingly harder the more we have.

Let me visualize that for you. If you have to differentiate between just two values, the tolerance threshold is quite large. And even with a fluctuating input, you can reliably digitalize the signal. But by increasing the number of values that are to be identified, that threshold gets smaller and smaller until eventually the signal is jumping all over the place. Therefore, bipolar transistors and therefore binary won by default. They were simply more convenient and reliable at the time. And it worked. Transistors are the most produced human artifact in the history of mankind, with over 13 sexillion transistors produced so far. That's 13 with 21 zeros behind it.

So far, the binary system has carried us through the technological revolution. But what if, in reality, we were just settling? And this is where ternary computing comes into play. It is based on three states instead of two. And here we have to make an important distinction between what these three states are. Unbalanced ternary uses the digits 0, 1, and 2, a direct extension of binary. Balanced ternary, on the other hand, uses -1, 0, and +1. And it is symmetric around zero, which is a very useful mathematical property, as you will see in a moment. In fact, it was called the "prettiest number system of all" by Donald Knuth, the recipient of the 1974 Turing Award.

Balanced ternary has some really elegant properties. Subtraction is just flipping signs. Negative numbers are integrated directly into the number system. It's cleaner. It's more robust. And it is surprisingly efficient. As it turns out, base 3 might even be the most efficient number base of all.

To demonstrate why, I will try to faithfully restate the argument made by Brian Hayes in his paper, "The Third Base." How should we go about measuring the cost, meaning efficiency, of a number representation? If we just went with the most obvious assumption, we could say that the higher the base, the better. For example, in base 1000, we can represent numbers from 0 to 999 in a single digit. But the problem is, the single digit can be any of the thousand symbols, all of which have to be reliably recognizable.

Now, if we go to the opposite end of the spectrum, there lies the unary or base one system. To represent the number 1,000 in unary, we would have to write one type of symbol 1,000 times. Minimizing the number of digits causes the alphabet of possible symbols to explode. On the other hand, minimizing the number of symbols causes the width to explode. This leads to a conclusion that we need to optimize some joint measure of numbers' width, meaning how many digits it has, and also its radics or depth, namely how many symbols can occupy each digit position. Mathematically, this can be represented as follows: If r is the radics and w is the width, we want to minimize r * w while keeping r to the power of w constant. It turns out that the result of this optimization effort is the base of the natural logarithm, e, also known as the Euler number, which numerical approximation is about 2.718. Because three is the integer closest to e, it is almost always the most economical number base.

If you want to represent 1 million different numbers from 0 to 999,999, we of course need six digits. In binary, we would need 20 bits to store the same range. And in ternary, we would need just 13 trits, which are the ternary equivalent of bits. You should now clearly see why picking the biggest number base is not the most optimal solution.

Now that we've established that ternary is the most efficient number base, at least when it comes to the radics economy, why did we stick with binary? As I mentioned at the beginning, it was mainly due to hardware limitations and better theoretical foundations. At the time, everyone went all in on binary, and once the tooling, the education, and industry momentum was in place, switching became nearly impossible.

But that didn't stop everyone. In 1958, a team of Soviet scientists at the Moscow State University built a working ternary computer called Saturn. According to the director of the project, Nikolai Brusentsov, it was compact, reliable, and cheap, and consumed far less power compared to its binary counterparts. Over 50 units were built and used in Soviet research institutions. Its successor, Setun-70, was even more advanced, boasting a stack-based architecture and support for structured programming. But then it vanished. The funding for the project was pulled. It was pushed into obscurity, and history simply moved on.

Honestly, I could make an entire video on the Setun project alone. It is a very interesting piece of history. Let me know in the comments if this is something you'd be interested in. Also, if you made it this far, please consider subscribing, as 99% of the people who watch my videos are still not subscribed.

But coming back to the topic of the video, today ternary is quietly making a comeback in some of the most cutting-edge fields of computer science. One of the most promising areas where ternary is reappearing is artificial intelligence. Modern deep learning models are incredibly powerful and in high demand, but they are also very resource hungry. They need huge amounts of memory, computing power, and most importantly, energy. And that's where ternary neural networks come in.

Instead of using floating-point numbers for every weight in a neural network, a ternary model restricts each weight to just three values: -1, 0, and +1. This means that multiplication, one of the most computationally expensive operations, can be eliminated entirely in many cases. In turn, memory usage drops dramatically, and energy efficiency skyrockets. In practice, ternary neural networks can reduce energy consumption by over three times in comparison to traditional approaches, while still achieving similar results on image recognition and other tasks. This makes them ideal for running AI models on low-power devices such as wearables and drones without sacrificing performance.

For decades, the biggest roadblock to ternary adaptation was the hardware. But that limitation is no longer absolute. Recently, researchers have successfully produced ternary chips using standard CMOS manufacturing, the very same method that is used for producing binary chips. One breakthrough design coming from South Korea called TCMOS uses quantum tunneling to introduce a third logic state without the need for multiple voltage thresholds. This means ternary logic can now be produced at scale using existing industrial infrastructure while consuming less power and maintaining signal stability. This changes the equation completely. Ternary logic offers clear advantages in some domains, and it can be produced using the same factories which produce billions of standard chips today.

Let me know what you think down in the comments. And if you enjoyed this video, you might also enjoy this one that you see on the screen right now. Also, consider leaving a like and subscribing to not miss future videos like this.