How could a London station locker store the label Aa4 as numbers and read it back?
Your locker at a London station has the label capital A, lowercase a, four. The locker system stores that label as three numbers. What would let it tell the two letters apart and display the original label when you need it?
Think about what you see on the locker label. Capital A, lowercase a and the digit four are three different characters. A character set is a collection of characters. It can include letters, digits and punctuation.
Each row pairs a character with its ASCII code, written here in decimal. Read the first row from capital A to sixty-five to encode. Read it back from sixty-five to capital A to decode. Lowercase a has its own row and a different code.
The table gives capital A as 65 and lowercase a as 97. You’ve been given 97, so start with the number. Which character does it decode to? Pick one answer.
To encode capital A, lowercase a, four, look up each character. Capital A gives sixty-five, lowercase a gives ninety-seven, and four gives fifty-two. Keep that order. To decode the second sequence, look up sixty-six, then ninety-eight, then fifty-three. Together they give capital B, lowercase b, five.
Now you have a different sequence: 65, 98, 52. Read each code across to its character and keep the original order. Pick the label that matches all three rows, including the case of each letter.
Capital letters have consecutive ASCII codes. Start at A on 65. Jump once to B, again to C, and once more to D. You made three jumps, so the offset from A to D is three. Add three to 65 to get 68.
Counting works inside a group of consecutive codes. The digit eight is 56 and nine is 57. The next code, 58, is a colon. Capital A starts at 65. If your calculation crosses from one group to another, check the table before you assume which character comes next.
Each bit can be zero or one, so seven bits give you two to the power of seven possible patterns. That gives ASCII one hundred and twenty-eight codes, from zero to one hundred and twenty-seven. Unicode keeps those same numeric assignments and adds many more characters, including the pound sign.