The binary numbering system is used in computing and electronics because it’s the simplest counting method available. The binary numbering system is used to code everything from memory to images on the screen and 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 one 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. Each single digit is referred to as a bit.
In our everyday life, we don’t count using a base-2 system. 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 of ten and no units. Twenty-one (21) written in numerals means two lots of ten and one unit. 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 of ten are denoted as 100 and we call this number a hundred.
The base-2 numeral system works in exactly the same way but, instead of having ten different symbols available before another digit needs to be added, there are only two. In a binary system, we can only count 0 and 1 before we run out of symbols and have to re-use them in a 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.
Where 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. Binary numbers are usually organized in groups of 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 exactly the same.
As above, 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 is switches and electrical signals, which are 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 very basic explanation of how microchips work.
Values are stored in binary using these switches by setting them to either 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 allow us to represent any value between 0 and 256. Instructions are made up of strings of these bits which can be read by the relevant hardware.
Nowadays, it’s possible to fit millions of transistors on one microchip but in early computing, transistors had to be much larger. A counting system that uses more numbers would, arguably, allow for more values to be stored using much less space. 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. You’d also then need a way of calculating the three digits and this 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 types of input (i.e. if each of the switches is on or off) to determine its output. There are three types of gate and therefore 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. If you have two possible inputs (as in a binary system), Boolean Logic states that there are four possible outcomes. 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 individual 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 in as small a scale as would be needed for ternary transistors to be viable in the marketplace.