You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Hexadecimal (base-16, often shortened to "hex") is the third number system you need to know for OCR J277 Section 2.6. Hexadecimal is widely used in computing because it provides a compact, human-readable representation of binary data.
Binary numbers are long and hard for humans to read. Hexadecimal solves this problem:
| Binary (8 bits) | Denary | Hexadecimal |
|---|---|---|
| 11111111 | 255 | FF |
| 10101010 | 170 | AA |
| 00000000 | 0 | 00 |
Hex is shorter and easier to read than binary, while still mapping directly to binary (each hex digit = exactly 4 bits). This is why hex is used for:
| Use | Example |
|---|---|
| Colour codes | #FF5733 (red, green, blue values) |
| MAC addresses | 4A:2B:7C:DE:01:FF |
| Memory addresses | 0x7FFF0000 |
| Error codes | 0x80070005 |
| HTML/CSS colours | color: #00FF00 (green) |
Hex uses 16 digits. Since we only have 10 numeral symbols (0-9), the letters A-F represent values 10-15:
| Hex digit | Denary value | Binary (4 bits) |
|---|---|---|
| 0 | 0 | 0000 |
| 1 | 1 | 0001 |
| 2 | 2 | 0010 |
| 3 | 3 | 0011 |
| 4 | 4 | 0100 |
| 5 | 5 | 0101 |
| 6 | 6 | 0110 |
| 7 | 7 | 0111 |
| 8 | 8 | 1000 |
| 9 | 9 | 1001 |
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
OCR Exam Tip: You should memorise this table. In the exam, you can quickly write the hex-to-binary lookup in the margin to help with conversions.
Example: Convert 10110111 to hex
Split: 1011 | 0111
Answer: B7
Example: Convert 11111010 to hex
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.