Hexadecimal System (Base-16)
1. The Hexadecimal Concept
Hexadecimal is a Base-16 system. Because we only have 10 digits (0-9) in our standard alphabet, we use letters to represent values from 10 to 15.
| Denary | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Hex | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
2. Converting Binary to Hexadecimal
This is the most common task in IGCSE exams. It works because $16$ is a power of $2$ ($2^4 = 16$). One Hex digit represents exactly 4 bits (a nibble).
Method: The 4-Bit Grouping
- Take a binary string (e.g., 10110110).
- Split it into two 4-bit nibbles: 1011 and 0110.
- Convert each nibble to Denary:
- 1011 = $8 + 2 + 1 = 11$
- 0110 = $4 + 2 = 6$
- Convert those values to Hex:
- $11$ becomes B
- $6$ remains 6
3. Converting Hexadecimal to Denary
Just like Binary and Denary, Hex uses place values. However, the multipliers are powers of 16.
Example: Convert 2A to Denary
Write the place values: 16s and 1s.
- $(2 \times 16) + (A \times 1)$
- Since $A = 10$, the calculation is: $(2 \times 16) + (10 \times 1)$
- $32 + 10 = 42$
4. Practical Applications in CS
You may be asked where Hex is used in the real world. Memorize these three:
- MAC Addresses: Media Access Control addresses (e.g.,
00:1A:2B:3C:4D:5E). - HTML/CSS Color Codes: Using RGB values (e.g.,
#FF5733). - Memory Dumps / Debugging: Displaying the contents of RAM to help programmers find errors.
- Assembly Language: To represent machine code instructions in a readable way.
5. Common Pitfall: Storage Myth
⚠️ Exam Warning:
Hexadecimal does not save storage space. Computers never store data as Hex; they convert everything back to Binary (1s and 0s) for processing. Hex is strictly for human readability.