CS Unplugged activity
Count the Dots: binary numbers
CS Unplugged activity slides Lesson plan (and sub notes)
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 |
- Try to make 5 again, but with different cards than you used in the table. Can you? Does any number have two different ways to make it?
- What is the biggest number you can make? The smallest?
-
Pick three numbers between 0 and 31 and make each one with your cards. Write the number, then the cards you used.
Number Cards:
Number Cards:
Number Cards:
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.
The binary system uses zero and one to show whether a card is face up or not. 0 shows that a card is hidden, and 1 means that you can see the dots. For example:
The 8 card and the 1 card are showing, so 9 is written 01001. Check it: 8 + 1 = 9.
| Binary | Number |
|---|---|
| 10101 | |
| 11111 | |
| 00110 | |
| 17 | |
| the day of the month you were born: |
Part 4: Coded numbers
Any two symbols can be binary: one stands for 1, the other for 0. Try to work out these coded numbers. Each row has its own key underneath it (for example, ☑=1 and ☒=0). Write each number after its = sign. If a row has fewer than five symbols, the missing ones on the left are 0s.
Part 5: 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, so 5 can’t be made with different cards. The biggest is 31 (all face up) and the smallest is 0 (all face down), and every number in between works.
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. Left column, top to bottom: 9, 5, 0, 2, 0. Right column, top to bottom: 10, 13, 17, 20, 31.
Part 5. 8 5 12 16, 9 13, 20 18 1 16 16 5 4: HELP IM TRAPPED.
Version history
- Loading commit history…