The shape of the lesson
By the end of the lesson, learners can
- Text is numbers: Type some text into the lab and watch each character turn into its code and then into binary.
- ASCII and Unicode: Switch the lab between ASCII and Unicode and add a character from another language or an emoji.
- How much space does text take?: The storage needed is the number of characters multiplied by the bits per character.
- Character set: every character has a unique binary code.
- ASCII: 7 bits, 128 characters (extended 8 bits, 256): English only.
- Unicode: many more characters (languages, emojis) but more bits per character.
- Storage: number of characters × bits per character.
One picture every idea returns to
Text must be converted to binary before a computer can process it. A character set gives every character a unique binary code. ASCII uses 7 bits (128 characters), and extended ASCII 8 bits (256 characters): enough for English letters, digits and symbols. Unicode allows a far greater range of characters and symbols, including different languages and emojis, but it needs more bits per character (up to 32), so the same text takes more storage.
Forty-five minutes, phase by phase
| Time | Phase | What happens in the room | Grouping |
|---|---|---|---|
| 0 to 5 min | Hook: predict | Open with the question in the title, Letters as numbers.. When you press a key, the computer does not store a letter: it stores a number, written in binary. Put the figure on the board: it is the one picture every idea in the lesson returns to. | Whole class, then pairs |
| 5 to 13 min | Teach and check: Text is numbers | Type some text into the lab and watch each character turn into its code and then into binary. Project tab 1 of the lab (Text to binary) and let a student drive it while the class predicts. Model the worked example Codes in sequence on the board, one line at a time. Your turn: The ASCII code for c is 99. Give the denary and binary codes for g. | Whole class, then pairs |
| 13 to 21 min | Teach and check: ASCII and Unicode | Switch the lab between ASCII and Unicode and add a character from another language or an emoji. Project tab 1 of the lab (ASCII and Unicode) and let a student drive it while the class predicts. | Pairs |
| 21 to 30 min | Teach and check: How much space does text take? | The storage needed is the number of characters multiplied by the bits per character. Model the worked example Same message, two character sets on the board, one line at a time. | Jigsaw |
| 30 to 36 min | Check | The four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong. | Individual, then whole class |
| 36 to 43 min | Plenary | The exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording. | Individual, random call |
| 43 to 45 min | Exit and homework | Set the worksheet below (6 questions, 13 marks). Learners self-assess against the objectives before they leave. | Individual |
Protect the parts that carry the learning
The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.
Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.
Cut first if the build overruns: the last check in How much space does text take?, never the check or the plenary.
In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.
Jigsaw
Split the content into expert pieces. Expert groups master one piece each, then regroup so every home team has one expert per piece, and each expert teaches their piece to the team.
The full structure, with its variations and the other twelve, is on the cooperative-learning page.
What to head off, and how
| Trap learners fall into | Teaching move that pre-empts it |
|---|---|
| The digit character 7 is not stored as the number 7. | In ASCII it is code 55, so text digits cannot be used in a calculation until they are converted. |
| Saying Unicode is "better" earns nothing. | Say it has a greater range of characters (other languages, emojis) but uses more bits per character, so files are bigger. |
Representing text: ASCII and Unicode: worksheet
6 questions, 13 marks. Written in the style of the papers; no past paper question is reproduced.
Explain why a computer needs a character set to represent text.
The ASCII code for D is 68. Give the 8-bit binary codes for D and F.
Compare the ASCII and Unicode character sets.
A text file contains 2048 characters. Calculate its size in KiB if it is stored (a) in 8-bit ASCII and (b) in a 32-bit Unicode encoding.
A company is building a chat app for users in China, India and Greece who like to send emojis. State which character set it should use and justify your choice.
A student says "Unicode should always be used because it is newer than ASCII." Give one reason why ASCII may still be chosen for a file containing only English text.
Answer key and marking notes
- Text must be converted to binary to be processed by a computer.
- A character set gives each character a unique binary code, so all computers using it read the codes as the same characters.
- D: 68 = 01000100.
- F: 68 + 2 = 70 = 01000110.
- ASCII uses fewer bits per character (7, or 8 for extended ASCII); Unicode uses more bits per character.
- ASCII represents a small range of characters (128 or 256), mainly English; Unicode represents a much greater range, including other languages and emojis.
- So the same text takes more storage in Unicode than in ASCII.
- (a) 2048 × 8 bits = 2048 bytes; 2048 ÷ 1024 = 2 KiB.
- (b) 2048 × 32 bits = 8192 bytes; 8192 ÷ 1024 = 8 KiB.
- Unicode.
- ASCII cannot represent Chinese, Hindi or Greek characters or emojis; Unicode has codes for all of them.
- ASCII needs fewer bits per character.
- So the file would be smaller, using less storage and taking less time to transmit, and ASCII already covers all English characters.
6 multiple-choice questions on this lesson
From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.
What is a character set?
- AA list of characters a computer can represent, each with its own unique binary code
- BThe font and size used to display text on the screen
- CThe set of keys available on a particular keyboard
- DA method of compressing text so it uses fewer bits
The ASCII code for the letter a is 97. What is the 8-bit binary code for the letter f?
- A
01100110 - B
01100101 - C
01000110 - D
01100111
Why was Unicode developed when ASCII already existed?
- ATo represent a far greater range of characters, including other languages and emojis
- BTo store English text using fewer bits per character than ASCII
- CTo let computers process text faster than with ASCII
- DTo remove the need to convert text into binary
Standard ASCII uses 7 bits for each character. How many different characters can it represent?
- A128
- B7
- C127
- D256
A text file contains 1536 characters stored in a 16-bit Unicode encoding. What is its size in KiB?
- A3 KiB
- B1.5 KiB
- C24 KiB
- D6 KiB
A document is converted from 8-bit ASCII to a 32-bit Unicode encoding. The text itself does not change. What happens to the file size?
- AIt becomes 4 times larger
- BIt stays the same, because the characters are the same
- CIt becomes 32 times larger
- DIt increases by 24 bits in total
Quiz key
A character set such as ASCII or Unicode gives every character a unique binary code, so text can be converted to binary. A font only controls how characters look. Keyboards differ, but the character set is about the codes stored. A character set does not compress text.
f is 5 letters after a, so its code is 97 + 5 = 102 = 64 + 32 + 4 + 2 = 01100110. 01100101 is 101 (e), from counting one place short. 01000110 is 70, the code for capital F. 01100111 is 103 (g), from counting one place too far.
ASCII has room for only 128 (or 256) characters, mainly English. Unicode can represent over a million characters, covering many writing systems and emojis. It uses more bits per character, not fewer, and is not faster. All text, in any character set, must still be converted to binary.
27 = 128 different codes, from 0 to 127. 7 is just the number of bits. 127 is the largest code, but code 0 is also used, so there are 128. 256 is for 8 bits (extended ASCII).
16 bits = 2 bytes per character, so 1536 × 2 = 3072 bytes, and 3072 ÷ 1024 = 3 KiB. 1.5 KiB assumes 1 byte per character, as in 8-bit ASCII. 24 KiB forgets to divide the bits by 8. 6 KiB uses 4 bytes per character, which is 32-bit Unicode.
Each character goes from 8 bits to 32 bits, which is 4 times as many, so the whole file becomes 4 times larger. The characters are the same, but each takes more storage. 32 times confuses the new size with the factor. The extra 24 bits apply to every character, not once to the whole file.
What to project
The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.
Slides for this lesson
A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.