A computer stores numbers with switches that are only off (0) or on (1). Put bits side by side, make each place worth double the one on its right (1, 2, 4, 8, 16), and add the places that hold a 1: 10110 = 16 + 4 + 2 = 22.
A computer has no digits from 2 to 9, only switches that are off or on. So how does it store the number 22?
Text, pictures and sound are all stored as numbers. But inside, a computer has no digits from 2 to 9. A bit is one switch that is either off or on. We write off as 0 and on as 1. One bit can only count to 1, so a computer puts bits side by side.
The cards below are bits. Each card is worth double the card on its right, and a card face up is a 1. The number is the total of the cards that are face up. This way of writing numbers is called binary.
Predict: Read the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Try: Try it on the board and compare the result with your prediction.
Investigate: Work out why it happens, one step at a time.
Modify: Change the problem on purpose and see what happens.
Practise: A few on your own, to check you have it.
Make: Make your own problem using what you have learned. Expect a few tries; that is normal.
Make your prediction first. Help opens once you've locked it in.
PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Read the cards
TryTry it on the board and compare the result with your prediction.
Try: turn up the cards
Was your prediction right? Each 1 adds its card's value; each 0 adds nothing.
Try it yourselfYour edits are saved in this browser.
Click the 8, 2 and 1 cards to turn them face up, so the bits read 1011. What number does the board show?
Use the board. This ticks when you get there.
InvestigateWork out why it happens, one step at a time.
Worked example: read and write binary
Here is 10110 read one place at a time. The places start at 1 on the right and double each time.
Worked exampleBefore each step, say what you think comes next.
10110Five bits, so five places.
168421Start at 1 on the right and double: 2, 4, 8, 16.
16+4+2Keep the places that hold a 1. The 0s add nothing.
16+4+2=22Add them: 10110 in binary is 22.
Now read 10011 the same way.
Which end is the 1 place?
Five cards are worth 16, 8, 4, 2 and 1. What number is **10011** in binary?
Sam reads 1100 in binary. Click the line where the working first goes wrong.
ModifyChange the problem on purpose and see what happens.
Vary: one change at a time
Start with the biggest card that fits, then fill in the rest.
Try it yourselfYour edits are saved in this browser.
Make 6. Which cards do you need?
Use the board. This ticks when you get there.
Now make 7, one more. How many cards did you have to change?
Use the board. This ticks when you get there.
Now make 8, one more again. Which cards changed this time?
Use the board. This ticks when you get there.
Make 19 using the 16 card.
Use the board. This ticks when you get there.
Write 13 in binary with four bits (places 8, 4, 2, 1).
PractiseA few on your own, to check you have it.
Read and write binary
What number is **1001** in binary?
What number is **11000** in binary?
Write 20 in binary with five bits.
What number is **11111** in binary?
Review: what is 24?
MakeMake your own problem using what you have learned. Expect a few tries; that is normal.
Three cards up
Stretch: what is the smallest number with exactly three cards up? Write it in binary.
Try it yourselfYour edits are saved in this browser.
Need a hint?
The cards on the left are worth the most.
Another hint
Use the three biggest cards.
The number is hidden. Turn up exactly three cards to make the biggest number you can, then work it out.
Use the board. This ticks when you get there.
For teachers
Students turn binary cards face up to see that each place is worth double the one on its right, read and write numbers in binary, and say why computers use two states (AC9TDI8K04). About 40 minutes.
I can read a binary number by adding the places that hold a 1.
I can write a number in binary.
I can say why computers store numbers as bits.
Before class
Do the Try board yourself first. If you have time, do CS Unplugged's binary cards activity with real cards before the board: five students hold the 16, 8, 4, 2 and 1 cards at the front and turn them over to make numbers. The board is the same model.
The one idea: each place is worth double the one on its right, and the number is the sum of the places holding a 1. The "why" in AC9TDI8K04 is the last Worked example task: two states are easy to tell apart reliably.
This lesson uses no code. Students who have done the coding lessons have met bits as micro:bit LEDs (on or off) and as True or False.
Running the lesson
Predict: students who chose 1011 read it as a base-10 number; 3 counted the 1s.
Try: ask which card is worth the most, and why it is on the left (like the thousands column).
Worked example: have students say the places aloud from the right before revealing line 2.
Vary: before 7 to 8, ask students to predict how many cards will change.
Make: collect answers and the stretch (7, 00111): what is the difference?
The hard part (on purpose)
Reading binary as an ordinary number (1011 as one thousand and eleven). Have students say binary digit by digit ("one zero one one") and point at each card's value as they add.
When students get stuck
A student writes 1011 = one thousand and eleven. Ask: Which cards are face up, and what are they worth? Fix: Point at each 1 and say its card's value, then add.
A student reads 1100 as 3 (Sam's mistake). Ask: Which end is the 1 card? Fix: Write 8 4 2 1 above the digits before reading.
A student writing 13 in binary gets stuck. Ask: What is the biggest card that fits in 13? Fix: Take the 8, then 5 is left: the biggest card that fits is 4, then 1 is left.
Stretch and support
Stretch: Count from 0 to 15 in binary on four cards. Which card flips every time? Which flips every second time? Every fourth?
Support: Keep the card values (16 8 4 2 1) written above every binary number until reading them is automatic.
Where it leads
Next: How many patterns? (how many numbers a set of bits can hold, and overflow).
Where it leads: the 0 to 255 limits students met in text, colours and sound come from bits (How many patterns?). Later: why binary (logic gates) and how bits underpin every encoding. In maths, the places are powers of 2, as base-10 places are powers of 10.
read the cards: Committing to a value for 1011 shows whether students read the places as doubling (8, 4, 2, 1) or read the digits as a base-10 number.
Try: turn up the cards: Turning up the 8, 2 and 1 cards and watching the total settles the prediction: binary 1011 is 11, the sum of the places holding a 1.
Worked example: read and write binary: Reading 10110 one place at a time (places doubling from 1 on the right) models the new move; Sam counts the places from the left, the misconception planted after the method; and the why question ties bits to on and off states in hardware.
Vary: one change at a time: Each task changes one thing: a new number, one more (only the 1 card flips), then one more again (every card flips back and the 8 goes up, like a carry), then a fifth card. The last two show why the next place is worth double.
read and write binary: Reading and writing binary both ways, including a number with many 0s and an edge case (all 1s), plus a review of powers of 2 from maths.
three cards up: Building the biggest number with exactly three cards up reverses the process: students choose cards to reach a target, and see that the left cards count most.
Now you can
Read a binary number by adding the places that hold a 1.