**Converting from decimal to hex**

Going from hex to denary is relatively easy after you've done a few of them. You have to think a little bit harder going the other way, from denary to hex. But there is a great trick you can use - if you can use binary.

Binary and hex are actually very closely related, much more so than first appears. Each hex digit is just a group of four bits!! As long as we can do binary to denary conversion off the top of our heads, there is a method for converting denary to hex (and also back again) very quickly. See if you can follow this example. We are going to convert 125_{10} into a hex number.

**Step 1** - convert 125_{10 }into binary.

128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |

0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 |

0111 | 1101 |

0111 | 1101 |

This is 7 in denary | This is 13 in denary |

0111 | 1101 |

This is 7 in Hex | This is D in Hex |

125_{10 }is 7D_{16}

**Step 2** -split the binary number into two halves

You should always check the Hex answer you got. 7D_{16 }= (7x16) + (13 x 1) = 125_{10 }our answer is correct.

(Of course, you could always check your answer using a calculator! In Windows, Go to WINDOWS - ACCESSORIES - CALCULATOR - VIEW - SCIENTIFIC).

**Step 1** - convert 75_{10 }into binary.

128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |

0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 |

0111 | 1101 |

0100 | 1011 |

This is 4 in denary | This is 11 in denary |

**Step 4** - Now convert each of the two decimal numbers into the Hex numbering system.

0111 | 1101 |

This is 4 in denary | This is 11 in denary |

This is 4 in Hex | This is B in Hex |

75_{10 }is 4B_{16}

You should always check the hex answer you got. 4B16 = (4 x 16) + (11x 1) = 75_{10} so our answer is correct. This may seem a little long-winded to start with, but this method is very mechanical and always works. Once you've done a few, you'll be an expert. Besides, it's good practice for binary conversion!

Q1. Convert these numbers into their denary form: a) 36_{16} b) 3_{16 } c) FA_{16} d) 15_{16}

Q2. Convert these decimal numbers into hex: a) 103_{10} b) 14_{10} c) 58_{10} d) 7_{10}

Q3. Why are nibbles important when using hex?