Character Sets
ASCII codes are numbers that stand for characters. The ASCII table puts letters and digits in blocks, so once you know one code you can work out others in the same block by counting.
Uppercase and lowercase versions of a letter have different ASCII codes. For example, B has code 66 and b has code 98. The uppercase letters form one unbroken block, and the lowercase letters form another block later in the table. Within each case, letters are in alphabetical order and their codes are consecutive: W is 87, X is 88 and Y is 89. Do not count from an uppercase letter to a lowercase letter as if they were next to each other.
The digit characters 0 to 9 are also consecutive. For example, 4 is 52, so 5 is 53 and 6 is 54. Because each block sits in order, you can find a code by counting forward or backward from a code you know. If q is 113, count forward three places: r is 114, s is 115 and t is 116. Count backward two places from q and o is 111.
Inside the computer an ASCII code is stored as a binary pattern. It is often written as a denary number because that is easier to read, and it can also be written in hexadecimal. These are three ways of writing the same code:
| Character | Denary | Binary | Hexadecimal |
|---|---|---|---|
B | 66 | 1000010 | 42 |
b | 98 | 1100010 | 62 |
5 | 53 | 0110101 | 35 |
Edexcel GCSE Computer Science · Character Sets