Cover lesson · Computer Science · Year 9 · Intermediate
LNF: Numeracy → Understanding the number system helps us to represent and compare relationships between numbers and quantities → Relationships within the number system
Name: Class: Date:
What this practises: numeracy in Computer Science. Pupils use place value and powers of 2 and 16 to convert between denary (normal numbers), binary and hexadecimal, then use binary shifts to double and halve numbers. This builds towards GCSE Computer Science Unit 1, Section 1.2.1, which asks learners to “convert between denary, binary and hexadecimal counting systems”.
Print: this sheet, one per pupil, and the stimulus sheet “Theatr y Glannau: matching the stage lights to the website”, one between two. No calculators: the point is to do the conversions by hand. No computers are needed.
Run: 7 min read sections 1 to 4 and do Step 1 · 12 min Step 2, hex to denary and binary · 10 min Step 3, denary to hex · 8 min Step 4, binary to hex · 10 min Step 5, shifts · 5 min Step 6, why hex? · 3 min success criteria. Total 55 minutes.
Collect: this sheet. The worked example has every answer. Checkpoints: #1E5A3C is red 30, green 90, blue 60; Sunset is #C82D63.
Rhys needs the stage lights at Theatr y Glannau to match the website. The website speaks hexadecimal and the lighting desk speaks denary. You are the translator. Show your working for every conversion and check each answer by converting it back.
| Question | Answer |
|---|---|
| Write the 8 binary column values, from left to right. | |
| What are 160, 161 and 162? | |
| What denary value do the hex digits A, C and F stand for? | |
| What is the largest denary number 8 bits can hold? Write it in hex too. |
Use the hex to denary and hex to binary methods in section 4. Harbour orange is done for you in section 5.
| Colour | Pair | Working (hex to denary) | Denary | Binary (8 bits) |
|---|---|---|---|---|
| Sea-grass green #1E5A3C | 1E | |||
| 5A | ||||
| 3C | ||||
| Sand gold #F2C14E | F2 | |||
| C1 | ||||
| 4E | ||||
| Lifeboat red #D7263D | D7 | |||
| 26 | ||||
| 3D |
(b) Which of the three colours has the most red in it? How can you tell from the hex code alone, without converting?
Use the denary to hex method in section 4 and the scenes in section 6.
| Scene | Denary | Working (÷ 16, remainder) | Hex |
|---|---|---|---|
| Sunset | 200 | ||
| 45 | |||
| 99 | |||
| Moonlight | 128 | ||
| 128 | |||
| 255 |
(b) Write the full colour codes: Sunset #____________ Moonlight #____________
(c) Check one answer: convert your hex for 200 back to denary.
Rhys’s old desk shows some values in binary. Change each to hex, then to denary.
| Binary | Two nibbles and hex | Denary |
|---|---|---|
| 10110110 | ||
| 01111100 |
Use section 7. All values are stored in 8 bits.
(a) A dim blue is stored as 22. Write 22 in 8-bit binary.
(b) Shift it left 1 place, then shift the original left 2 places. Write both answers in binary and denary. What does each shift do to the number?
(c) Rhys shifts 150 left 1 place to double it. Write 150 in binary, do the shift in 8 bits, and give the denary answer. Why is it not 300?
(a) Each pair can be 256 values. How many different colours can a 6-digit colour code show? (Hint: 256 × 256 × 256.)
(b) Give two reasons why web designers write colours in hex rather than binary.