Everything Is a Number a show in 8 chapters
Goal: read one row of 8 switches as a number, a letter and a colour
1 of 8 Your guess
Before we start
Your laptop holds photos, messages and songs. Yet it is built from switches, wired by the million, and each one is only ever on or off.
Which picture is closest to what is really inside?
Pick the closest. You find out which fits at the end.
1 switch: 2 patterns, off or on
2 of 8 Try it
1947: one switch, then more
Engineers at Bell Labs kept writing out "binary digit": one answer that is only ever yes or no, on or off, nothing between.
A light switch is one. A coin, once it lands, is one. Flip it.
Off. Flip it and watch the lamp.
On 9 January 1947, in a memo, John Tukey shortened "binary digit" to bit. One switch is one bit.
Your goal: read one row of 8 switches as a number, a letter and a colour. One switch only says off or on.
In 1948 Claude Shannon, also at Bell Labs, asked: how many yes/no answers does it take to pick one thing out of many?
Line switches up and count the patterns they can make. Add one at a time.
1 switch: 2 patterns, off or on.
Each new switch copies every old pattern twice, once with it off and once with it on. So each extra switch doubles the count.
64 + 1 = 65
3 of 8 The idea
Place values
Patterns are not numbers yet. To count with switches, borrow the trick you already use for 65.
In 65 the 6 sits in the tens column, so it is worth 6 tens. The 5 sits in the ones column. Each column is worth ten times the one to its right, because decimal has ten symbols, 0 to 9.
A switch has only two symbols, off and on. So each column is worth double the one to its right: 1, 2, 4, 8, and on up to 128.
Each column's worth is drawn as that many squares. The 128 block is two 64 blocks, the 64 is two 32s, all the way down.
A lit switch adds its column's worth. A dark one adds nothing.
Here is a row of eight: 01000001. Read it left to right, one switch at a time.
Press Play to read the row.
Your turn. Flip any switch under the picture and the sum follows.
Try all eight on, then all off. Then put back 64 and 1 for 65.
01000001 is 65.
4 of 8 The idea
1956: eight at once
In June 1956, at IBM, Werner Buchholz was designing the Stretch computer. He needed a name for the group of switches it would handle as one unit, enough to hold one letter of text.
He called it a byte, misspelling "bite" on purpose so a typo could never turn it into "bit".
Eight is the size that stuck. 256 patterns covered every letter, digit and punctuation mark anyone needed.
What changed
- Patterns, 1 switch to 8: 2 → 256
And eight was the smallest group early machines could pick up as one unit: the atom of memory. IBM's System/360, launched in 1964, built a whole product line on it, and the industry followed.
5 of 8 The fix
Reading eight switches without going blind
Eight zeros and ones for every byte gets unreadable fast. So engineers took four switches at a time.
Four switches make 16 patterns. Each gets one symbol: 0 to 9, then A to F for the six values one decimal digit can't hold.
Sixteen symbols a column: that is hex, short for hexadecimal, base sixteen.
Four switches plus four switches is eight, so two hex symbols name one byte exactly.
01000001 splits into 0100 and 0001: 4 and 1. Written 0x41. The left symbol counts sixteens, so it is the same 65 you added up before.
What changed
- Symbols to write one byte: 8 → 2
You already read hex without knowing its name. A web colour like #1E1E1E is three bytes, one each for red, green and blue.
Memory addresses and a device's MAC address are written in hex too, two symbols per byte.
64 + 1 = 65
poster.jpg first 16 bytes, in hex
dots where a byte has no printed letter, then JFIF: garbage
poster.jpg first 16 bytes, in hex
ff d8 first: a picture starts here
6 of 8 The cost
Same switches, new rule
Take 01000001 and hand it to three programs. One reads it as a whole number: 65. One reads it with the alphabet code called ASCII: the letter A. One reads it as one channel of a paint mix: a grey.
Flip a switch under the picture and all three answers change together.
Why is 65 the letter A?
ASCII is a table people agreed on, one number per letter. It puts A at 65 and B at 66. The switches only say 65. The table says A.
Nothing inside the byte says "I am a number" or "I am a letter". The rule brought to it decides. That rule is the byte's type.
A file is the same idea: bytes plus a rule. These are the first 16 bytes of two real files, as the lesson printed them.
Under the text rule, a byte with no printed letter shows as a dot.
Now rename poster.jpg to poster.txt. Nothing inside the file moves. Only the rule a program picks for it changes.
poster.jpg: an image viewer reads it as a JPEG.
7 of 8 Your guess
Your picture now
Goal met: 01000001 is 64 + 1 = 65 as a number, 0x41 in hex, A as a letter, and a grey as paint. Which picture is closest now?
Pick one.
c is how it works. a is wrong: a photo and a letter sit in the same kind of switches. b is wrong: nothing inside a byte says what it is.
8 of 8 Keep this
Keep this
A computer is switches. Each is one bit, and each extra switch doubles the patterns: eight of them, one byte, make 256.
The same byte is a number, a letter or a colour. The switches never move. The rule brought to them, its type, decides.
Read the full lessonComing up One byte holds 256 patterns, 0 to 255, and not one more. Next: what happens at the 257th, and the one leftover line of code that blew up a rocket 37 seconds after liftoff.