A computer can only store numbers, so every letter has its own number, called its code. Capital A is 65, B is 66, and they go up in order. Small letters have their own codes (a is 97), and so do spaces and digits. A word is stored as a list of codes.
A computer can only store numbers. So how does your phone keep a text message?
Everything inside a computer is a number, even the words you type. So every letter needs a number of its own.
How this lesson works: Predict, Try, Investigate, Modify, Practise, Make
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.
What number is D?
TryTry it on the board and compare the result with your prediction.
Try: type a word
Was your guess right? Now type your own name.
Try it yourselfYour edits are saved in this browser.
Type CAB in the box. What numbers does the computer store?
Use the board. This ticks when you get there.
InvestigateWork out why it happens, one step at a time.
Worked example: a word as numbers
Worked exampleBefore each step, say what you think comes next.
C A TThe word, one letter at a time.
C→67A is 65, B is 66, so C is 67.
A→65A is where the capitals start.
T→84T is 19 letters after A: 65 + 19 = 84.
67,65,84That list of numbers is what the computer stores for CAT.
Now: is small a the same as A?
Sam works out how C is stored. Click the line where it first goes wrong.
ModifyChange the problem on purpose and see what happens.
Vary: other characters
Try it yourselfYour edits are saved in this browser.
Type HI THERE, with a space. What number is the space?
Use the board. This ticks when you get there.
Type hi in small letters.
Use the board. This ticks when you get there.
Type the number 7. What does the computer store?
Use the board. This ticks when you get there.
PractiseA few on your own, to check you have it.
Codes
A is 65. What number is E?
How many numbers does the computer store for the message GO HOME?
MakeMake your own problem using what you have learned. Expect a few tries; that is normal.
Spell a word
Then: write your name as codes, and swap with a friend. Can they read it?
Try it yourselfYour edits are saved in this browser.
Students type words and read the numbers a computer stores for them, find that capitals go up in order from A = 65, that small letters, spaces and digits have codes too, then spell a word by setting its codes (AC9TDI6K03 node 1). About 35 minutes.
I can find the number for a letter by counting on from A.
I can turn a list of numbers back into a word.
Before class
Do the Try board yourself: type your name, then a space and a digit.
The one idea: every character has a number (its code), and a word is a list of codes in order. The codes are ASCII, which Unicode keeps for the first 128 characters; nothing here needs those names.
Year 7–8 catch-up: if students can find D's code (68) and read 72, 73 back as HI, go straight to Everything is numbers and Text as numbers.
Unplugged: a class code chart on the board; students write a secret message in codes for a partner.
Running the lesson
Predict: students who chose 4 used the alphabet place; ask what A's number is.
Try: whose name makes the longest list? Why?
Worked example: before the T line, ask how far T is from A.
Vary: ask why a space needs a number at all.
Make: let students check by reading their numbers back as letters.
The hard part (on purpose)
Using the alphabet place (C = 3) instead of the code. Have them type C on the board and read it aloud.
When students get stuck
A student says C is stored as 3 (Sam's mistake). Ask: Type C on the board. What number comes up? Fix: The codes start at A = 65, so C is 67.
A student thinks small and capital letters share a number. Ask: Type a, then A. Are the numbers the same? Fix: Small letters start at 97.
Stretch and support
Stretch: Find the code for ? and for !. Are they near the letters or somewhere else?
Support: A strip: A 65, B 66, C 67 … up to Z 90; a 97, b 98 …; space 32.
Where it leads
Next: Text or number? (what the computer can do with each).
Year 7–8: Everything is numbers, then Text as numbers.
What each step is for
what number is D?: Committing to a code for D tests the new move: each letter has its own number, and capitals go up in order from A = 65.
Try: type a word: Typing a word and reading its numbers settles the prediction: one number for each letter, in order.
Worked example: a word as numbers: Turning CAT into codes and back models the move. Sam uses alphabet places instead of codes, the mistake planted after the method.
Vary: other characters: Each task types something new: a space, small letters, then a digit, which is a character with its own code too.
codes: Finding a code by counting on, reading codes back as a word, and counting how many numbers a message needs.
spell a word: Setting the numbers for a word reverses the move: students start from the letters and work out the codes.