Computers can only store binary data. To store text (characters, digits, symbols), each character must be assigned a unique binary number. A character set is a defined list of characters and their corresponding binary codes.
ASCII (American Standard Code for Information Interchange) is a 7-bit character set, representing 128 characters (2⁷ = 128). An extended version uses 8 bits for 256 characters.
| Character | Denary code | Binary (7-bit) |
|---|---|---|
| A | 65 | 1000001 |
| a | 97 | 1100001 |
| 0 | 48 | 0110000 |
Key patterns: Uppercase letters and their lowercase equivalents differ by 32 (bit 5 changes). Digit characters and their numeric values differ by 48.
Unicode is a larger character set designed to represent characters from all the world's writing systems. It includes ASCII as its first 128 characters.
| Feature | ASCII | Unicode |
|---|---|---|
| Bits per character | 7 (or 8 extended) | 8–32 bits (varies) |
| Number of characters | 128 (or 256) | Over 1 million |
| Languages supported | English only | All writing systems |
| File size | Smaller | Can be larger |
| Compatibility | Widely compatible | UTF-8 backwards-compatible with ASCII |
File size = number of characters × bits per character
Example: A 500-character text file using ASCII (7 bits): 500 × 7 = 3500 bits = 437.5 bytes ≈ 438 bytes
5 questions · 8 marks
| Term | Definition |
|---|
10 minutes · exam conditions