OCR GCSE (J277)

An interactive lesson and quiz on Number Base Conversions.

Part 1: Why Use Hexadecimal?

Computers only understand Binary (0s and 1s). As humans, we use Denary (0-9). Hexadecimal (0-9, A-F) is a "middle-ground" that is easy for both humans and computers.

Binary (For Computers)

Binary numbers get very long, very quickly. This is hard for humans to read and copy without making mistakes.


10001111100101111011
                        

Hexadecimal (For Humans)

Hexadecimal is much shorter ("less susceptible to error") and easier for programmers to read and write.


8F97B
                        

🚨 Key Misconception

A common mistake is to think hex "takes up less storage space". This is incorrect. All data is *always* stored in binary. Hex is just a simpler way for *humans* to represent that binary.

Part 1: Quiz (Page 1 of 8)

1. What is the MAIN reason computer scientists use hexadecimal instead of binary?
2. Azmi says, "hexadecimal is used because it takes up less storage space in the computer's memory than binary." Is Azmi correct?

Part 2: Hexadecimal ↔ Denary

This is the trickiest conversion. It involves place values, but with powers of 16.

Hex to Denary (e.g., A3)

You multiply the first digit by 16 and add the second digit. (Remember: A=10, B=11, C=12, D=13, E=14, F=15)


Place Value:   [16s] [1s]
Hex Number:      A     3

Step 1: 'A' is 10. (10 * 16) = 160
Step 2: '3' is 3.   (3 * 1)   =   3
Step 3: Add them: 160 + 3 = 163
                        

Denary to Hex (e.g., 62)

You use division and remainders (DIV and MOD). Divide the number by 16.


Step 1: 62 DIV 16 = 3
        (How many 16s fit in 62? 3)

Step 2: 62 MOD 16 = 14
        (What is the remainder? 14)

Step 3: Convert to Hex:
        Digit 1: 3  -> '3'
        Digit 2: 14 -> 'E'

Answer: 3E
                        

Part 2: Quiz (Page 2 of 8)

Part 3: Binary ↔ Hex (The Easy Way!)

This is the easiest conversion! A 2-digit hex number is *exactly* 8 bits (one byte). The trick is to split the 8-bit binary into two 4-bit "nibbles".

Example: Convert Binary `1100 0111` to Hex

1. Split the byte into two 4-bit nibbles:

1100 0111

2. Convert each nibble to its denary/hex equivalent:

  • 1100 (8 + 4 + 0 + 0) = 12. In hex, 12 is 'C'.
  • 0111 (0 + 4 + 2 + 1) = 7. In hex, 7 is '7'.

3. Combine them: C7. That's it!

Example: Convert Hex `B0` to Binary

1. Split the hex digits:

B 0

2. Convert each digit to a 4-bit nibble:

  • B is 11. In 4-bit binary: (8 + 2 + 1) = 1011.
  • 0 is 0. In 4-bit binary: 0000.

3. Combine them: 1011 0000. Done!

Part 3: Quiz (Page 3 of 8)

6. Convert the binary value 1110 0011 into hexadecimal.
Answer =
7. Convert the hexadecimal number 4E into 8-bit binary.
Answer =
8. Drag the 4-bit nibbles to match their hexadecimal equivalents.
1010 1111 1001 0110
A:
F:
6:
9:

Part 4: Putting It All Together

You now have all the skills. You can convert between all three number bases. The questions in the exam paper often ask you to fill in a table with all three values.

Example Conversion Table

Denary 8-bit Binary 2-digit Hex
38 00100110 26
78 01001110 4E
156 10011100 9C

Part 4: Quiz (Page 4 of 8)

9. Complete the conversion table by filling in the blanks.
Denary 8-bit Binary Hex
00000111 7
49 31
01100110 66
244 11110100

Part 5: Quiz (Page 5 of 8) - Long Binary

10. A long binary number begins: 10001111100101111011...
When converted, the first two hex digits are 8F. Find the next three.
Binary: 1000  1111  1001  0111  1011
Hex:      8     F         
                    

This confirms the 4-bit nibble method works for binary of any length.

Part 6: Final Challenge (Page 6 of 8)

Time to test your understanding of the *methods* themselves.

11. Fill in the blanks to describe how to convert a 2-digit hex number into denary.
First, you the value of the first digit by . Then, you the value of the second digit.
12. Fill in the blanks to describe the algorithm for converting a denary number (`num`) into 2-digit hex.
The first hex digit is num 16.
The second hex digit is num 16.

Lesson Complete!

Well done, Student!

This is your 1st attempt.

Your final score:
0 / 0

Your Personal Feedback: