Visual walkthrough — Binary number system and bit - byte concepts
Before we start, one promise: every symbol is earned. We will not write until you have seen, in a picture, exactly why the number raised to a position shows up.
Step 1 — Start with something you already trust: counting pebbles
WHAT. Forget bases, forget binary. A number is just how many things — pebbles in a pile. We want a way to record that pile so we can read it back later without recounting.
WHY. If we can't agree on what "a number" means physically, no notation can be justified. So we anchor everything to a concrete pile of dots.
PICTURE. Below: a pile of dots. That count — thirteen — is the thing we will encode. Every step from here on must, at the end, reproduce exactly this many dots.
Step 2 — Why grouping is the only way to write big counts compactly
WHAT. Instead of drawing separate dots forever, we bundle them into fixed-size groups. A computer's switch has exactly two states (ON, OFF), so the natural bundle size is two.
WHY two? Because a switch can only tell us one of two things. It can answer the yes/no question "is there a leftover single dot after making pairs?" — and nothing more subtle. So the group size the hardware can record is . This is the whole reason binary appears: it is dictated by the switch, not chosen for elegance.
PICTURE. We take dots and repeatedly bundle into pairs. Each bundling either leaves a lonely dot (a leftover = 1) or leaves nothing (0). That leftover is what a single switch stores.
Step 3 — Peel the bits off, one switch at a time (repeated halving)
WHAT. Repeatedly divide the count by . Each division gives a quotient (how many pairs) and a remainder (0 or 1, the leftover). The remainder is one bit; the quotient is what remains to be encoded.
WHY. Dividing by is the act of "bundle into pairs and note the leftover" done in arithmetic. We repeat until nothing is left, peeling one bit off the right each time.
PICTURE. A staircase: at each step the pile shrinks (quotient), and we drop a bit (remainder) onto a shelf. Read the shelf from the bottom up to get the number.
For the shelf fills like this (first remainder = rightmost bit):
| step | count | (bit) | (next) |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 | |||
| 4 |
Reading the bits bottom-to-top: .
Step 4 — Where the column weights come from (why )
WHAT. Unfold the recurrence from Step 3. Substituting each quotient back in shows every bit is multiplied by a power of two.
WHY. The first leftover counts single dots (weight ). The next leftover was measured in pairs, so each of its dots is worth . The next in pairs of pairs, worth . Each shelf-level up doubles the worth — because we grouped in twos every time.
PICTURE. Four boxes side by side, growing: a single dot (1), a domino (2), a tile (4), a tile (8). Each ON switch "spends" its box's worth of dots.
Step 5 — Assemble the value: multiply each bit by its weight, then add
WHAT. A binary pattern (each a bit) stands for the number you get by adding each bit times its column weight.
WHY. An ON switch () contributes a whole box of dots (). An OFF switch () contributes nothing (). Summing the contributions rebuilds the original pile.
PICTURE. The pattern with weights written under each bit; ON columns light up, their dot-boxes pour into one basket that must hold exactly dots again.
Check it closes the loop: We got our dots back. The encoding (Step 3) and the decoding (Step 5) are true inverses.
Step 6 — Edge case A: the all-OFF pattern (zero) and the all-ON pattern (the max)
WHAT. Two extreme patterns. Every switch OFF, and every switch ON.
WHY. These are the boundaries of what switches can express. If we don't show them, a reader meets or and panics. They are simply the two ends of the range.
PICTURE. Left panel: switches all OFF → empty basket → value . Right panel: switches all ON → every box poured in → value .
Step 7 — Edge case B: a leading zero and a switch that "isn't there"
WHAT. What does an extra zero on the left do? And what about a position with no switch at all?
WHY. Beginners fear vs . We show a leading OFF switch contributes — it changes nothing about the value, only the width of the register.
PICTURE. and side by side: the two extra OFF boxes on the left are empty, they pour in zero dots, both baskets hold .
The one-picture summary
Everything on this page in a single loop: count → halve repeatedly (peel bits) → weights are powers of two → multiply-and-add → same count. Encoding and decoding are two directions around one circle.
Recall Feynman retelling — explain the whole walkthrough to a 12-year-old
You've got a pile of marbles and a row of light switches. You keep bundling the marbles into pairs. Every time you bundle, either one marble is left over (flip that switch ON = 1) or none is (leave it OFF = 0). Do it again with the pairs, again with the pairs-of-pairs — each time noting the leftover on the next switch to the left. When the pile is gone, your switches read from left to right (remember: the first leftover is the rightmost switch, so read your notes bottom-up!).
To turn switches back into marbles, give each switch a "worth" that doubles as you go left: . Add up the worths of the ON switches: . You got your marbles back — proof the code is honest. If all switches are OFF that's ; if all are ON with four switches that's , the biggest four switches can say, which is always one less than the next doubling. And sticking extra OFF switches on the far left costs nothing — an empty box pours in no marbles. That's the entire idea behind every number a computer stores.
Recall Quick self-test
Encode by halving; the remainders are? ::: (produced in that order) → read bottom-up → . Decode . ::: . Value of vs ? ::: Both ; leading zeros add . Largest value in switches and why? ::: ; patterns run , is counted. Where does the weight come from? ::: Grouping in twos times; each level up doubles the worth.
Connections
- Boolean Algebra & Logic Gates — these ON/OFF bits are exactly what logic gates transform.
- Logic Gates — AND/OR/NOT act on the individual switch states shown here.
- Hexadecimal number system — bundles four of these switches (a nibble) into one compact symbol.
- Two's complement — reuses the same weight-and-add idea, with the top weight made negative.
- Memory addressing — the byte (8 switches) is the unit given an address.