04Counting in Two Symbols
Chapter 3 left us steering 0s and 1s around like abstract tokens: pick this one, silence that one, merge the survivor. But we quietly cheated. We never once said what a 0 or a 1 is actually worth. This chapter pays that debt, and the answer is almost embarrassingly familiar. When you read “724” you don't sound out three separate symbols. Without noticing, you compute seven hundreds plus two tens plus four ones. That hidden weighted sum is the whole idea of place value. Once you see it, you realise “base ten” was never handed down from the mathematics gods. It's a knob, and it happens to be set to ten because we have ten fingers. Turn the knob down to two, the smallest base that still counts, and the same machinery runs on powers of two: 1, 2, 4, 8, 16. That is exactly what a wire can store, since a wire can only be high or low. And it's no coincidence. By the end you'll read any binary number as plain arithmetic. You'll write any decimal number in binary two different ways that always agree. You'll know why each number has one and only one binary form. And you'll watch a byte count from 0 to 255 — and spell. No magic; just counting, done in two symbols instead of ten.
01The arithmetic hiding in “724”
Start with a number you've read ten thousand times: 724. You take it in at a glance, as one thing. But watch what your brain actually did the moment it saw it. The secret of this whole chapter is that reading a number is already arithmetic, and nobody ever told you. The 7 isn't worth seven. Its position, third column from the right, multiplies it up to seven hundred. Slide the very same digit into a different column and its value leaps by a factor of ten at each step. Grab a digit below and move it between the columns. The digit doesn't change, but what it's worth does.
That's the entire idea, and it has a name: positional notation, or place value. A digit carries two facts at once: the symbol itself, and the column it sits in. The column silently multiplies. So a number isn't a string of symbols; it's a sum in disguise. Let's drag that sum fully into the open. Here is 724 pulled apart into the three weighted pieces you were adding without knowing it: 7×100 + 2×10 + 4×1. Change any digit and watch its term, and the total, update live.
Now the one small step that turns this from a grade-school trick into a real system. Those column weights, 1, 10, 100, aren't arbitrary. Each is ten raised to a power: the ones column is 10⁰, the tens column is 10¹, the hundreds column is 10². That last one probably itches. Anything raised to the zero feels like it ought to come out as nothing. So don't take it on trust — walk the columns rightward instead and watch. Hundreds, tens: 100, then 10. Every step to the right divides by ten. Take one more step right and there is only one value the column can possibly have: 10 ÷ 10, which is 10⁰ = 1. The ones place isn't a special case bolted on the end. It's where the pattern lands. That's the quiet reason every number system has a “ones” place at all. Notice what the base is doing: it's the number you multiply by each time you step one column to the left.
Here's a question nobody has ever asked you. Why does base ten stop at 9? We have symbols for zero through nine and then, apparently, we run out. That looks like an accident of history. It isn't, and you can prove it by trying to fix it. Invent an eleventh symbol, X, and let it mean ten. Now write down ten. You can write X. You can also write 10. Same quantity, two spellings — and once that's allowed, twenty has two names too — 20 and 1X. A numeral stops being one number's name and becomes one of its names. The redundancy has a cause, and it's sitting in the weights we just built. Ten of any column is exactly one of the next column up: ten 1s make a 10, ten 10s make a 100. So the moment you reach ten of something, the column to the left already says it for you. A symbol for ten is never needed, and adding one anyway breaks one-number-one-spelling. That gives us the rule this whole chapter turns on: a base-b system has exactly b symbols, 0 through b−1. The base doesn't only set the weights. It sets the alphabet.
So here's the reframe that unlocks everything. The base, which engineers call the radix, is a choice. We picked ten, almost certainly because of fingers, but nothing in the mathematics requires it. Every positional system is the identical machine with one dial turned: the column weights are just powers of whatever base you pick. Turn the dial below and watch the same number get re-weighted under base 8, base 5, base 2. The structure never changes, only the multiplier.
But we aren't picking a base by taste. We're building this out of switches, and a switch is only off or on. So the real question is how far down the dial goes. Guess: does base one work? The symbol rule kills it. Its one symbol is 0. Every weight is a power of one, so every column is worth 1. Whatever you write sums to 0. Base one cannot count. Two is where the dial hits the floor.
02Dial the base down to two
So turn the radix all the way down to two, the smallest base that can still count, and look at what the column weights become. Instead of powers of ten, they're powers of two: 1, 2, 4, 8, 16, 32, 64, 128. Each column is worth exactly double the one to its right. But the weights are only half of what that dial just moved. Run the symbol rule at base 2 and the alphabet falls out with no choice left in it: a base-b system has b symbols, so a base-2 digit has exactly two possible values, 0 and 1. Sit with that for a second. That is exactly what a wire can hold, since a wire is either below the threshold or above it. Nobody bent binary to fit the wire. We turned the dial down to where it stops, and where it stops is a switch. The place-value weights of base two are the language of a switch.
Each of those base-2 digits has a name we've been using loosely since Chapter 1: a bit, a single binary digit, one switch's worth of information. And reading a binary number is now no different from reading 724. It's a weighted sum, just with powers of two as the weights. Take “1011”: that's 1×8 + 0×4 + 1×2 + 1×1 = 11. Flip the bits below and watch the terms light up and the running total climb.
That's the whole of binary-to-decimal conversion: line up the place values, keep the ones sitting under a 1, add them up. Let's give you the full eight-column instrument and let you read any byte off it. Flip switches and the lit place-values drop into the sum. This is you, doing base-2 arithmetic by eye.
Reading is now automatic: given the bits, you sum the weights. But that's only half the skill. The harder, more interesting direction is the reverse. You're handed a number like 200 and asked to find the bit pattern that produces it. That's writing in binary, and it deserves its own section.
03Writing a number in binary
Let's feel the problem before we solve it. Here's a target decimal number, and here are the eight power-of-two switches. Your job is to flip the right ones so the lit place-values sum to exactly the target, no more and no less. Play with it for a moment, because the strategy you'll discover by hand is about to become an algorithm.
Before we name what you just did, notice something about these eight columns. Turn on every switch below 128 and add the lot: 64 + 32 + 16 + 8 + 4 + 2 + 1 = 127. One short. Everything beneath 128, all of it at once, still can't reach 128. That's not a quirk of having eight columns. Each column is double the one to its right, so each column has to beat the entire pile underneath it by exactly 1 — the pile under a 2ᵏ column always comes to 2ᵏ − 1. Call it the doubling rule. It's a cheap little fact and it pays out again and again before this chapter ends. Here's the first payment: a power of two can never be rebuilt from the smaller ones. So if 128 fits inside your target, you don't get to be clever about it. You have to take it.
If you paid attention to your own instinct, you did something specific. You grabbed the biggest power of two that still fit, switched it on, subtracted it off, and repeated on what was left. That's a real, nameable procedure: the greedy method. At each step you take the largest power ≤ the remainder. Let's walk it deliberately on 11: grab 8, leaving 3; grab 2, leaving 1; grab 1, leaving 0. Then read the bits straight off which powers you took.
There's a second route in, and it starts from the other end of the number. Look at the weights once more: 1, 2, 4, 8, 16, 32, 64, 128. Every one of them is even except the 1s column. So whether the whole sum comes out odd or even is decided by one bit alone — the last one. If the number is odd, that bit has to be a 1. If it's even, it has to be a 0. There is no other source of oddness anywhere in the number. That's one bit read straight off, for free. Now subtract it and halve what's left. Halving turns the 2s column into the 1s column, the 4s into the 2s, the 8s into the 4s: every remaining column slides down exactly one place. You're staring at the same problem, one bit smaller, and its last bit is again just odd-or-even. So keep dividing by 2 and the remainders drop out as bits, smallest place first. That's repeated division, and none of it is magic. It's the weights being even.
There's a second algorithm the greedy method quietly hides, and it's the one most textbooks teach — yet the tutorials that show it rarely explain why it works. Instead of hunting for the biggest power, you repeatedly divide by two and write down the remainders. Each division asks one question — “is what's left odd or even?” — and that remainder, 0 or 1, is the next bit, read from the bottom up. Step through it on the same number and watch the remainders stack into the answer.
Two completely different procedures, one clawing down from the top and one peeling up from the bottom, and they land on the identical bit pattern. That's not luck, and it's worth proving to yourself rather than taking on faith. Here are both algorithms run side by side across every number from 0 to 15, their outputs diffed column for column.
They agree on every single input, because they're both computing the one true answer. And that word, the, is doing heavy lifting. It's quietly asserting that there's only one binary pattern per number. That claim is so central to why binary even works that it deserves to be earned, not assumed.
04One number, exactly one pattern
Here's the question a careful person should ask. How do we know every whole number has a binary form? And how do we know it has only one? If some numbers had two different bit patterns, binary would be an ambiguous mess, useless as a way to store a value. Both halves, existence and uniqueness, turn out to be true, and we can see why with a counting argument. Start here: every bit you add doubles the number of distinct patterns. One bit gives 2 patterns, two bits give 4, three give 8. In general, n bits give exactly 2ⁿ. Flip through them and confirm the doubling by eye.
Now line those 2ⁿ patterns up against the 2ⁿ numbers from 0 to 2ⁿ−1. Exactly as many patterns as there are numbers in that range. Be careful here, though, because the counting on its own doesn't finish the job. Greedy always terminates, so every number really does get a pattern — that's existence, and it's honest. But matching totals can't tell you that two different patterns never land on the same number, and that is what uniqueness actually claims. The count is the shape of the answer, not the reason for it. So hold it for one more paragraph. We're about to force the bits, and forcing is what makes the pairing perfect. Then try to break it below: hunt for a number with two patterns, or a leftover pattern with no number. You won't find either.
If the counting feels slippery, here's the mechanism that forces uniqueness, made concrete. Walk the powers of two from the top down and, at each one, ask a yes/no question: is the remaining number at least this big? There is exactly one honest answer each time. So the bits are forced, decided one after another with no freedom to choose differently. A forced sequence can only come out one way. That's uniqueness, not as an assertion but as a consequence.
So binary is a genuine number system, not merely a code: one number, one pattern, no exceptions, no gaps. Which means we can finally do the thing numbers are for: count. And counting in binary reveals the last mechanism of the chapter, the one that makes addition possible at all.
05Counting, carry, and the byte
Counting is just “add one, repeatedly,” and in any base the interesting moment is when a column fills up and rolls over. That moment isn't a new rule. It's the symbol rule firing. Base ten owns exactly ten symbols, so 9 is simply the last one there is. Add one to it and there's nothing left to write, so the column has nowhere to go but round: back to 0, while a 1 spills into the column to the left. That's a carry. Now run the same logic at base two. Two symbols, so the last one is 1. A column tops out at 1 after a single tick, resets to 0, and carries. The ceiling is that close, so binary carries constantly. Try one before the figure does. Here is 0111. What does the very next tick give? Commit to a full answer before you read on. If you wrote 1000, look at what you just claimed: three columns rolling over in a single step, the carry rippling left through all of them at once. Hold onto that ripple. The adder we're about to build lives or dies on it.
Give that its full, satisfying form and you get an odometer: eight little wheels, each rolling the next when it wraps. Hit step or play and watch the rhythm. The 1s wheel flips on every tick, the 2s wheel half as often, and the 128s wheel barely stirs. It turns just once in the whole run. That doubling-down of frequency is the same doubling-up of place value we started the chapter with, seen from the other side.
One question the odometer forces: how far can it count before it wraps all the way around? That depends entirely on how many wheels, how many bits, you give it. That count is the machine's word width. Four bits (a nibble) reach 0 to 15. Eight bits (a byte) reach 0 to 255. Sixteen bits reach past sixty-five thousand. Each wire you add doubles the number of values, because the range is always 0 to 2ⁿ−1. Watch the number of values double as you widen the word.
The byte, eight bits, is the width the world quietly agreed to standardise on. It's the unit your files and memory are measured in. And here's the payoff that closes the loop back to Chapter 1. A byte is just a number 0 to 255. But point one shared lookup table at it, ASCII, and the same eight bits that spell out a quantity now spell out a letter. Flip a byte below and watch it read out as both at once: a number, and a character.
And that's Chapter 4: you learned to count in two symbols. You caught the hidden arithmetic inside an everyday number. You saw that the base is just a dial, and turned it down to two, where the place-values become powers of two and a 0/1 digit is exactly what a switch can hold. You read binary as a weighted sum and wrote it back two ways, greedy subtraction and repeated division, that always agree, because every number has one and only one binary form. Then you watched carries ripple an odometer and met the byte, the eight-bit word that counts to 255 and, through ASCII, even spells. But every number we've written has been a positive one. Real machines have a fixed number of wires and a very real need for negative numbers too. So the next chapter asks a genuinely hard question: how do you write a minus sign when the only symbols you own are 0 and 1? And can you do it so the adder you're about to build never even notices the difference?