Off Base
Did You Know?
- HEXADECIMAL means "of, relating to, or being a number system with a base of 16"
- hex- is a latin prefix relating to six, and deci- relates to 10
- Our 'Normal' number system is DECIMAL (relating to ten) or Base 10, because each digit can have a ten possible values (0-9) and each place is a count of a power of ten:
Example:
537
= (5 * 102) + (3 * 101) + (7 * 100)
= (5 * (10 * 10)) + (3 * 10) + (7 * 1)
= (5 * 100) + (3 * 10) + (7 * 1)
= 500 + 30 + 7
= 537 - BINARY is also called Base 2--each digit has two possible values (0 or 1) and each place represents a count of power of two:
Example:
11010
= (1 * 24) + (1 * 23) + (0 * 22) + (1 * 21) + (0 * 20)
= (1 * (2 * 2 * 2 * 2)) + (1 * (2 * 2 * 2)) + (0 * (2 * 2)) + (1 * 2) + (0 * 1)
= (1 * 16) + (1 * 8) + (0 * 4) + (1 * 2) + (0 * 1)
= 16 + 8 + 0 + 2 + 0
= 26 - Hexadecimal is Base 16--each digit has sixteen possible values (0 through 15, with A through F representing the 'digits' 10 through 15) and each place represents a count of power of 16:
Example:
E3A8
= (E * 163) + (3 * 162) + (A * 161) + (8 * 160)
= (14 * (16 * 16 * 16)) + (3 * (16 * 16)) + (10 * 16) + (8 * 1)
= (14 * 4,096) + (3 * 256) + (10 * 16) + (8 * 1)
= 57,334 + 768 + 160 + 8
= 58,280 - Hexadecimal is favored for many computer applications because large numbers can be written in a small space and because every two digits represent a byte (each digit is a nybble!)
- There is another system sometimes used in compters: OCTAL. As you might guess from the name, this is Base 8--each digit has eigth possible values (0 through 7) and each place represents a count of power of 8:
Example:
4725
= (4 * 83) + (7 * 82) + (2 * 81) + (5 * 80)
= (4 * (8 * 8 * 8)) + (7 * (8 * 8)) + (2 * 8) + (5 * 1)
= (4 * 512) + (7 * 64) + (2 * 8) + (5 * 1)
= 2,048 + 448 + 16 + 5
= 2,517 - If you ever find a situation where octal is the best choice, I'd sure like to know what it is.
Handy-dandy conversion/comparison chart
| Base 10 Decimal | Base 2 Binary | Base 16 Hexadecimal | Base 8 Octal |
|---|---|---|---|
| 0 | 0000 0000 | 00 | 00 |
| 1 | 0000 0001 | 01 | 01 |
| 2 | 0000 0010 | 02 | 02 |
| 3 | 0000 0011 | 03 | 03 |
| 4 | 0000 0100 | 04 | 04 |
| 5 | 0000 0101 | 05 | 05 |
| 6 | 0000 0110 | 06 | 06 |
| 7 | 0000 0111 | 07 | 07 |
| 8 | 0000 1000 | 08 | 10 |
| 9 | 0000 1001 | 09 | 11 |
| 10 | 0000 1010 | 0A | 12 |
| 11 | 0000 1011 | 0B | 13 |
| 12 | 0000 1100 | 0C | 14 |
| 13 | 0000 1101 | 0D | 15 |
| 14 | 0000 1110 | 0E | 16 |
| 15 | 0000 1111 | 0F | 17 |
| 16 | 0001 0000 | 10 | 20 |
| 17 | 0001 0001 | 11 | 21 |
| 18 | 0001 0010 | 12 | 22 |
| 19 | 0001 0011 | 13 | 23 |
| 20 | 0001 0100 | 14 | 24 |
| 21 | 0001 0101 | 15 | 25 |
| 22 | 0001 0110 | 16 | 26 |
| 23 | 0001 0111 | 17 | 27 |
| 24 | 0001 1000 | 18 | 30 |
| 25 | 0001 1001 | 19 | 31 |
| 26 | 0001 1010 | 1A | 32 |
| 27 | 0001 1011 | 1B | 33 |
| 28 | 0001 1100 | 1C | 34 |
| 29 | 0001 1101 | 1D | 35 |
| 30 | 0001 1110 | 1E | 36 |
| 31 | 0001 1111 | 1F | 37 |
| 32 | 0010 0000 | 20 | 40 |


