## Learning Objectives

• Explain the benefits of working with hexadecimal codes instead of binary codes
• Assess different methods of converting hexadecimal to binary and denary.

## Getting Started: Introduction to Hexadecimal

Hexadecimal (or hex) is a base 16 system used to simplify how binary is represented.

A hex digit can be any of the following 16 digits: 0 1 2 3 4 5 6 7 8 9 A B C D E F.

Each hex digit reflects a 4-bit binary sequence.

This table shows each hex digit with the equivalent values in binary and denary.

Hexadecimal codes are much shorter to write for programmers because each hex value is equivalent (the same as) 4 bits of binary.

A good example is when programmers use hex codes to display the right colour.

• As you can see below, the hex value for the colour blue is 0036D9
• If the programmer used a binary code instead, they would have to write out the following code: 000000000011011011011001

Therefore, the advantages of using hexadecimal are

• It is easy to convert from hexadecimal/binary
• It is faster and easier to read and write.
• Due to hex codes being much smaller, you are also less likely to make errors and it is easier to debug.

## Challenge 1: Convert Hexadecimal to Binary

Warm up

Watch this video and then answer the questions below

Convert the follow hexadecimal values into binary

1. D
2. 1
3. F
4. C
5. 7
Main Challenge

Watch the next video and have a go at the challenges

Convert the following hexadecimal values into binary

1. 1F
2. 7C
3. 4F
4. 17
5. EE
Super Challenge

Watch the following video and have a go at the questions

Convert the following hexadecimal values into binary

1. ABC
2. 123
3. FFA
4. E5C4
5. 49AF4

## Challenge 2: Convert Binary to Hexadecimal

Warm up

Watch the following video and answer the questions

Convert the following binary values to hexadecimal

1. 1010
2. 0011
3. 1111
4. 0000
5. 1100
Main Challenge

Watch the following video and answer the questions

Convert the following binary values to hexadecimal

1. 10101001
2. 10110111
3. 01101010
4. 11111111
5. 01110010
Super Challenge

Watch the video and have a go at the questions

Convert the following binary values to hexadecimal

1. 000111
2. 11111
3. 101011110001
4. 10
5. 0000011110001

## Challenge 3: Convert Hexadecimal to Denary

Warm up

Read this information on BBC Bitesize and have a go at the questions below:

1. A
2. C
3. D
4. 2
5. 7
Main Challenge

Watch the video and have a go at the questions

Convert the following hexadecimal values to denary

1. 1F
2. C2
3. 51
4. 73
5. AA
Super Challenge

No video this time, just use your knowledge of this topic to convert these larger hexadecimal values into denary. You may need to use a calculator!

• 123
• ABC
• FFA
• 1111
• 1AA4

## Challenge 4: Denary to Hexadecimal

Warm up

Read this information on BBC Bitesize and have a go at the questions below:

• 11
• 4
• 15
• 12
• 8
Main Challenge

Watch the video below and have a go at the questions

Convert the following denary values to hexadecimal

1. 42
2. 77
3. 102
4. 171
5. 249
Super Challenge

No video this time, just use your knowledge of this topic to convert these larger denary values into hexadecimal. You may need to use a calculator!

1. 256
2. 300
3. 1000
4. 4096
5. 58820