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 12510 into a hex number.

Step 1 - convert 12510 into binary.

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

Step 2 -split the binary number into two halves (nibbles)

 0111 1101

Step 3 - treat each half as a 4 bit binary number and convert it back to decimal

 0111 1101 This is 7 in denary This is 13 in denary

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

 0111 1101 This is 7 in Hex This is D in Hex

Step 5 - recombine the answer and then proudly display it!

12510 is 7D16

You should always check the Hex answer you got. 7D16 = (7x16) + (13 x 1) = 12510 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 7510 into binary.

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

Step 2 -split the binary number into two halves

 0111 1101

Step 3 - treat each half as a 4 bit binary number and convert it back to decimal

 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

Step 5 - recombine the answer and then proudly display it!

7510 is 4B16

You should always check the hex answer you got. 4B16 = (4 x 16) + (11x 1) = 7510 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) 3616      b) 316     c) FA16     d) 1516

Q2. Convert these decimal numbers into hex: a) 10310      b) 1410      c) 5810     d) 710

Q3. Why are nibbles important when using hex?