How do you write the number 13 with nothing but on and off?
Lesson 2.2 · Counting With Switches
Jenny · Mark · Sarah
Four switches, a marker and some cardboard.
Jenny lines up four light switches on a scrap of cardboard and writes numbers above them: 8, 4, 2, 1.
Rule: add up the numbers over every switch that’s on. Mark thinks this will take forever.
Sarah tries 5 and gets it in two seconds. Mark tries 13 and goes quiet.
The short answer
Turn on the switches worth 8, 4 and 1, and leave the 2 off: 1101. Mark got there eventually. It’s the same counting you’ve done since kindergarten, with two digits instead of ten.
Try it yourself
Flip the switches to make each number. Add up the numbers over the switches that are on.
Make 5
1 of 3
Adds up to 0
What you just did has a name
A bit
A bit is one binary digit: a single switch, on or off, 1 or 0.
In binary, each place is worth double the one to its right, so four bits are worth 8, 4, 2 and 1.
Turn on the 8, the 2 and the 1 and you get 1011, which is 11.
It’s the same idea as regular numbers, where each place is worth ten times more. Binary just uses two instead of ten.
A few more things
Same as the numbers you know
In 352, the 3 means three hundreds, the 5 means five tens, the 2 means two ones. In binary 0110, it’s no eights, one four, one two and no ones: six. Same idea, different base.
Why two and not ten?
You could build a switch with ten positions. It would be easy to misread when the power wobbles. On and off is hard to get wrong, even in a chip with billions of switches.
Counting up
0, 1, 10, 11, 100, 101. Binary counting looks funny because it runs out of digits fast. Every time you fill a place, you carry to the next, just like 9 rolling over to 10.
Go deeper
The longer version, if you want it.
Reading binary in your head
Write the place values over the digits, right to left: 1, 2, 4, 8, 16, 32, 64, 128. Add up the ones that sit over a 1. So 10010 is 16 plus 2, which is 18. That’s all there is to it.
Going the other way, take the biggest place value that fits, subtract it, and repeat. 13 is 8, with 5 left. 5 is 4, with 1 left. Then 1. So 8, 4 and 1 are on: 1101.
Quick check
Four switches, worth 8, 4, 2 and 1. The 8 and the 2 are on. What number is that?
Let’s take it slower
Think of coins, but weird ones: an 8-cent coin, a 4-cent coin, a 2-cent coin and a 1-cent coin, and you only have one of each. To pay 13 cents, you hand over the 8, the 4 and the 1. To pay 6 cents, the 4 and the 2. Every amount from 0 to 15 works, and there’s only one way to do each. Binary is that coin purse.
More examples
The number 7
Switches worth 4, 2 and 1 on, the 8 off: 0111. Add 4 plus 2 plus 1 and you get 7.
Your age in binary
If you’re 14, that’s the 8, the 4 and the 2 switched on and the 1 off: 1110. Next birthday you flip the 1 on and you’re 15, which is every switch on. The birthday after that, you need a fifth switch.
Back to the question
So how do you write 13 with on and off?
Show the answer
Turn on the switches worth 8, 4 and 1, and leave the 2 off: 1101. Mark got there eventually. It’s the same counting you’ve done since kindergarten, with two digits instead of ten.
One last question
Build the number 9 with four switches, starting from the 8 switch on the left.
Tap the pieces in order. Tap one again to take it back.
Talk Card
Talk Card · 2.2
Binary is counting with two digits instead of ten. 13 is just the 8, the 4 and the 1 switched on.
How Computers Work · pettigrewlab.com/learn


