OCR Computer Science J277 - Mr Brown
Computers can only store binary. A character set is "a defined list of characters recognised by the computer hardware and software" โ each character in the list is mapped to a unique binary code. Try encoding and decoding text below!
This encoder uses standard 8-bit ASCII
Type up to 14 characters โ try letters, digits, symbols, or even paste an emoji!
Drag the slider to see how many characters you could represent with different numbers of bits โ this is the relationship between bits per character and the size of a character set.
8 bits โ 28 = 256 characters
Computers only store binary โ they can't store letters or symbols directly. The exam board defines a character set as:
"A defined list of characters recognised by the computer hardware and software."
Every character (like 'A', '7' or '๐') is mapped to a unique binary code โ without an agreed character set, one computer's 01000001 could mean something different on another.
With n bits you can make 2โฟ different binary patterns โ one per character. More bits means more possible characters, but more storage space too.
| Bits | 2โฟ | Characters possible |
|---|---|---|
| 4 | 2โด | 16 |
| 7 | 2โท | 128 |
| 8 | 2โธ | 256 |
| 16 | 2ยนโถ | 65,536 |
Try the slider in the Playground tab!
ASCII was one of the earliest character sets. Standard ASCII uses 7 bits (2โท = 128 characters) โ enough for English letters, digits and punctuation. The exam always shows ASCII codes using 8 bits (e.g. 'A' = 01000001).
Logical ordering: codes increase predictably, so you only need one anchor point per group, not the whole table:
Know the anchor, count the offset โ that's exactly what the Challenges tab tests!
ASCII's 128 characters aren't enough for every language, symbol and emoji used worldwide. Unicode uses more bits per character โ 8 to 32 bits, depending on the encoding โ to cover a huge range of characters. Its first 128 codes match ASCII exactly, so ASCII text is also valid Unicode text.
| ASCII | Unicode | |
|---|---|---|
| Bits per character | 7 (8 in the exam) | 8-32 (varies) |
| Characters representable | 128 | Over 1 million |
| Covers other languages / emoji? | No | Yes |
| File size for the same text | Smaller | Usually larger |
More bits per character means Unicode text can need more storage space than the same text in ASCII โ the trade-off for supporting far more characters.