Character Encoding: ASCII & Unicode
Understand how computers represent human text using binary numbers. Inspect 7-bit ASCII codes, master the Bit-5 case flip trick, calculate sequential letter offsets without memorising the chart, and see why Unicode was created to represent global writing systems and emojis.
Character Encoding: ASCII & Unicode
Explore 7-bit ASCII, 8-bit bytes, the Bit-5 case flip, sequential offsets, and global Unicode.
1. What is a Character Set?
Computers are electronic devices consisting of billions of transistors that can only store and process electrical states: binary 0s and 1s. Computers cannot naturally understand letters, punctuation, or spaces.
Definition (AQA 8525):
A character set is an agreed list of all the characters (letters, numbers, symbols, spaces, and control signals) that a computer system can recognise, along with the unique binary integer code assigned to each character.
7-Bit Standard ASCII
Created in 1963, ASCII (American Standard Code for Information Interchange) uses 7 bits per character.
- • Capacity: 2⁷ = 128 unique codes (0 to 127).
- • Codes 0–31 & 127: Non-printing control codes (Line Feed, Carriage Return, Tab).
- • Code 32: Space (␣).
- • Codes 33–126: Printable characters (A-Z, a-z, 0-9, punctuation).
Universal Unicode
Because 7-bit ASCII was limited to the English alphabet, Unicode was created to support every written language on Earth:
- • Capacity: 1,114,112 code points (U+0000 to U+10FFFF).
- • Covers Arabic, Greek, Cyrillic, Kanji, Devanagari, emojis, and math symbols.
- • 100% Backward Compatible: The first 128 codes (0–127) are identical to 7-bit ASCII!
2. Sequential Ordering & Calculating Codes
You do not need to memorise the full ASCII chart for the exam. The AQA specification explicitly requires students to know that character codes run in consecutive sequence.
Running continuously across 26 letters. ‘B’ is 66, ‘C’ is 67, etc.
Running continuously across 26 letters. ‘b’ is 98, ‘c’ is 99, etc.
Running continuously across 10 digits. ‘1’ is 49, ‘2’ is 50, etc.
“In the 7-bit ASCII chart, the character code for ‘A’ is 65 (1000001). Calculate the 7-bit binary code for the character ‘D’. [2 marks]”
Step 1: Calculate alphabet offset: ‘D’ is the 4th letter. Since ‘A’ is the 1st letter, offset = 4 - 1 = +3.
Step 2: Add to base denary code: 65 + 3 = 68. (Award 1 mark).
Step 3: Convert 68 to 7-bit binary: 64 + 4 = 1000100. (Award 1 mark).
3. The Bit-5 Case Switch (+32 / -32)
Notice the mathematical difference between uppercase and lowercase letters:
‘a’ (97) - ‘A’ (65) = 32
‘b’ (98) - ‘B’ (66) = 32
Because 32 is exactly 2⁵ (Bit 5 in binary), lowercase letters have the exact same bit pattern as uppercase letters, except that Bit 5 is set to 1:
| Letter | Denary | Bit 7 (128) | Bit 6 (64) | Bit 5 (32) [CASE] | Bit 4 (16) | Bit 3 (8) | Bit 2 (4) | Bit 1 (2) | Bit 0 (1) |
|---|---|---|---|---|---|---|---|---|---|
| ‘A’ (upper) | 65 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |
| ‘a’ (lower) | 97 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 |
4. Text File Size Calculations
Calculating the storage requirement of text is an essential skill across both Paper 1 and Paper 2:
File Size (bits) = Number of Characters × Bits per Character
To convert bits to bytes, divide by 8. Remember: spaces, digits, and punctuation marks count as full individual characters!
“A text message reads: “Pass AQA 2026!”. Calculate the file size in bits using 7-bit ASCII, and in bytes using 8-bit ASCII.”
- 1. Count characters: ‘P’‘a’‘s’‘s’ (4) + space (1) + ‘A’‘Q’‘A’ (3) + space (1) + ‘2’‘0’‘2’‘6’ (4) + ‘!’ (1) = 14 characters.
- 2. 7-bit ASCII size = 14 × 7 = 98 bits.
- 3. 8-bit ASCII size = 14 × 8 = 112 bits = 14 bytes (since each char is 1 byte).
5. Five Mistakes That Cost Marks in AQA Exams
Mistake 1: Confusing Character ‘0’-‘9’ with Integer Values
When asked for the character code for ‘5’, many students write binary 00000101 (denary 5). This is wrong! In ASCII, the character glyph ‘0’ starts at code 48. So character ‘5’ is 48 + 5 = 53 (00110101).
Mistake 2: The Off-By-One Offset Slip
If ‘A’ is 65, finding the 4th letter ‘D’ requires adding 3 (offset = position - 1 = 4 - 1 = 3), giving 68. Students who add 4 arrive at 69 (‘E’) and lose the mark.
Mistake 3: Forgetting Spaces in Storage Counts
In text file size calculations, students frequently only count letters. Spaces (ASCII 32) and punctuation marks each require a full character code and must be included in the total character count.
Mistake 4: Claiming Unicode “Compresses” or “Speeds Up” Data
Unicode does not compress data or make text faster to send. Its advantage is that it can represent far more characters: other alphabets and languages, plus special and mathematical symbols.
Mistake 5: Saying ASCII is an 8-Bit Code
Standard ASCII is strictly a 7-bit code with 128 characters. While it is commonly stored inside an 8-bit byte (with a leading zero), the ASCII specification itself is 7 bits.
Complete Your GCSE Data Representation Revision
Now that you’ve mastered Character Encoding, practice Binary Addition, Sound Wave Sampling, and Bitmap Images.
