Number Systems – Hexadecimal

Click to see the rest of the Data Representation section :

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

hexadecimal - computer science online tutor

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!

Not to worry! What we do have are letters:

0=0
1=1
2=2
3=3
4=4
5=5
6=6
7=7
8=8
9=9
10=A
11=B
12=C
13=D
14=E
15=F

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:

  1. Convert the denary number into an 8 bit binary number

  2. Split the binary number in half (into two nibbles)

  3. Convert each of the nibbles into a denary number

  4. IF either numbers are >=10 convert into a letter

  5. Combine the hexadecimal digits to make the number

Find this page helpful? Share the love on your social media mentioning @TeachAllAboutIT and we’ll enter you in our monthly draw to win a gift voucher for any product on the site!

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on pinterest
Share on reddit

More

Lesson Plan

Coming Soon!

Students

Student revision links are visible for logged in subscribers.

Not a student member yet? Sign Up Here from £2.50 per month

Or purchase these resources individually from our resources

Sign Up For Membership Today

Computer Science Student

Individual Site License
Topic Introduction Pages
Additional Revision Resources
Revision Videos
Exam Question Walkthroughs
Discounted Group Lessons
£2.50 per Month. After your initial payment, your first payment is Free.

Whole School

Whole School Site License (teacher access)
Up to 50 student accounts (£3 per student, per annum for additional students)
Online Topic Lesson Plans
Differentiated Homework Tasks
Monthly Bundle of Downloadable Resources
Discounted Live Lessons
£12.50 per Month.

iGCSE Maths - Core (2019)

£18.00 per Month.
Number of courses 100
iGCSE Computer Science (0984) – Distance Learning
GET IT NOW GET IT NOW GET IT NOW