Character Sets
A character set is logically ordered: letters and digits are arranged in sequence, so their codes follow a consistent order. Once you know one character's code, you can work out another nearby in the same sequence by counting its position in the set.
Suppose a question gives you t = 116 and asks for the code for w. Count forward from t:
| Character | Code |
|---|---|
| t | 116 |
| u | 117 |
| v | 118 |
| w | 119 |
w is three places after t, so add 3: 116 + 3 = 119. Counting in the ordered set is safer than guessing, and you must not skip or double-count a position. Digit characters are consecutive too, so if a question gives you one digit's code you can count to another.
Upper-case and lower-case versions of a letter are separate characters, so they have different codes โ a capital and its small form are not the same entry. In the same way, when a digit is held as text the computer stores a character code for it, not the number it looks like. Imagine a locker code typed in as 2417: the computer stores character codes for '2', '4', '1' and '7', so a program cannot add them to get 14 until it converts each character to its numeric value.
You do not need to memorise any codes: questions give the codes they rely on.
If the answer must be binary, convert the denary code and write it with 8 bits. ASCII codes are shown using 8 bits. For w, 119 in binary is 01110111. Keep leading zeros so the code is exactly eight bits.
OCR GCSE Computer Science ยท Character Sets