We’ve already looked at the basics of binary and denary in the previous lesson, but this not the only number system that we need to be aware of.

If Denary is Base 10 (10 digits) and Binary is Base 2 (2 digits), then our third number system, Hexadecimal is in Base 16 (16 digits) as Hex = 6 and Dec = 10. But we don’t have 16 digits!

Now, where have we seen the use of numbers and letters between A-F before?

Most likely you have seen them used in colour codes on the internet. Consider the terrible programmer Christmas Joke: “May all your Christmases be #FFFFFF” – not only is this awful, but the #FFFFFF is the code for white, but translated is actually 3 8bit binary numbers, so 24 digits long!

How do we know this?

F = 15

15 in Binary = 1111

4 bits x 6 = 24

It’s not just numbers up to 15 that we can represent using hexadecimal and part of the GCSE syllabus is showing that you understand the relationship between Denary, Binary, and Hexadecimal. The gif image at the top of the page shows the steps used to convert – try your own version using the following algorithm:

Convert the denary number into an 8 bit binary number

Split the binary number in half (into two nibbles)

Convert each of the nibbles into a denary number

IF either numbers are >=10 convert into a letter

Combine the hexadecimal digits to make the number

Activity

Uses of Hexadecimal

Hexadecimal has a number of uses, but one of the most commonly known is in identifying colours that can be used on the web. These are made of three colour hues made up of Red, Green, and Blue.

By combining a byte of data for each hue (or two hexadecimal digits), different colour combinations can be created. Try this for yourself by adjusting the sliders below:

#7f7f7f

127

7f

127

7f

127

7f

Activity – Scribbl.it Notes

The Hexadecimal Scribbl.it Notes provide a structured way for students to revise topic areas covered in class in a visual way. Encourage students to colour in areas of importance, add doodles and colour, then add more detail to the notes page being as creative as possible.