Lesson 1: Counting with Switches — Repeated Doubling and 8-Bit Binary
Time: 50 minutes
Unit: Binary, Pixels, Logic Gates, and Packet Switching | Next: Lesson 2: Letters and Pictures in Bits
Goal
Convert whole numbers between 0 and 255 to and from 8-bit binary using repeated-doubling place-value cards (128, 64, 32, 16, 8, 4, 2, 1), and explain why adding one more card doubles the number of possible patterns.
Materials
- 8 index cards (or half-sheets of paper) per pair of students.
- Thick dark marker for drawing dots/numbers on one side of each card.
- Chalkboard or whiteboard for class place-value comparison.
Steps
1. Opening (5 min): Why Only Two States?
Hold up a classroom light switch (or draw a simple switch on the board). Ask:
- "In everyday base-10 arithmetic, each digit slot can hold 10 different symbols (0 through 9). Why doesn't a computer wire use 10 different voltage levels (0V, 1V, 2V, ..., 9V) for each digit?"
- Guide students to notice that electrical wires experience tiny fluctuations (heat, static, long cables). Distinguishing 10 close voltage levels is fragile, whereas distinguishing two clearly separated states — OFF (0) vs. ON (1) (or dark vs. bright, unmagnetized vs. magnetized) — is fast and reliable.
2. Main Activity Part A (15 min): Building the 8 Doubling Cards
Have each student pair make a row of 5 cards first, arranged right to left just like base-10 place value:
1. On the rightmost card, write 1 and draw 1 dot.
2. Move one slot left: double the previous card to write 2 (2 dots).
3. Move one slot left: double 2 to write 4 (4 dots).
4. Move one slot left: double 4 to write 8 (8 dots).
5. Move one slot left: double 8 to write 16 (16 dots).
Now extend the row to a full byte (8 bits) by doubling three more times to the left: 32, 64, and 128:
| Bit slot (left to right) |
Card 8 |
Card 7 |
Card 6 |
Card 5 |
Card 4 |
Card 3 |
Card 2 |
Card 1 |
| Place value (doubling right to left) |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
Explain the rule:
- Face-up (ON) = 1 (add this card's value to your total).
- Face-down (OFF) = 0 (do not add this card's value).
Worked Example 1: Binary to Base-10 (00101101)
Suppose the 8 cards read 0 0 1 0 1 1 0 1:
| Card value |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
Bit (1 = ON, 0 = OFF) |
0 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
Add only the cards switched ON (1):
32 + 8 + 4 + 1 = 45.
Worked Example 2: Base-10 to 8-Bit Binary (100)
To build a target number like 100, always work from left (128) to right (1) using the greedy subtraction check:
1. Does 128 fit into 100? No (128 > 100) → write 0, remainder is still 100.
2. Does 64 fit into 100? Yes (64 <= 100) → write 1, subtract 100 - 64 = 36 remaining.
3. Does 32 fit into 36? Yes (32 <= 36) → write 1, subtract 36 - 32 = 4 remaining.
4. Does 16 fit into 4? No → write 0.
5. Does 8 fit into 4? No → write 0.
6. Does 4 fit into 4? Yes (4 <= 4) → write 1, subtract 4 - 4 = 0 remaining.
7. Does 2 fit into 0? No → write 0.
8. Does 1 fit into 0? No → write 0.
Result: 01100100 (64 + 32 + 4 = 100).
3. Discussion Questions (10 min)
- Question A: "Look at the sum of all cards to the right of
16: 8 + 4 + 2 + 1 = 15. Look at all cards to the right of 64: 32 + 16 + 8 + 4 + 2 + 1 = 63. What pattern do you notice?"
- Example good answer: Every card is always
1 more than the sum of all smaller cards to its right! That means if your remaining target is 64 or more, you must turn on the 64 card because all smaller cards combined only reach 63. This guarantees every whole number from 0 to 255 has one and only one 8-bit binary pattern.
- Question B: "How can you tell in one second whether an 8-bit binary number is odd or even?"
- Example good answer: Look only at the rightmost card (
1). Every other card (128, 64, 32, 16, 8, 4, 2) is an even number, so the sum is odd if and only if the 1 bit is 1.
4. Student Practice & Closing Check (20 min)
Practice Tasks (1.1 – 1.8)
- Task 1.1: Convert the 8-bit binary number
00010110 to a base-10 number.
- Task 1.2: Convert the 8-bit binary number
10000101 to a base-10 number.
- Task 1.3: Convert the 8-bit binary number
11111111 (all 8 cards turned ON) to a base-10 number.
- Task 1.4: Write the base-10 number
19 in 8-bit binary.
- Task 1.5: Write the base-10 number
75 in 8-bit binary.
- Task 1.6: Write the base-10 number
200 in 8-bit binary.
- Task 1.7 (Pattern Reasoning): Without converting both numbers to base-10 first, what happens to the value of
00001101 (13) when you shift every bit one slot to the left and put a 0 on the right (00011010)? Explain why.
- Task 1.8 (Capacity & Doubling): A 4-bit system can represent
16 different numbers (0 through 15). How many different numbers can a 5-bit system represent, and what is the largest number it can hold?
Complete Answer Key (Tasks 1.1 – 1.8)
- Answer 1.1:
16 + 4 + 2 = 22.
- Answer 1.2:
128 + 4 + 1 = 133.
- Answer 1.3:
128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255 (which is 1 less than the next doubling value, 256).
- Answer 1.4:
19 = 16 + 2 + 1 → 00010011.
- Answer 1.5:
75 = 64 + 8 + 2 + 1 → 01001011.
- Answer 1.6:
200 = 128 + 64 + 8 → 11001000.
- Answer 1.7: Shifting left by one slot doubles the number from
13 (8 + 4 + 1) to 26 (16 + 8 + 2), because every ON bit moves to a card worth twice as much (just as appending a 0 in base-10 multiplies by 10).
- Answer 1.8: Adding a 5th bit (the
16 card) doubles the number of patterns from 16 to 32 different numbers (16 patterns with the 16-card OFF, plus 16 patterns with the 16-card ON). Because 0 uses one pattern, the range is 0 through 31 (16 + 8 + 4 + 2 + 1 = 31).
Vocabulary
- bit (binary digit): A single two-state switch or symbol that can be either
0 (OFF) or 1 (ON).
- byte: A group of
8 bits treated as a single unit, capable of representing 256 distinct patterns (0 through 255).
- place value: The numerical value assigned to a digit slot based on its position (
1, 2, 4, 8, 16, 32, 64, 128 from right to left in binary).
Differentiation
- Extra support: Start with only the 4 rightmost cards (
8, 4, 2, 1) with pre-drawn dots (or large paper tokens, pointing, or verbal counting rather than small loose objects) so students can count the dots on each card directly before flipping cards face-up or face-down to build 1 through 15.
- Extra challenge: Ask students how a computer could represent negative numbers or fractions using 8 bits, or challenge them to add two 8-bit binary numbers (
00010110 + 00001011) column by column using the carry rule 1 + 1 = 2 (write 0, carry 1 to the next doubled slot).
Safety
No physical hazards in this unplugged lesson.
Teacher notes
- Common misconception 1 (Reading left-to-right vs. right-to-left): Some students place
1 on the far left and 128 on the far right. Remind them that binary uses the exact same convention as base-10: the smallest place value (1) is always on the far right, and values grow larger as you move left.
- Common misconception 2 (Forgetting that
00000000 counts as a pattern): Students often ask why 8 bits (256 patterns) maxes out at 255 instead of 256. Point out that in base-10, two digits give 100 patterns (00 through 99), not 100!