## Teach Any Computer Science Class

We have put together a full GCSE Computer Science curriculum that will give you all the teaching materials you need to teach any topic.

Whether you're a brand new Computer Science teacher, or you've been teaching ICT for years, our resources will save you hours and hours of lesson preparation every single week.

View the Lessons →### Hexadecimal Numbering System

Hexadecimal is a base 16 numbering system made up of 16 digits: 0 – 9 and six more, which are A through F.

### Uses of Hexadecimal

The hexadecimal numbering system is often used by programmers to simplify the binary numbering system. Since 16 is equivalent to 24, there is a linear relationship between the numbers 2 and 16. This means that one hexadecimal digit is equivalent to four binary digits. Computers use the binary numbering system while humans use the hexadecimal numbering system to shorten binary and make it easier to understand.

### Decimal Numbering System

Decimal is a base 10 numbering system which is made up of 10 numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. It is the most commonly used numbering system. The reason behind this is convenience. We have 10 fingers that we use for counting, so it is easier to count with a base 10 numbering system, thus decimal is widely used.

### Conversion from Hexadecimal to Decimal

Conversion can be done by multiplying the hexadecimal number by 16. Each digit is multiplied by the corresponding power of 16 value. It is easier to convert by putting the hexadecimal in the power of 16 columns as follows:

Exponent | 162 | 161 | 160 |

Value | 256 | 16 | 1 |

Hexadecimal | 1 | 6 | 5 |

Multiply each value by the hexadecimal digit as follows:

(1 x 256) = 256

(6 x 16) = 96

(5 x 1) = 5

Total value = (256 + 96 + 5) = 357

Therefore, the hexadecimal number 165 is 357 in decimal number.

16516 = 35710

Another example with an alphabet hexadecimal digit.

Conversion can be done by multiplying the hexadecimal number by 16. Each digit is multiplied by the corresponding power of 16 value. It is easier to convert by putting the hexadecimal in the power of 16 columns as follows:

Exponent | 162 | 161 | 160 |

Value | 256 | 16 | 1 |

Hexadecimal | B | 2 | 8 |

Multiply each value by the hexadecimal digit as follows:

(B x 256) = (11 x 256) = 2,816

(2 x 16) = 32

(8 x 1) = 8

Total value = (2,816 + 32 + 8) = 2,856

Therefore, the hexadecimal number B28 is 2,856 in the decimal number system.

B2816 = 2,85610

### Conversion from Decimal to Hexadecimal

Conversion can be done by dividing the decimal number by 16 repeatedly until the final result is 0.

For example, the decimal number 357 is converted to a hexadecimal number as follows:

Division | Result | Remainder |

357 / 16 | 22 | 5 |

22 / 16 | 1 | 6 |

1 / 16 | 0 | 1 |

The hexadecimal number is taken from the remainder starting from the last to the first, or in the table above, from bottom to top, which is 165.

Note: For remainder between 0 to 9, the hexadecimal equivalent is the same, see the table below.

Hexadecimal | Decimal |

0 | 0 |

1 | 1 |

2 | 2 |

3 | 3 |

4 | 4 |

5 | 5 |

6 | 6 |

7 | 7 |

8 | 8 |

9 | 9 |

So the decimal number 357 is 165 in the hexadecimal number system.

35710 = 16516

Another example, with a remainder greater than 9, in order to have an alphabet result.

The decimal number 2856 is converted to a hexadecimal number as follows:

Division | Result | Remainder |

2856 / 16 | 178 | 8 |

178 / 16 | 11 | 2 |

11 / 16 | 0 | 11 |

The hexadecimal number is taken from the remainder starting from the last to the first, or in the table above, from bottom to top, which is 1128. Looking at the table below, 11 is B in hexadecimal.

Hexadecimal | Decimal |

A | 10 |

B | 11 |

C | 12 |

D | 13 |

E | 14 |

F | 15 |

So the decimal number 2856 is B28 in the hexadecimal number system.

285610 = B2816

Conversion may seem difficult at first, but with a little practice and by understanding the principles behind the conversion, it gets easier over time. Of course, there are online conversion tools and calculators, but it is handy to know how it is done manually and to understand the concept behind the different numbering systems.