Menu

Character Sets

Ordered Character Sets and Working Out Codes

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.

Counting positions

Suppose a question gives you t = 116 and asks for the code for w. Count forward from t:

CharacterCode
t116
u117
v118
w119

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.

Different characters, different codes

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.

Writing the code in binary

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.

Counting from t = 116 through u, v to w adds one each step, so w is 116 + 3 = 119. The code 119 is then shown as the 8-bit binary 01110111 with its place values.

Practise this