Students count up on binary cards to find that n bits make 2ⁿ patterns and hold 0 to 2ⁿ − 1, see a count overflow, and choose how many bits a number needs (AC9TDI8K04).
Load these into Waypoints Prepare: choose Load URL and paste the copied address, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.
SlidesDownload Present from the browser, or export to PowerPoint or PDF.
WorksheetDownload Print the student copy; the Teacher edition has the answers.
Students will be able to
I can work out how many patterns some bits can make.
I can find the biggest number some bits can hold.
I can explain overflow, and choose how many bits a number needs.
Timing
Predict and Try 8 min · Worked example 10 min · Vary 12 min · Practise and Make 10 min
Before class
Do the Try and Vary boards yourself first. Students need Bits and binary numbers (reading binary) and powers of 2 from maths.
The one idea: each extra bit doubles the number of patterns, so n bits make 2n patterns, and because one pattern is 0, the largest number is 2n−1. Overflow is what happens when you count past it.
Real examples worth a minute: colour values 0 to 255 (one byte each); the micro:bit LED brightness 0 to 255; game scores and counters that wrapped round. Students who have done Arcade or micro:bit can look for 255 limits in the blocks.
Running the lesson
Predict: students who chose 16 counted the patterns but forgot 0; 4 counted the cards.
Try: ask how many presses it took to get from 0 to 1111, and how many patterns that makes.
Worked example: pause before line 3 and ask why we multiply, not add.
Vary: before Add a card, ask students to predict the new card's value and the new biggest number.
Make: have students say the range first (0 to 39), then the bits.
The hard part (on purpose)
Forgetting that one pattern is 0, so saying 4 bits go up to 16. Ask "what do the cards show when they are all face down?" every time a largest number comes up.
When students get stuck
What you will see
A question to ask
The fix
A student says 4 bits hold 1 to 16 (Sam's mistake).
What number do the cards show when they are all face down?
0 is one of the patterns, so the 16 patterns are 0 to 15.
A student says 10 bits make 20 patterns.
What happens to the patterns when you add one card?
Each card doubles them: 2, 4, 8, 16, …, so multiply.
A student thinks overflow is an error message.
What does + 1 do to 1111 if there is no fifth card?
Every card flips down: the computer just loses the carry.
Answers to the checks
the biggest number: You have four cards, worth 8, 4, 2 and 1. What is the **biggest** number they can show? 15. All four cards face up: 8 + 4 + 2 + 1 = 15. There are 16 patterns, but one of them is 0, so the biggest is 15. 1111 is 15 written in binary.
Try: count up: Press + 1 to count up until every card is face up. What number is it?
1111 = 8 + 4 + 2 + 1 = 15. Counting from 0, that took 15 presses, so with 0 there are 16 patterns.
Count the patterns: What is the biggest number **five** bits can show? 31 11111 = 16 + 8 + 4 + 2 + 1 = 31. Five bits make 2⁵ = 32 patterns: 0 to 31.
Find the mistake: Sam works out how many numbers 4 bits can show. Click the line where the working first goes wrong. line 4 Line 4: the 16 patterns are 0000 to 1111, so the numbers are 0 to 15. Sam left out 0 (all cards face down).
Three bits: How many different patterns can **three** bits make? 8 2 × 2 × 2 = 8 patterns: 000, 001, 010, 011, 100, 101, 110, 111. That is 0 to 7.
One past the biggest: The board shows 1111, which is 15. Press + 1 once. What happens to the cards?
Every card went face down and the count went back to 0. Four bits cannot show 16, so the count overflows.
Add a card: Press Add a card. What is the new card worth? Make the biggest number five cards can show.
The new card is worth 16, double the 8. All five up: 16 + 8 + 4 + 2 + 1 = 31.
Six cards: Add one more card and make the biggest number six cards can show.
The new card is worth 32. 32 + 31 = 63, which is 2⁶ − 1.
A byte: Eight bits are called a **byte**. What is the biggest number a byte can hold? 255 2⁸ = 256 patterns, so a byte holds 0 to 255.
How many bits?: What is the **fewest** bits that can hold the number 100? 7 Six bits hold 0 to 63, seven bits hold 0 to 127. 100 needs seven bits.
Ten bits: How many different patterns can **ten** bits make? 1024 210=1024 patterns, so ten bits hold 0 to 1023.
Score overflow: An old game stores the score in one byte. The score is 255 and the player scores 1 more point. What does the score show? 0 255 is 11111111. Adding 1 overflows: every bit flips to 0 and the score shows 0. Real games have had bugs like this.
Colour values: In many programs, the amount of red in a colour goes from 0 to 255. How many bits store it? 8 0 to 255 is 256 values, and 28=256. So each colour amount is one byte.
Three bits: What is the biggest number **three** bits can show? 7 111 = 4 + 2 + 1 = 7.
Review: read binary: Review: what number is **10101** in binary? 21 10101 = 16 + 4 + 1 = 21.
enough bits: A school gives each student in a group an ID number from 0 to 39. Use the fewest cards that can show 39, then set them to 39.
Five cards stop at 31, so you need six (0 to 63). 39 = 32 + 4 + 2 + 1, so 100111.
Solutions
One possible solution for each task. Other correct programs are fine.
Vary: one change at a time › One past the biggest
Open task: any program that does what the step asks.
Vary: one change at a time › Add a card
Open task: any program that does what the step asks.
Vary: one change at a time › Six cards
Open task: any program that does what the step asks.
Vary: one change at a time › A byte
Open task: any program that does what the step asks.
Vary: one change at a time › How many bits?
Open task: any program that does what the step asks.
enough bits
Open task: any program that does what the step asks.
Stretch and support
Stretch: How many bits would you need to give every person on Earth (about 8 billion) a different number? (33: 2³² is about 4.3 billion, 2³³ about 8.6 billion.)
Support: Keep a doubling table beside the board: bits 1 to 8, patterns 2 to 256, biggest 1 to 255.
Exit ticket
How many patterns can 6 bits make, and what is the biggest number they can hold?
2⁶ = 64 patterns, so 0 to 63. The biggest is 63.
What each step is for
the biggest number: Committing to the largest 4-bit number shows whether students forget that one pattern is 0 (16), confuse it with the number of cards (4), or read 1111 as a base-10 number.
Try: count up: Counting up with + 1 until every card is face up settles the prediction: the count stops at 1111, which is 15.
Worked example: count the patterns: Counting the patterns as 2 × 2 × 2 × 2 models the new move: n bits give 2ⁿ patterns and the largest is 2ⁿ − 1. Sam counts 16 patterns and then forgets 0, the misconception planted after the method.
Vary: one change at a time: Each task changes one thing: one more past the largest (overflow), one more card (patterns double), another card, then a byte, then the edge case of choosing how many bits a number needs.
patterns and limits: Patterns and largest numbers for other bit counts, overflow in a real context, why colour values stop at 255, and a review of reading binary from lesson 1.
enough bits: Choosing the fewest cards for a given range reverses the process: students start from the largest number needed and work out the bits, then check it on the board.
Where it leads
Builds on: the data as numbers lessons. Colour amounts (0 to 255) are one byte each, and 16-bit audio has 2¹⁶ = 65 536 levels: ask students to explain both now.
Where it leads: data sizes (bytes, kilobytes) and, in Years 9–10, compression.