Hexadecimal is a way of writing numbers. It is base-16, which means there are 16 different characters per digit. The sequence of characters goes like this:
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
A |
B |
C |
D |
E |
F |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
Hexadecimal is usefull because you can write larger numbers with less digits. For example the largest number you can make with two digits in decimal is 99. In hex you can make FF, which is equal to 255 (over twice as large).
Hexadecimal can be converted to decimal with this formula:
(for each digit going from right to left): value in decimal = value_of_digit * ( 16 ^ ( number_of_digits - this_digits_position ));
For example, if we want to convert A7F to decimal we would do this:
1st Digit: 10 * ( 16 ^ 3 - 1) = 10 * 256 = 2560;
2nd Digit: 7 * ( 16 ^ 3 - 2 ) = 7 * 16 = 112;
3rd Digit: 15 * ( 16 ^ 3 - 3 ) = 15 * 1 = 15;
2560 + 112 + 15 = 2687;
site
site