Assume we have a n-digits hexadecimal number:
dn-1 ... d3 d2 d1 d0
Convert each digit of the hexadecimal to the corresponding decimal number using this table for reference:
Hexadecimal | Decimal |
---|---|
0 | 0 |
1 | 1 |
2 | 2 |
3 | 3 |
4 | 4 |
5 | 5 |
6 | 6 |
7 | 7 |
8 | 8 |
9 | 9 |
A | 10 |
B | 11 |
C | 12 |
D | 13 |
E | 14 |
F | 15 |
Multiply each digit of the hexadecimal number with its corresponding 16n, where n is the position of the digit.
decimal number = d0×160 + d1×161 + d2×162 + ...
Multiply each digit of the fractional digit with its corresponding 16-n, where n is the position of the digit.
0.d0 d1 d2 ... dn-1
fractional part = d0×16-1 + d1×16-2 + ... + dn-1×16n
Example:
6D.3C16 = (6 × 161) + (13 × 160) + (3 × 8-1) + (12 × 16-2) = 109.23437510
Below is the reference table for converting binary number to decimal, octal, hexadecimal, ranging from 010 to 1510:
Binary | Decimal | Octal | Hexadecimal |
---|---|---|---|
0000 | 0 | 0 | 0 |
0001 | 1 | 1 | 1 |
0010 | 2 | 2 | 2 |
0011 | 3 | 3 | 3 |
0100 | 4 | 4 | 4 |
0101 | 5 | 5 | 5 |
0110 | 6 | 6 | 6 |
0111 | 7 | 7 | 7 |
1000 | 8 | 10 | 8 |
1001 | 9 | 11 | 9 |
1010 | 10 | 12 | A |
1011 | 11 | 13 | B |
1100 | 12 | 14 | C |
1101 | 13 | 15 | D |
1110 | 14 | 16 | E |
1111 | 15 | 17 | F |