Students trace characters, colours and sound samples from data to numbers to bytes on eight binary cards, closing the loop between data representation and binary (AC9TDI8K04 node 4).
Open these in Waypoints Prepare with one click. To share a file another way, copy its address and paste it into Load URL, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.
WorksheetOpen in PrintDownload Print the student copy; the Teacher edition has the answers.
Students will be able to
I can turn a character into its code and then into binary.
I can work out how many bits a word or a picture takes.
I can explain that all data becomes bits.
Timing
Predict and Try 6 min · Worked example 10 min · Vary 9 min · Practise and Make 10 min
Before class
The integration node (the kit calls it the cross-standard point between K03 and K04): students assemble data → number → binary for two kinds of data.
Simplification: text here is one byte a character (ASCII). Unicode characters beyond 255 take two to four bytes (Text as numbers).
Running the lesson
Predict: students who chose 65 or A haven't joined the two halves yet; the Try does it.
Worked example: ask what the 24 bits of a black pixel look like.
Vary: ask why lower case is always the 32 card added.
Make: have students write their initials as bytes on paper.
In class
On the slides at these points. Students can do the whole lesson on their own; these are for the room. In the deck, the Run, Modify and Make slides have the live playground in them (the tutorial link is the backup), and the notes above are in each slide's speaker notes.
Think, pair, share(start) Text, colour and sound are all numbers, and numbers are bits. So is a photo just a very long string of 0s and 1s?
What would you need to know to turn that string back into the photo?
What do 8 bits in a row give you?
Yes, and the reading rules tell you where each piece starts and stops. This lesson is the chain: character, code, 8 bits.
Spell it in switches(predict, 6 min)
Use a chart of codes. Write your initials as codes, then as bytes (8 bits each). A partner reads your bits back and checks the letters.
A is 01000001. Wrong order of bits is the common slip. Check against the Predict's answer before students use the board.
Where do letters stop?(run, 3 min)
Here are 16 bits with no gaps. How do you know where one letter ends and the next begins?
Every character here is exactly 8 bits, so count in eights. That's why a byte matters.
How many bits?(investigate) How many bits does the word cat take, with 8 bits for each letter? 24 3 letters × 8 bits = 24 bits.
The hard part (on purpose)
Students think a character is one bit. Ask how many different things one bit can be (two), then how many characters there are.
When students get stuck
What you will see
A question to ask
The fix
A student says a character is one bit (Sam's mistake).
How many values can one bit hold? How many letters are there?
A byte holds 256 values: enough for a character code.
A student mixes bytes and bits.
How many bits in a byte?
8. Multiply bytes by 8 to get bits.
Answers to the checks
the letter A: The letter **A** has the code 65. How is it stored in the computer's memory? 01000001. The computer stores only bits: 65 = 64 + 1, so on 8 bits (one byte) the 64 and 1 places are 1.
Try: one byte for A: Set the eight cards to 65, the code for A. What pattern of bits is it?
65 = 64 + 1, so A is 01000001: one byte.
Text and a pixel: One pixel is three numbers (red, green, blue), each one byte. How many **bits** is one pixel? 24 3 bytes × 8 bits = 24 bits.
Find the mistake: Sam works out how many bits the word cat takes. Click the line where it first goes wrong. line 3 Line 3: one bit can only be 0 or 1, not one of all the letters. Each character's code needs a byte: 8 bits. So cat is 3 × 8 = 24 bits.
What does a byte mean?: The byte **01000001** is in memory. What does it mean? It depends on how a program reads it As text it is A, as a number 65, as a colour amount a dark shade. Bits are just bits. The encoding (text, number, colour, sound) decides what they mean, as in Everything is numbers.
H to I: The cards show 72, the code for H. Make 73, the code for I.
One more: only the 1 card changed. 01001001.
Lower case: Now make 104, the code for lower case h. Which card did you have to add?
104 = 72 + 32: lower case adds the 32 card. 01101000.
Full colour: Make 255, a colour amount at full.
255 is every card up: 11111111, the biggest byte.
Silence: Make 128, a sound sample at the middle (silence).
128 is just the left card: 10000000.
A space: Make 32, the code for a space.
A space is 00100000: still a whole byte, though nothing shows.
Bits in a word: How many bits does the word **hello** take, at one byte a character? 40 5 bytes × 8 = 40 bits.
Bytes in a picture: A 2 × 2 picture, three bytes a pixel. How many bytes? 12 4 pixels × 3 = 12 bytes (96 bits).
Sound samples: Music often uses 65 536 levels a sample. How many bytes is each sample? 2 (16 bits) 2¹⁶ = 65 536, so 16 bits: 2 bytes.
Byte to character: As text, which character is the byte **01000010**? B (66) 64 + 2 = 66, which is B.
a lower case letter: The number is hidden. Set the cards to the byte for lower case a.
a is 65 + 32 = 97 = 64 + 32 + 1, so 01100001.
Solutions
One possible solution for each task. Other correct programs are fine.
Vary: one letter at a time › H to I
Open task: any program that does what the step asks.
Vary: one letter at a time › Lower case
Open task: any program that does what the step asks.
Vary: one letter at a time › Full colour
Open task: any program that does what the step asks.
Vary: one letter at a time › Silence
Open task: any program that does what the step asks.
Vary: one letter at a time › A space
Open task: any program that does what the step asks.
a lower case letter
Open task: any program that does what the step asks.
Stretch and support
Stretch: A phone photo is about 4000 × 3000 pixels. Roughly how many bytes before compression? (36 million.) Why do we need compression?
Support: Keep the 128 64 32 16 8 4 2 1 card values written above the board.
Exit ticket
Write the letter C as a byte. How many bits is the word Hi?
C = 67 = 64 + 2 + 1 = 01000011. Hi = 2 bytes = 16 bits.
What each step is for
the letter A: Committing to how A sits in memory tests the new move: the character becomes its code, and the code becomes a fixed number of bits.
Try: one byte for A: Setting the code 65 on eight cards settles the prediction: A becomes 01000001.
Worked example: trace the chain: Tracing a character and a pixel through data → number → binary models the new move. Sam counts one bit per character, the misconception planted after the method.
Vary: one letter at a time: Each task changes one character or one value: H to I (one more), H to h (one card, the 32), a colour amount at full, a sound sample at the middle, then a space.
bytes and bits: Counting bytes and bits for text, images and sound, and reading a byte back to a character.
a lower case letter: Building the byte for lower case a from the code rule reverses the chain: from a character to its code to its bits, with the number hidden.
Where it leads
This closes the Data representation course.
Next (Years 9–10): Making data smaller (compression). Code links: Secret messages shifts these codes; colour values in turtle are these bytes.