Binary and Data Representation, Unplugged
Quick answer: Five cards showing 16, 8, 4, 2 and 1 dots let a student represent every number from 0 to 31 by turning cards face up or down. That single manipulative carries the whole topic: counting, then text encoding, then images, then file size. No computers required, and the arithmetic is small enough that students can check each other.
How does the card activity work, and what do students get wrong?
Make five cards per student or pair. On the front, print dots: sixteen, eight, four, two, one. The back is blank. Face up means the value counts. Face down means it does not.
Call out a number and students flip cards to show it. Nineteen is 16 plus 2 plus 1, so the pattern is 10011. Have them read the pattern left to right as ones and zeros, then write it down. Ten numbers takes about eight minutes.
Two errors come up every time. The first is students reading the pattern backwards, because they built it by finding the largest value first and then writing from the right. Fix it by insisting the cards stay in a fixed left-to-right order from sixteen down to one, taped to the desk if necessary.
The second is the belief that every number has one correct set of cards, which is true, but students do not believe it until they have tried to make twelve two different ways and failed. Make them try. That failure is the proof that binary representation is unique, and it lands better than telling them.
Then ask the extension question: what is the largest number five cards can show. Adding 16, 8, 4, 2 and 1 gives 31, which is one less than 32. Ask why. A class that works out that n cards reach 2 to the power n minus 1 has done real mathematics.
How do you get from numbers to letters?
Numbers are not obviously data. Text is where it clicks. Give students a printed ASCII table and a short message in decimal, for example 72 73. They look it up and find HI.
Then the useful detail. Capital A is 65 and lowercase a is 97, a difference of exactly 32, which in binary means one bit changes: 1000001 against 1100001. Students who noticed the 32 on the card activity see it immediately. That is why case conversion is fast on a computer, and it is the first moment most students realize the encoding was designed rather than discovered.
Have pairs write a five-word message in decimal, swap, and decode. Set a rule that spaces must be encoded too, which is 32, otherwise half the class ignores them and their partner cannot read the result.
The ready-made version of this lesson
- Data and Encoding: Binary and Digital Images — $24.99, instant download
- Cryptography: Understanding Encryption — $24.99, instant download
More in Computer Science for Middle School. Every download has a 30-day money-back guarantee.
What is the image activity?
Hand out grid paper marked into an eight-by-eight square. Students shade squares to draw a simple shape: a heart, an arrow, an initial. Then they write out the grid as ones and zeros, row by row, eight rows of eight digits.
Swap papers. The partner receives sixty-four digits and no picture, and has to redraw it. When it works, the class has just transmitted an image as pure numbers, which is the point of the whole topic.
Now the arithmetic. Sixty-four squares means sixty-four bits, which is eight bytes. Ask what happens with color. If each pixel needs three bytes for red, green and blue, the same eight-by-eight image becomes 192 bytes. A 100 by 100 color image is 10,000 pixels at three bytes each, so 30,000 bytes, a little under 30 kilobytes. Photos on a phone are millions of pixels, and now the question of why files are compressed answers itself.
A good closing task is run-length encoding. Ask them to write the row 1111000011110000 more briefly. Most classes invent "four ones, four zeros, four ones, four zeros" without prompting, and that is a real compression scheme.
How do you differentiate across a mixed class?
Approaching: four cards instead of five, so the range is 0 to 15, and pre-filled ASCII lookups for the first message. Give the image grid at four by four. The concepts are identical and the arithmetic stops being the obstacle.
On level: the sequence as described, five cards, eight-by-eight grid, and the file size calculation for a black and white image.
Above level: add a sixth and seventh card and ask for the general rule. Then move to hexadecimal, where they discover that four binary digits map exactly onto one hex digit and that a color code like FF0000 is three bytes written compactly. A natural next question is how those bytes travel between machines, which is the ground covered in How the Internet Works.
What goes wrong in this lesson?
Cards get lost. Print on card stock, number the sets, and count them back in. Ten minutes of remaking sets during your prep is the cost of skipping this.
The grid activity dies if students draw something too detailed. Show two examples on the board and say plainly that anything more complicated than those will not read back correctly at eight by eight.
Fast finishers finish very fast. Have the hexadecimal extension printed and ready before the lesson, not invented on the spot.
Frequently asked questions
What grade can start this?
Grade 5 can do the card activity. The file size arithmetic suits grade 7 upward, since it needs comfortable multiplication of three and four digit numbers.
How long is the full sequence?
Three periods of forty-five minutes: cards, text, images. Adding compression and hexadecimal makes it four.
Do I need to teach two's complement or floating point?
Not at this level. Unsigned whole numbers carry every idea in the unit, and negative binary numbers add confusion without adding understanding.
Can this be done as a sub plan?
The card and image activities can, if the cards are pre-cut and an answer key is left. The ASCII lesson needs someone to explain the table.


Comments
No comments yet — be the first to share your thoughts!
Leave a comment
Comments are reviewed before being published.
Thanks for your comment!
Your comment is being reviewed and will appear here shortly.