## 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 →### Decimal Numbering System

Decimal is a base 10 numbering system 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 that 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.

### Hexadecimal Numbering System

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

### Conversion from Decimal to Hexadecimal

Conversion can be done by dividing a 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 illustration above, from bottom to top, which is 165.

Note: For the 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 is 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 from Hexadecimal to Decimal

Conversion can be done by multiplying a hexadecimal number by 16. Each digit will be multiplied by the corresponding power of 16 value. It is easier to convert by putting the hexadecimal number 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

So, the hexadecimal number 165 is 357 in decimal numbers.

16516 = 35710

Another example, with an alphabet hexadecimal digit.

Conversion can be done by multiplying the hexadecimal number by 16. Each digit will be 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

So, the hexadecimal number B28 is 2,856 in decimal numbers.

B2816 = 2,85610

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