The binary numbering system is used in computing and electronics because it’s the simplest counting method available. In addition, the binary numbering system is used to code everything from memory to images on the screen. Thus, it is the basis for the storage and transfer of data in most digital electronic devices.
Binary means one or the other. A binary choice, for example, involves picking one of two possible options. A binary number is described using the base-2 numeral system, which uses only two different symbols, or numerals: usually 0 and 1. All numbers in a base-2 numeral system are denoted using one or the other of these symbols. Every single digit is referred to as a bit.
In our everyday life, we don’t count using a base-2 system. Instead, we use the base-10 - or decimal - numeral system. This means that we have 10 different symbols, or numerals, available to represent different numbers. We can count from 0 through to 9 before we run out different symbols, and so, when we get to ten, we represent it by combining a 1 and a 0.
In our base-10 counting system, a single digit is called a unit. The second digit is a ten. In this way, the symbol for ten (10) means 1 lot often and no units. Twenty-one (21) written in numerals means two lots of ten and one units. Every extra digit we add in our base-10 counting system represents a multiple of tens. For example, we can denote up to 99 (nine lots of ten and nine units) before we have to add another digit. Ten lots often are denoted as 100, and we call this number a hundred.
The base-2 numeral system works the same way but, instead of having ten different symbols available before another digit needs to be added, there are only two. This is because, in a binary system, we can only count 0 and 1 before we run out of symbols and have to re-use them in the second line of digits. Therefore 0010 equals two (one lot of two and no bits), 0101 denotes five (one lot of four, no twos, and one bit), and so on.
Our regular counting system uses units, tens, hundreds, and thousands to represent the extra lines of digits. The binary system uses bits, twos, fours, eights, sixteens, and so on. Thus, binary numbers are usually organized in at least four digits or eight digits, depending on how big the number is. But, aside from needing more digits to express much smaller numbers (e.g., sixteen is described as 16 in the decimal system and 00010000 in binary), the concept is the same.
The main reason the binary number system is used in computing is that it is simple. Computers don’t understand language or numbers in the same way that we do. All they really have available to work with are switches and electrical signals, either on or off. To encode instructions or store values using switches - which can only be either off or on - the binary system is your obvious choice. In binary code, ‘off’ is represented by 0, and ‘on’ is represented by 1.
Computers use transistors to act as electronic switches. A small amount of current going into the transistor can generate a much higher output current: the smaller current switches on the higher current. If there’s no current, the switch stays off. This is a fundamental explanation of how microchips work.
Values are stored in binary using these switches by setting them on (1) or off (0). One switch is equivalent to one bit, and so a bit also represents the smallest amount of information it is possible to configure. Eight switches - i.e., eight bits - make up a byte. Because each switch represents a line of digits in the binary counting system, eight switches represent any value between 0 and 256. Instructions are made up of strings of these bits, which the relevant hardware can read.
Nowadays, it’s possible to fit millions of transistors on one microchip, but transistors had to be much larger in early computing. A counting system that uses more numbers would, arguably, allow for more values to be stored using much less space. So why do we still only use the binary system?
To add another digit to the coding system would mean adding the ability to determine the strength (i.e., voltage) of an electrical signal instead of just whether it was on or off. But, of course, you’d also need a way of calculating the three digits, which would mean using entirely new hardware.
The hardware to do ternary calculations - calculations involved three possible values - already exists. The first computer capable of performing such calculations was created in 1840, and the first modern, electric version - the ternary computer - was built by the Soviet Union in 1958. While a ternary computer is potentially cheaper to manufacture and potentially more efficient in some ways, it seems that the rate of mass-production of binary computers has stalled further development.
Having said that, it is likely the way transistors are arranged and how they perform calculations that is the real reason we have stuck with binary for this long. Binary math is much easier for a computer to understand than ternary math.
If you stack transistor switches together, you create a logic gate. The gate compares two different input types (i.e., if each of the switches is on or off) to determine its output. Therefore, there are three types of gates and three different operations available in computing: AND, OR, and NOT. This is how computers make decisions and is the basic principle of computer programming, with a program being made up of logical sets of instructions. An example of how this works in real life might be: “If I leave on time AND there is no traffic, I will catch the train.
These operations are based on a branch of mathematics called Boolean algebra. Boolean Logic states that there are four possible outcomes if you have two possible inputs (as in a binary system). Each of the logic gate operations can be expressed in a truth table:
Computers use binary numbers because this is the easiest and simplest way to record and process the electrical currents that run through their hardware. If there is an electrical current, the transistor switch is on. The transistor switch is off if there is no electrical current. An on switch is represented by a 1 and an off switch by a 0.
Each switch represents one single bit of information, and eight bits are known as a byte. This is how information is stored in computer memory.
Ternary systems do exist but are not in common use. They may become more common in the future, but at present, it’s not possible to replicate the hardware on as small a scale as would be needed for ternary transistors to be viable in the marketplace.