Cambridge IGCSE · Topic 1.2
IGCSE Computer Science 0478 / Topic 1 / IGCSE

Letters as numbers.

When you press a key, the computer does not store a letter: it stores a number, written in binary. A character set is the agreed list that says which number stands for which character, so every computer reads the same text in the same way.

The key idea

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.

each character has a code in the character set characterASCII codebinary (8 bits) Hi! 7210533 010010000110100100100001
Fig. 1: the text Hi! stored as three ASCII codes
Section 01

Text is numbers.

Type some text into the lab and watch each character turn into its code and then into binary.

Worked example Codes in sequence
The ASCII code for A is 65. Give the 8-bit binary code for E.
  1. E is 4 letters after A, so its code is 65 + 4 = 69.
  2. 69 = 64 + 4 + 1.
Answer: 01000101
Your turn
The ASCII code for c is 99. Give the denary and binary codes for g.
Examiner trap

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.

Section 02

ASCII and Unicode.

Switch the lab between ASCII and Unicode and add a character from another language or an emoji. Watch the number of bits per character.

ASCIIUnicode
Bits per character7 (8 for extended ASCII)more: up to 32
Number of characters128 (256 extended)over a million possible
CoversEnglish letters, digits, punctuation, control codesalmost every language, maths symbols and emojis
Storage for the same textlessmore
Examiner trap

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.

Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

Why must text be converted to binary?

Quick check+10 XP

What is an advantage of Unicode over ASCII?

Quick check+10 XP

The ASCII code for a is 97. What is the code for d?

Quick check+10 XP

In the lab, what happens to the storage needed when you switch the same text from ASCII to Unicode?

Section 03

How much space does text take?

The storage needed is the number of characters multiplied by the bits per character. Spaces and punctuation are characters too.

Worked example Same message, two character sets
A message has 20 characters. How many bytes does it take in 8-bit ASCII and in a 32-bit Unicode encoding?
  1. 8-bit ASCII: 20 × 8 = 160 bits = 160 ÷ 8 = 20 bytes.
  2. 32-bit Unicode: 20 × 32 = 640 bits = 640 ÷ 8 = 80 bytes.
Answer: 20 bytes in ASCII; 80 bytes in Unicode
Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

How many different characters can 7-bit ASCII represent?

Exam style+20 XP

The ASCII code for K is 75. What is the ASCII code for M in binary?

Exam style+20 XP

The word Hello is stored in 8-bit ASCII. How many bits are needed?

Exam style+20 XP

A messaging app must display emojis. Which statement is correct?

Skill unlocked

Representing text, mastered.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Character sets, ASCII codes in binary, comparing ASCII with Unicode, and the storage text needs.