Counting in twos
Hold up one hand. How high can you count on it?
Most people say five. One finger, two fingers, three, four, five. That is how you have counted since you were small, and it is perfectly sensible.
But your hand can count much higher than five — all the way to thirty-one — and by the end of this lesson you will do it. Not with a trick, but with the exact counting system every computer on earth uses: binary. It is the language of the switches from Module 1, and once you understand it, you will know how a machine that only knows "on" and "off" can hold any number at all.
You do not need to be good at maths for this. You need to be good at one thing you already do every day without thinking: reading the places in a number.
Words in this lesson
| Word | What it means |
|---|---|
| Digit | A single symbol used to write a number, like 7 or 0 |
| Place value | How much a digit is worth because of where it sits in the number |
| Decimal | Our everyday way of counting, with ten digits (0–9); also called base 10 |
| Binary | Counting with only two digits, 0 and 1; also called base 2 |
| Bit | One binary digit — a single 0 or 1, the same as one switch off or on |
| Convert | To rewrite a number from one counting system into another |
We already count with places
Look at the number 352. You read it as "three hundred and fifty-two" without a pause. But think about what you actually did.
The 3 does not mean three. It means three hundreds, because of where it sits. The 5 means five tens. The 2 means two ones.
| Hundreds | Tens | Ones |
|---|---|---|
| 3 | 5 | 2 |
300 + 50 + 2 = 352.
Each place is worth ten times the place to its right: ones, tens, hundreds, thousands. That is why our system is called base 10 — it is built on tens, and it uses ten digits, 0 to 9. When a place runs out of digits — after 9 — you write 0 there and carry 1 to the next place: 9, then 10. Nobody taught you that as "the rule of carrying". You just know that after 99 comes 100.
Keep hold of that idea. Binary uses exactly the same idea, with one change.
Counting with only 0 and 1
Now imagine you only have two digits: 0 and 1. That is binary, or base 2.
With only two digits, you run out very quickly. You count 0, then 1 — and you are already out of digits. So you do what you always do when a place runs out: write 0 and carry 1 to the next place. In binary, the number after 1 is written 10.
That "10" does not mean ten. It means one two and zero ones — the number two.
In binary, each place is worth two times the place to its right:
| 16s | 8s | 4s | 2s | 1s |
|---|
Here is counting from zero to eight in both systems:
| Decimal | Binary |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 10 |
| 3 | 11 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |
| 8 | 1000 |
Look at the pattern on the right. It is the same pattern as the switch combinations in Lesson 1.2: off-off-on, off-on-off, off-on-on… Binary is not a new idea. It is the switches you already know, written down as 0s and 1s.
Reading a binary number
To read a binary number, write the place values above it and add up the places that have a 1.
Worked example 1: what is 101?
| 4s | 2s | 1s |
|---|---|---|
| 1 | 0 | 1 |
One 4, no 2, one 1: 4 + 1 = 5.
Worked example 2: what is 1101?
| 8s | 4s | 2s | 1s |
|---|---|---|---|
| 1 | 1 | 0 | 1 |
8 + 4 + 1 = 13.
Worked example 3: what is 01000001?
This one has eight places. Write them out, each double the last, starting from the right: 1, 2, 4, 8, 16, 32, 64, 128.
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |
64 + 1 = 65. Remember that number. In Lesson 2.3 you will find out that 65 is how a computer stores the capital letter A.
A zero at the front changes nothing, exactly as in decimal: 052 is still fifty-two. Computers often write the extra zeros so every number has the same length.
Writing a number in binary
Going the other way — from an ordinary number to binary — is like paying an exact amount using the biggest notes you can.
Imagine you must pay ₦13 using only notes worth 8, 4, 2 and 1, and you may use each note at most once.
- Can you use the 8? Yes — 13 is at least 8. Use it. 13 − 8 = 5 left.
- Can you use the 4? Yes — 5 is at least 4. 5 − 4 = 1 left.
- Can you use the 2? No — only 1 left. Skip it.
- Can you use the 1? Yes. Nothing left.
Write 1 for every note you used and 0 for every note you skipped: 8 ✓, 4 ✓, 2 ✗, 1 ✓ → 1101. That matches worked example 2.
Worked example: 100 in binary
The places: 64, 32, 16, 8, 4, 2, 1. (128 is too big.)
- 64 fits → 100 − 64 = 36 → 1
- 32 fits → 36 − 32 = 4 → 1
- 16 does not fit → 0
- 8 does not fit → 0
- 4 fits → 4 − 4 = 0 → 1
- 2 → 0
- 1 → 0
So 100 in binary is 1100100. Check it: 64 + 32 + 4 = 100. ✓
Count to 31 on one hand
Now the promise from the start. Give each finger a place value:
| Finger | Thumb | Index | Middle | Ring | Little |
|---|---|---|---|---|---|
| Worth | 1 | 2 | 4 | 8 | 16 |
A finger up is 1. A finger down is 0. To show a number, raise the fingers that add up to it.
- 5: thumb (1) + middle (4).
- 10: index (2) + ring (8).
- 13: thumb (1) + middle (4) + ring (8).
- 31: every finger up — 1 + 2 + 4 + 8 + 16.
Zero is a closed fist. Thirty-one is an open hand. And every number in between has exactly one way to show it. Five fingers, five places, 2 × 2 × 2 × 2 × 2 = 32 different numbers: 0 to 31. Your hand has just become a five-bit computer.
(One warning from experience: the number 4 on its own — only the middle finger up — means something rude in many places. Count it in private.)
Why this is the same as switches
Every binary place is a single bit: one 0 or 1. And a bit is exactly one switch from Module 1 — off or on.
So eight switches in a row can hold any number from 00000000 (0) to 11111111 (255): 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. That is 256 different numbers, which matches what Lesson 1.2 taught you: eight switches, doubling eight times, give 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 = 256 arrangements.
Here is the deep idea. A computer does not "contain" numbers the way a notebook does. It contains switches, and the pattern of which switches are on is the number. Binary is simply how we write that pattern down. When we say a computer "stores 65", what is really there is a row of tiny transistors set to off-on-off-off-off-off-off-on.
Everything else in this module — letters, colours, photos, songs — will turn out to be numbers. And now you know that every number is just switches.
Common mistakes
| The mistake | Why it is wrong | What to do instead |
|---|---|---|
| Reading binary "10" as ten | In binary it means one 2 and zero 1s: two | Always write the place values (…4, 2, 1) above the digits |
| Making each place ten times bigger | Binary places double: 1, 2, 4, 8, 16… | Each place is worth twice the place to its right |
| Starting the place values from the left | The 1s place is always on the far right | Write the place values from the right, doubling as you go left |
| Thinking extra zeros at the front change the number | 00101 is still 5, like 052 is still 52 | Leading zeros only make numbers the same length |
| "Binary is a different kind of maths" | It is the same place-value idea with two digits instead of ten | Carry when you run out of digits, exactly as in decimal |
The short version
- In decimal (base 10), each place is worth ten times the place to its right, and we use digits 0–9.
- In binary (base 2), each place is worth twice the place to its right — 1, 2, 4, 8, 16… — and the only digits are 0 and 1.
- To read binary: add up the place values that have a 1. 1101 = 8 + 4 + 1 = 13.
- To write a number in binary: use the biggest places that fit, like paying with the biggest notes; mark used places 1 and skipped places 0.
- Your five fingers, worth 1, 2, 4, 8 and 16, can count from 0 to 31.
- Each binary digit is a bit — one switch, off or on. Eight bits hold 0 to 255.
Try it yourself
Become a five-bit computer.
- Using the finger values above, show these numbers on one hand, one after the other: 3, 7, 12, 19, 25, 31. Say each finger's value out loud as you raise it.
- Count from 0 to 31 on your hand without stopping. It gets fast once you notice that the thumb goes up and down every single time.
- On paper, write these numbers in binary: 6, 9, 20, 64. Then check each one by adding its place values back up.
- Read these binary numbers: 111, 1010, 10000, 11111111.
- Teach a younger person in your house to count to 7 on three fingers.
You'll know you've got it when you can turn any number up to 255 into binary and back on paper, count to 31 on one hand without looking at a chart, and explain to someone why "10" in binary means two.
More free previews
- ▶What a computer actually is15 min
- ▶Yes, no and the logic of every decision20 min
- ▶Opening the box20 min
- ▶From numbers to words: how people talk to processors25 min
- ▶What a file really is20 min
- ▶How bits travel: wires, light and radio20 min
- ▶What really happens when you open a web page20 min
- ▶How passwords are stored, and cracked25 min
- ▶From rules to learning20 min
- ▶The whole journey: from a tap in Lagos to a screen in London25 min