← Starting out

Letters are numbers

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
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?

A computer stores capital A as 65, B as 66 and C as 67. What number does it store for 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.
  1. C A T\text{C A T}The word, one letter at a time.

Now: is small a the same as A?

Small a and capital A: are they stored as the same number?

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?

Your friend's phone receives 72, 73. What does it show?

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.
Need a hint?

Before a hint: what kind of stuck is this? Try a strategy first

Count on from A = 65.

Another hint

D is the 4th letter, so it's 3 more than 65.

Another hint

O is 14 after A, and G is 6 after A.

Change the three numbers so the word says DOG.

Use the board. This ticks when you get there.

Now you can
Next lesson2. Text or number?The same keys can make text or a number, and the computer does different things with each. Numbers can be added: 12 and 3 make 15. Text can only be joined: 12 and 3 make 123. So programs store things you'll do maths with as numbers, and things like names and phone numbers as text.
For teachers

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.

Open the teacher guide: answers, solutions, slides and a worksheet.

Students will be able to

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

  1. Predict: students who chose 4 used the alphabet place; ask what A's number is.
  2. Try: whose name makes the longest list? Why?
  3. Worked example: before the T line, ask how far T is from A.
  4. Vary: ask why a space needs a number at all.
  5. 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

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