CS Unplugged activity
Count the Dots: binary numbers
So you thought you knew how to count? Here is a new way to do it. Everything you see or hear on a computer (words, pictures, numbers, movies, and even sound) is stored using just two symbols: 0 and 1. In this activity you’ll find out how, using five cards and some dots.
Why only two?
It is much easier to build a machine that tells apart two things than ten. A wire has electricity or it doesn’t. A spot on a disc reflects light or it doesn’t. Computers don’t really have 0s and 1s inside them, just high and low voltages, but “0” and “1” are quicker to write.
Get ready
Here are your five dot cards. They always stay in exactly this order:
To “flip a card face down,” cover it with a coin, a scrap of paper, or your finger. The cards you can still see are face up. If you have nothing to cover them with, just circle the ones you’re using.
The one rule: a card is either completely face up (you can see its dots) or completely face down (covered). No half-covered cards.
Part 1: Spot the pattern
Look at the dots on each card, from right to left: 1, 2, 4, 8, 16.
- What happens to the number of dots each time you move one card to the left?
- If you made a sixth card to go on the left, how many dots would it have? A seventh card?
Part 2: Make numbers
Cover cards until the dots still showing add up to the number. Write down which cards are face up.
| Make this many dots | Cards face up |
|---|---|
| 5 | |
| 3 | |
| 12 | |
| 19 |
- Is there more than one way to make any of these numbers?
- What is the biggest number you can make? The smallest?
- Is there any number between the smallest and biggest that you can’t make?
Part 3: Write it in binary
Now write your cards down as digits. A face-down card is a 0. A face-up card is a 1. Always write all five, starting with the 16 card.
For example, 01001 means: 16 down, 8 up, 4 down, 2 down, 1 up. That’s 8 + 1 = 9.
| Binary | Number |
|---|---|
| 10101 | |
| 11111 | |
| 00110 | |
| 17 | |
| the day of the month you were born: |
Part 4: A message in lights
Tom is trapped on the top floor of a department store. It’s just before Christmas, and he wants to get home. He has tried calling, even yelling, but there is no one around. Across the street, someone is still working late at a computer. How can he get her attention?
Then he has an idea: he can use the Christmas tree lights to send her a message! He plugs them in so he can turn them on and off, using the same binary code you just learned.
Each row in the picture is one letter, read top to bottom in the order 16 8 4 2 1. A lit tree is a 1. A dark square is a 0. Use the code 1 = a, 2 = b, 3 = c, …, 26 = z to work out Tom’s message.
Tom’s message:
What’s it all about?
Each 0 or 1 is called a bit, short for binary digit. Normal numbers use ten digits (base ten); binary uses two (base two), so each card is worth twice the one to its right instead of ten times.
One bit on its own can’t say much, so computers group bits in eights. A group of eight bits is a byte, and it can stand for any number from 0 to 255. Every file you have ever opened is just a long list of bytes.
Check your answers
Part 1. Each card has double the dots of the card to its right. The sixth card would have 32 dots, the seventh 64.
Part 2. 5 = 4 + 1. 3 = 2 + 1. 12 = 8 + 4. 19 = 16 + 2 + 1. There is only ever one way to make each number. The biggest is 31 (all face up) and the smallest is 0 (all face down), and you can make every number in between.
Part 3. 10101 = 21. 11111 = 31. 00110 = 6. 17 = 10001. For your birthday, check it the other way: add up the cards you wrote as 1.
Part 4. 8 5 12 16, 9 13, 20 18 1 16 16 5 4: HELP IM TRAPPED.
Challenge.
- Start at the right. Flip each card; stop as soon as you flip one face up.
- The total is always one less than the next card: 1 + 2 + 4 = 7 (next card is 8), and 1 + 2 + 4 + 8 = 15 (next card is 16).
- One hand counts 0 to 31, which is 32 numbers. Two hands count 0 to 1023, which is 1,024 numbers.
- The number doubles. Every card slides one place left, so every 1 is now worth twice as much.
- There are around 100 characters. Six bits gives only 64 codes, seven gives 128, so you need 7. Computers usually store each one in an 8-bit byte.
Version history
- Loading commit history…