Appendix C: Hexadecimal NumbersConversion Chart
What is "hexadecimal"?The number system we use is based on units of 10. Single digit numbers go from 1 to 9, then 10 = 1 unit of 10 plus 0 single units. The hexadecimal number system works in exactly the same way, except that it is based on units of 16. That means that 10(base 16) = 1 unit of 16 plus 0 single units. That also means that we need some additional figures, since single digit numbers in hexadecimal run from 1 to 15. Rather than inventing new figures, the first 6 letters are used. So in hexadecimal, we have: 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10 Converting from decimal to hexadecimalTo convert from decimal to hexadecimal, all you have to do is divide by 16. However, you need to go back in time to when you were at school, and hadn't yet learned about fractions or decimals. So, for example, if you divide 24 by 16, you get "1 remainder 8". So 24 (which is 2 lots of 10 plus 4 single units) = 18(base 16) (ie 1 lot of 16 plus 8 single units). Let's look at a colour. The navy blue colour we used has a red value of 0. That's still 0 in hexadecimal, so the first two digits of the RGB value are "00". The green value is also 0, so now we have "0000". The blue value is 128. Divide that by 16. We get "8 remainder 0". So now we have "000080". Another example: The yellow colour we used for the text has a red and a green value of 255. Divide that by 16. We get "15 remainder 15". When writing hexadecimal numbers, remenber that 11=A, 12=B, 13=C, 14=D and 15=F. So "15 remainder 15" = FF. Since the blue value is 0, the full hexadecimal RGB value for this particular shade of yellow is "FFFF00". Converting from hexadecimal to decimalIf for some reason you need to convert a hexadecimal number into regular decimal format, simply reverse the process described above. So, for example, if you need to know what the decimal equivalent of 18(base 16) is, all you need to do is remember that the right hand digit is single units, and the next digit to the left is the number of "16s". So 18(base 16) is "1 lot of 16 plus 8 single units". That gives you 16 plus 8, which is 24. If you come across a 3 digit hexadecimal number, the left hand digit is the number of "16x16"s, or "256s". |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
http://www.users.zetnet.co.uk/dms/htmlguide/app-c.html
© 1998-2001 Donna Smillie <dms@zetnet.co.uk>