INMC 80 News

  

June/July/August 1980 · Issue 1

Page 21 of 48

our Binary number 11101101110 becomes a nice managable 76EH. As there are only six letters to learn to replace the Decimal numbers 10 – 15, a little practice will soon dispense with the intermediate Decimal stage, and you can do Binary to HEX conversions direct. (To tell the truth I still have difficulty doing it backwards, and end up jotting down a Binary table from 10 – 16.)

Decimal to HEX is easiest achieved using a conversions table written in powers of 16, expressed in ‘base 10’. The table looks like this:

Hexadecimal Columns
4 3 2 1
00 00 0 0
14,096 1256 116 11
28,192 2512 232 22
312,2883768 348 33
416,38441,024464 44
520,48051,280580 55
624,57661,536696 66
728,67271,792711277
832,76882,048812888
935,86492,304914499
A40,960A2,560A160A10
B45,056B2,816B176B11
C49,152C3,072C192C12
D53,248D3,328D208D13
E57,344E3,584E224E14
F61,440F3,840F240F15

Right, now what to do with it ? Think of a number, an easy one, say, 49. Look in column 4, is there a number less than 49 ? Yes that number is 0, so the first digit is 0. Try in column 3, O again. Try column 2, Ah hah, 48 its less than 49, so the HEX digit is 3. Now subtract 48 from 49 and look in column 1 for the HEX equivalent to the answer. Yes, you got it, 1 !!! So the HEX equivalent of 49 is 0031. We don’t write the Decimal number 0049, so it follows that the HEX number is 31. Also as we can’t assume it’s to ‘base 10’ (because it isn’t), we’d better tell the customers that its HEX, so:

Decimal 49 = 31H

Now that is a lot easier than writing 49 in Binary (which would be 110001), and even vaguely understandable to the uninitiate. Now try 19,514, and see If you understand how | got 4C3AH out of that. Go on try a few numbers of your own.

The whole object of this exercise has been to point out that different numbering systems exist and that HEX numbers are just as real and meaningful as counting from 1 to 10 (in Decimal of course). How computers make the conversion from HEX to Binary for internal use will be revealed in the next chapter. Meantime, try getting to grips with HEX, and relating it Decimal and Binary counting systems.


Page 21 of 48