Hexadecimal
Learning Objectives:
Suggested time: 50 mins
Curriculum Mapping:
- Convert positive denary integers (0‐255) into 2‐digit hexadecimal numbers and vice versa
- Convert between binary and hexadecimal equivalents of the same number
- Explain the use of hexadecimal numbers to represent binary numbers
Suggested time: 50 mins
Curriculum Mapping:
KS3:
- Understand how data of various types (including text, sounds and pictures) can be represented and manipulated digitally, in the form of binary digits
COMPUTER SCIENCE EDUCATORS:
1a: Demonstrate knowledge of and proficiency in data representation and abstraction
- Effectively use primitive data types
- Demonstrate an understanding of static and dynamic data structures
- Effectively use, manipulate and explain various external data stores: various types (text, images, sound, etc.), various locations (local, server, cloud), etc.
- Effectively use modeling and simulation to solve real-world problems
CSTA K–12 CS Standards:
- 2-DA-07: Represent data using multiple encoding schemes.
- 3A-DA-09: Translate between different bit representations of real-world phenomena, such as characters, numbers, and images.
Lesson 1: Theory (Hexadecimal)
Starter:
Start by showing two numbers on the board (one in binary and one in hex).
1101 1001
C9
Ask the students, “Which is easiest to remember?”
Explain to students that we often find it difficult to remember long sequences of numbers so, to make life easier, we can break the number down from 4 bits (a nibble) to 1-bit.
Demonstration (Hexadecimal):
Explain that the smallest value we can have in 4-bits (nibble) is 0000 (0 in denary) and the largest value is 1111 (15 in denary) and that we needed to represent each value with a single digit. Display the following table on the whiteboard and ask students to fill in boxes 0-9:
Starter:
Start by showing two numbers on the board (one in binary and one in hex).
1101 1001
C9
Ask the students, “Which is easiest to remember?”
Explain to students that we often find it difficult to remember long sequences of numbers so, to make life easier, we can break the number down from 4 bits (a nibble) to 1-bit.
Demonstration (Hexadecimal):
Explain that the smallest value we can have in 4-bits (nibble) is 0000 (0 in denary) and the largest value is 1111 (15 in denary) and that we needed to represent each value with a single digit. Display the following table on the whiteboard and ask students to fill in boxes 0-9:
Denary |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Explain that when we reach 10, we hit a problem as we can only use the numerical values 0 – 9.
Ask the students to suggest ways we could represent the last 6 numbers without using numbers.
Explain that, to get around this problem, we substitute the numbers 10 to 15 with the letters A to F. Explain that we call this system Hexadecimal (or Hex for short). Follow this by showing the students the following table:
Ask the students to suggest ways we could represent the last 6 numbers without using numbers.
Explain that, to get around this problem, we substitute the numbers 10 to 15 with the letters A to F. Explain that we call this system Hexadecimal (or Hex for short). Follow this by showing the students the following table:
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 |
Show students, using the following table, what happens when we get to the number 16:
Denary |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
Hex |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
1A |
1B |
1C |
1D |
1E |
1F |
Explain that when we get to 16, a 1 is added to the front of the next number (highlighting the similarity to the denary system when we go from 9 to 10).
Split the class into groups of three and give each group a copy of the following table. Ask them to fill in the blanks:
Split the class into groups of three and give each group a copy of the following table. Ask them to fill in the blanks:
Denary |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
Hex |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

starter.pdf |
Finish by displaying the following table on the board and explain how it could help them in their exam:
Hex |
Denary (Decimal) |
0F |
15 |
10 |
16 (1x16) |
20 |
32 (2x16) |
30 |
48 (3x16) |
40 |
64 (4x16) |
50 |
80 (5x16) |
60 |
96 (6x16) |
70 |
112 (7x16) |
80 |
128 (8x16) |
90 |
144 (9x16) |
A0 |
160 (10x16) |
Activity 1 (Denary <--> Hex):
Explain that, for the exam, students are expected to be able to convert binary to hexadecimal.
Show the students the following video:
Next, show them an example exam question and challenge them solve it:
(a) Convert the hexadecimal number 6A to denary. (You must show your working out).
.................................................................................................................................
.................................................................................................................................
............................................................................................................................ (2)
Follow this by giving students a series of mini challenges (See answer sheet at bottom of this page):
(a) Convert the hexadecimal number 6A to denary. (You must show your working out).
.................................................................................................................................
.................................................................................................................................
............................................................................................................................ (2)
Follow this by giving students a series of mini challenges (See answer sheet at bottom of this page):

activity_1.pdf |
Activity 2 (Binary <--> Hex):
Finally I explain that, also for the exam, students are expected to be able to convert binary to hexadecimal.
Explain that, in the exam, students are expected to be able to convert 8-bit binary numbers to hex. Demonstrate how to do this using the following example:
Support this activity with the following help sheet:

bin2hex.pdf |
Show the students another example exam question and challenge them solve it:
(a) Convert the binary number 00111101 to hexadecimal.
.................................................................................................................................
.................................................................................................................................
............................................................................................................................ (2)
Plenary:
Finish by putting this all into context. Display the following table on the board and ask students if they recognise it. Ask if they can spot anything familiar (based on the lesson).
(a) Convert the binary number 00111101 to hexadecimal.
.................................................................................................................................
.................................................................................................................................
............................................................................................................................ (2)
Plenary:
Finish by putting this all into context. Display the following table on the board and ask students if they recognise it. Ask if they can spot anything familiar (based on the lesson).
Explain that #FFFFFF = 1111 1111 1111 1111 1111 1111 in Binary which is 16,777,215 in Denary which also happens to be the same number of colours in a web palette! Ask students to think what it would be like to have to use binary to change the colour of a webpage in HTML!
Answer Sheets:
Starter:
Answer Sheets:
Starter:
Denary |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
Hex |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
3A |
3B |
3C |
3D |
3E |
3F |
Activity 1:

activity_1_answers.pdf |
Useful Links:
Useful Links:
How to do Decimal to Hexadecimal Conversion
How to do Binary to Hexadecimal Conversion
Tags: GCSE, KS4, Theory, Computing Theory, CS Theory, Hexadecimal, Binary to Hex, Binary, Binary Representation, binary 2, binary conversion, how to do binary conversion, counting binary, binary number to decimal, binary 101, 8 binary, binary digits, binary digit, meaning of binary