Teachers' Portal  /  IGCSE Computer Science 0478  /  Data representation  /  Hexadecimal and where it is used
Lesson pack · IGCSE Computer Science 0478 · 1.1 · IGCSE

Hexadecimal and where it is used

Binary, shorter. Long strings of 0s and 1s are hard for people to read and easy to copy wrongly.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Data representation
Syllabus reference
Cambridge IGCSE Computer Science 0478, 1.1
Level
IGCSE
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 2 of 10 in Data representation; follows Why computers use binary: binary and denary; leads into Binary addition and overflow
Central model
Fig. 1: each group of four bits becomes one hexadecimal digit
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • Sixteen digits: In the lab, flip the bits and watch each group of four turn into a single hex digit.
  • Converting with nibbles: Binary and hex convert directly, four bits at a time.
  • Where hex is used: The lab's colour code mode builds an HTML colour from three bytes, and its last mode lists other places hex appears.
Key points to leave on the board
  • Digits: 0 to 9, then A = 10 up to F = 15.
  • Binary to hex: split into groups of 4 from the right; convert each group.
  • Hex to denary: multiply each digit by 16 or 1 (or 256, 4096 for longer numbers) and add.
  • Why hex: shorter, easier for humans to read and write, fewer errors; the computer still uses binary.
The core visual model

One picture every idea returns to

Hexadecimal is base 16. It uses the digits 0 to 9 and the letters A to F for 10 to 15. One hex digit stands for exactly 4 bits (a nibble), so binary converts to hex by splitting it into groups of 4 from the right. Hex is used because it is shorter and easier for humans to read and write than binary, with fewer mistakes, yet converts to binary simply. The computer itself still stores binary.

one hex digit = one nibble (4 bits) 1 0 1 1 0 1 1 0 8 + 2 + 1 = 114 + 2 = 6 B6 1011 0110 = B6
Fig. 1: each group of four bits becomes one hexadecimal digit
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen with the question in the title, Binary, shorter.. Long strings of 0s and 1s are hard for people to read and easy to copy wrongly. Put the figure on the board: it is the one picture every idea in the lesson returns to.Whole class, then pairs
5 to 13 minTeach and check: Sixteen digitsIn the lab, flip the bits and watch each group of four turn into a single hex digit. Project tab 2 of the lab (Binary and hexadecimal) and let a student drive it while the class predicts.Whole class, then pairs
13 to 21 minTeach and check: Converting with nibblesBinary and hex convert directly, four bits at a time. Model the worked example Binary to hex on the board, one line at a time. Your turn: Convert the hex number 3E to binary and to denary.Pairs
21 to 30 minTeach and check: Where hex is usedThe lab's colour code mode builds an HTML colour from three bytes, and its last mode lists other places hex appears. Project tab 2 of the lab (Hexadecimal colour codes) and let a student drive it while the class predicts.Rally Coach
30 to 36 minCheckThe four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong.Individual, then whole class
36 to 43 minPlenaryThe exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording.Individual, random call
43 to 45 minExit and homeworkSet the worksheet below (6 questions, 14 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

Protect the parts that carry the learning

The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.

Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.

Cut first if the build overruns: the last check in Where hex is used, never the check or the plenary.

In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.

Running the cooperative task

Rally Coach

Pairs share one worksheet. One partner solves the first question aloud while the other coaches, checking each line and offering a prompt rather than the answer; they swap roles for the next question.

The full structure, with its variations and the other twelve, is on the cooperative-learning page.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching move that pre-empts it
Do not write 12 as the hex digit for twelve.Each place holds a single character, so twelve is C; 12 in hex means 1 × 16 + 2 = 18.
Say that hex is easier for humans.Computers do not store or process hex: they convert it to binary.
Worksheet

Hexadecimal and where it is used: worksheet

6 questions, 14 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · convert[2 marks]

Convert the binary number 1010 1111 0011 to hexadecimal.

Q2 · convert[2 marks]

Convert the hexadecimal number 7B to denary. Show your working.

Q3 · convert[2 marks]

Convert the denary number 172 to hexadecimal.

Q4 · explain[2 marks]

Give two reasons why hexadecimal is used by programmers instead of binary.

Q5 · apply[3 marks]

A web page uses the colour code #33CC99. Give the denary value of the red, green and blue components.

Q6 · recall[3 marks]

Identify three uses of hexadecimal in computer science.

Answer key and marking notes
Q1 · 2 marks
  • 1010 = A, 1111 = F, 0011 = 3.
  • AF3.
Q2 · 2 marks
  • 7 × 16 = 112; B = 11.
  • 112 + 11 = 123.
Q3 · 2 marks
  • 172 = 1010 1100 in binary (128 + 32 + 8 + 4).
  • 1010 = A, 1100 = C, so AC.
Q4 · 2 marks
  • It is shorter, so it is quicker to read and write.
  • It is easier to understand and fewer errors are made when copying it, and it converts easily to binary (4 bits per digit).
Q5 · 3 marks
  • Red 33 = 3 × 16 + 3 = 51.
  • Green CC = 12 × 16 + 12 = 204.
  • Blue 99 = 9 × 16 + 9 = 153.
Q6 · 3 marks
  • HTML / web colour codes.
  • MAC addresses.
  • Error codes, memory dumps or IPv6 addresses (any one).
Quiz

6 multiple-choice questions on this lesson

From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.

Q11 mark

Why is hexadecimal often used instead of binary when values are shown to people?

  • AIt is shorter and easier for humans to read and write, with fewer mistakes
  • BThe processor can process hexadecimal faster than binary
  • CA value written in hexadecimal takes up less storage space in memory
  • DHexadecimal can represent larger numbers than binary can
Q21 mark

Convert the 12-bit binary number 1011 1110 0101 to hexadecimal.

  • ABE5
  • BBD5
  • C5EB
  • DB145
Q31 mark

Convert the hexadecimal number 3A to denary.

  • A58
  • B48
  • C310
  • D63
Q41 mark

A web page uses the HTML colour code #1E90FF, written as red, green, blue. What is the denary value of the green component?

  • A144
  • B90
  • C30
  • D255
Q51 mark

Convert the denary number 237 to hexadecimal.

  • AED
  • BDE
  • CEC
  • DFD
Q61 mark

Which of these hexadecimal numbers has the largest value?

  • AB0
  • BAF
  • CA9
  • D9F
Quiz key
Q1: A

One hex digit replaces four bits, so long binary values become short and are easier for people to read, remember and copy correctly. The computer still stores and processes the value in binary, so hex is not faster and does not save memory. Any number that hex can show can also be shown in binary, just with more digits.

Q2: A

1011 = 11 = B, 1110 = 14 = E and 0101 = 5, so the answer is BE5. BD5 misreads 1110 as 13 (D). 5EB writes the groups in reverse order. B145 writes 14 as two denary digits instead of the single hex digit E.

Q3: A

3 × 16 = 48, and A = 10, so 48 + 10 = 58. 48 forgets to add the A. 310 just writes 3 next to 10 as if the places were denary. 63 reads A as 15 (that would be F).

Q4: A

The pairs are 1E (red), 90 (green) and FF (blue). 90 in hex is 9 × 16 + 0 = 144. 90 copies the hex digits as if they were denary. 30 is the red value (1E). 255 is the blue value (FF).

Q5: A

237 ÷ 16 = 14 remainder 13. 14 = E and 13 = D, so 237 = ED (check: 14 × 16 + 13 = 237). DE swaps the digits (222). EC is 236, one too small. FD is 253, from using 15 sixteens.

Q6: A

B0 = 11 × 16 = 176. AF = 175, A9 = 169 and 9F = 159. The left digit is worth 16 times as much as the right one, so B in the sixteens place beats any number starting with A or 9, however large its right digit is.

Lab and demo

What to project

The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.

Slides

Slides for this lesson

A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.
Previous lessonWhy computers use binary: binary and denary