Computers chose digital, which represents information with only a few clearly distinct values. But ternary, with 0, 1, and 2, or base 4, with 0, 1, 2, and 3, would also be digital. So why did binary, using only 0 and 1, become the core principle?
People have 10 fingers and use base 10, so you might guess computers have 2 fingers. In reality, there is a practical reason.
In the previous post, we saw that digital wipes out any noise smaller than half the gap between levels, every time. But the range of voltages you can send down a wire is fixed. The more finely you split the same range into levels, the narrower the gaps get, and the less noise you can tolerate. Electrical signals weaken as they travel down wires and waver as parts age or heat up, so they are easily mistaken for a different level.
The surest approach is to use just two states: clearly high (1) or clearly low (0). Even if the signal weakens a bit or picks up noise, it can be read correctly as long as it is high enough or low enough. Binary is far more forgiving of small changes in a signal, and that lets us build reliable computers.
Below, the voltage range 0~5 V is split into some number of levels to send signals. Each signal picks up ±1.4 V of noise, and the receiver reads it as the nearest level. The noise is larger than in reality so the difference is easy to see. An × marks a misread signal.
Each of these 0s and 1s, the smallest unit of information a computer handles, is called a bit. Every sophisticated thing a computer does comes down to handling bits.
In everyday life, you may know the unit byte better, as in megabytes and gigabytes. One byte is 8 bits.
Put several bits side by side and you can represent numbers. Let’s start with the numbers we use every day.
We use decimal, which is built on 10 digits. We multiply each digit by a value that grows tenfold, like 1, 10, and 100, to form the whole number. Taking 123 apart gives this:
1 × 100 + 2 × 10 + 3 × 1
= 1 × 102 + 2 × 101 + 3 ×
100
Computers use the same principle. But since they use only two digits, 0 and 1, each new place multiplies by a value that doubles. This is called binary. Converting the binary number 1012 to decimal looks like this:
1 × 22 + 0 × 21 + 1 × 20
= 1 × 4 + 0 × 2 + 1 × 1
= 4 + 0 + 1 = 510
We’ll soon see how to calculate with numbers written this way using circuits.
In the next post, let’s look at how these bits can be used to make logical decisions, and how that logic is built into real circuits.
Exactly one of 1,000 bottles of juice has gone bad. A test strip touched by even a drop of the bad juice changes color, but only after a full day. You need to find the bad bottle by tomorrow, so all testing must happen today, at once. If you may put drops from several bottles on the same strip, what is the minimum number of strips you need? Answer with a number.