Scintography Home
Previous ChapterTable of ContentsNext Chapter
Title Page

Appendix II: Hex Numbers


The Art of Scintography
Edition 3.0 © 2008 Aurora Isaac
www.scintography.com
    II.1   Hex Numbers
      We usually represent numbers in our daily life in base 10. No doubt this system originated from counting with our (ten) fingers. In base 10 there are 10 digits (0 1 2 3 4 5 6 7 8 9). To represent a number larger than 9, we use combinations of these ten digits. Thus, 125 represents the sum of 1 hundred, 2 tens, and 5 ones.
      If you are familiar with computers, you have probably encountered number representations of base 2 -- binary, base 8 -- octal, and base 16 -- hexadecimal, or hex for short. In base 2, only 2 digits are used (0 1), like counting with only two fingers. In base 8, 8 digits are used (0 1 2 3 4 5 6 7). In base 16 we need 16 digits. Since we have only ten numbers, we use letters to fill in the missing digits (0 1 2 3 4 5 6 7 8 9 A B C D E F). Counting to 10 in hex brings us to 16 in decimal:

Decimal: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ...
Hex: 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 ...

Just as the decimal number 12 is 1 ten plus 2 ones, the hex number 12 is 1 sixteen plus 2 ones, which is the decimal number eighteen. Some other hex numbers you may encounter are:

Decimal: 1 16 256 4,096 65,536
Hex: 1 10 100 1,000 10,000

Use the Integer Conversion form below to determine values of other hex or decimal numbers.

 

decimal
Decimal to Hex
Hex to Decimal
 

hexadecimal
 

      Although upper case letters are used in the examples of hex numbers above, lower case may also be used. In some programmig contexts, hexadecimal numbers are preceded by 0x (zero x), octal numbers are preceded by 0 (zero), and decimal numbers begin with a nonzero digit. Thus, 0xff is the hex representation of the decimal number 255.

All Contents © 2008 Aurora Isaac. All Rights Reserved. Legal Notices.
Previous ChapterTable of ContentsNext Chapter