Why Binary Numbers?

# Why Binary Numbers?

Why do computers systems use the binary system? Is the answer in the hardware or in the logic?

To understand why computers use binary numbers, we’ll have to touch on very different topics. We’ll talk about the first computers, transistors, ternary logic, electricity, quantum computers, and fiber optics.

## The Most Famous Decimal Computer.

Two early computers have had a huge impact on Computer Science. One is the ENIAC, and the other one is the EDVAC. Both from the same inventors: John Mauchly and John Presper Eckert.

The ENIAC was the first programmable computer, and it used the decimal system. They finished building it in 1945, it cost almost 0.5M\$––equivalent to 6M\$ in 2020–– and it was 30 meters long.

The EDVAC was very different from the ENIAC and much more similar to our current computers. For one, it used the binary system instead of the decimal one.

I find it interesting that the inventors were already thinking about the second one before even finishing the first one. The development of the ENIAC finished in 1945, while in 1944, they sent the proposal for the EDVAC.

The inventors must have seen something flawed in the EDVAC architecture. Maybe one of the flaws was the decimal system.

## Computer Hardware is binary-friendly.

Early computers like the ENIAC and EDVAC used vacuum tubes to perform calculations. These tubes use a lot of power, and they heat up very quickly. In 1947 the transistor was invented, and all computers starting from the 60s used transistors instead of vacuum tubes.

Both the vacuum tubes and the transistor are devices that control the passage of electricity. Therefore, engineers use them to create logic gates, the fundamental elements of computer systems.

These components are not very reliable in the exact amount of electricity they control. For example, they are not suited to move from 1.5 volts to 2.5 volts and then to -2 volts.

When we use binary, we need to divide the electricity that passes through a transistor into two buckets, one that means 0 and another that means 1.

Identifying a voltage is easy because the buckets are big. It doesn’t matter that transistors are not good at controlling the amount. Imagine instead that we wanted to identify a decimal number:

Having ten buckets to identify each of the numbers makes it more error-prone. A computer relying on ten buckets would be less reliable than one managing two buckets.

## Ternary Computer

How about using three buckets instead of two? They probably wondered the same in the Moscow State University in 1958. So they built the Setun, the most modern ternary computer.

The Setun used ternary logic instead of binary logic. Instead of 0s and 1s, it worked with -1, 0, and +1—also defined as “-”, “0”, and “+”.

The Setun computer worked well, and it’s not yet clear why they stopped producing it. As a result, the ternary computer fell into oblivion for a while. The invention of optical fibers, however, brought back the possibility of the ternary computer.

Optical fibers are ternary system-friendly. Three states are easily identifiable: “0” when there is no light and two orthogonal polarizations of the light for “-” and “+”. Although this seems possible, many other challenges have not yet been solved in optical computing.

Some relevant computer scientists, like Daniel Knuth, believe that ternary logic will be back due to its elegance and efficiency. For example, we need fewer components to store the same amount of data in a ternary system than in a binary one. That would make the computer cheaper and more energy-efficient.

In theory, a ternary computer is possible and even more elegant and performant than a binary, but there are many challenges in building its hardware.

## Quantum Computer

What about Quantum Computers? Do they use binary? So far, they do.

The basic element in a Quantum Computer is the Qubit—quantum bit—and it uses a binary system of 0 and 1. In addition, the Qubit has properties that make it special, such as superposition and entanglement. Yet, the numeral system of the Qubit is still binary.

## Is the answer in the hardware or in the logic?

There is a large intersection between Computer Science, Electrical Engineering, and Mathematics. There lies the answer to “Why binary?”.

We know that binary systems use more components and more power, but they are more reliable. We also know that transistors are cheap and energy-efficient but not reliable for measurement.

The combination of both—the transistor and the binary system—has become the perfect arrangement so far.

### Thanks for reading, don't be a stranger 👋

GIMTEC is the newsletter I wish I had earlier in my software engineering career.

Every other Wednesday, I share an article on a topic that you won't learn at work.

Join more than 3,000 subscribers below.

Thanks for subscribing! A confirmation email has been sent.

Check the SPAM folder if you don't receive it shortly.

Sorry, there was an error 🤫.

Try again and contact me at llorenc[at]gimtec.io if it doesn't work. Thanks!