Every kind of data ends up as bits: a character becomes its code, and the code becomes 8 bits (A is 65, which is 01000001). A pixel is three codes, so 24 bits. The chain is always the same: data, then numbers, then binary.
You now know how text, pictures and sound become numbers, and how numbers become bits. What does the letter A actually look like inside the computer?
The data lessons showed that text, pictures and sound are all stored as numbers. The binary lessons showed how a number is stored as bits. Put the two together and every piece of data is a chain: data → number → bits. Eight bits make a byte, which holds 0 to 255: one character code, one colour amount or one sound sample.
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.
The letter A
TryTry it on the board and compare the result with your prediction.
Try: one byte for A
Was your prediction right? The leading 0 keeps every character the same length: 8 bits.
Try it yourselfYour edits are saved in this browser.
Set the eight cards to 65, the code for A. What pattern of bits is it?
Use the board. This ticks when you get there.
InvestigateWork out why it happens, one step at a time.
Worked example: trace the chain
Worked exampleBefore each step, say what you think comes next.
A→65Text: the character's code.
65=64+1→01000001Binary on 8 bits: one byte.
yellow→255,255,0A pixel: three colour amounts.
111111111111111100000000Each amount is one byte: 24 bits for the pixel.
data→numbers→bitsEvery kind of data follows the same chain.
Now count the bits in a pixel.
One pixel is three numbers (red, green, blue), each one byte. How many **bits** is one pixel?
Sam works out how many bits the word cat takes. Click the line where it first goes wrong.
ModifyChange the problem on purpose and see what happens.
Vary: one letter at a time
Try it yourselfYour edits are saved in this browser.
The cards show 72, the code for H. Make 73, the code for I.
Use the board. This ticks when you get there.
Now make 104, the code for lower case h. Which card did you have to add?
Use the board. This ticks when you get there.
Make 255, a colour amount at full.
Use the board. This ticks when you get there.
Make 128, a sound sample at the middle (silence).
Use the board. This ticks when you get there.
Make 32, the code for a space.
Use the board. This ticks when you get there.
PractiseA few on your own, to check you have it.
Bytes and bits
How many bits does the word **hello** take, at one byte a character?
A 2 × 2 picture, three bytes a pixel. How many bytes?
MakeMake your own problem using what you have learned. Expect a few tries; that is normal.
A lower case letter
Then write your initials as bytes.
Try it yourselfYour edits are saved in this browser.
Need a hint?
Capital A is 65. Lower case letters are 32 more.
Another hint
97 = 64 + 32 + 1.
Another hint
Turn up the 64, 32 and 1 cards.
The number is hidden. Set the cards to the byte for lower case a.
Use the board. This ticks when you get there.
For teachers
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). About 35 minutes.
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.
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.
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
A student says a character is one bit (Sam's mistake). Ask: How many values can one bit hold? How many letters are there? Fix: A byte holds 256 values: enough for a character code.
A student mixes bytes and bits. Ask: How many bits in a byte? Fix: 8. Multiply bytes by 8 to get bits.
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.
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.
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.
Now you can
Turn a character into its code and then into binary.