To convert any base 10 number to hex (base 16) you may convert it to
base 8 first, then represent the base 8 number with its binary
representation. By taking the binary representation of the number and
grouping the bits from right to left in groups of four which are then
represented in hex per the above table. Or one may convert any base 10 number
to hex by our continuous division rule as before. Lets convert 82510 to hex.
16
16
16
51 | R=9 |
|
825 |
| |
3 | R=3 | 33916 |
51 | ||
0 | R=3 |
|
3 |
|
therefore 82510 = 33916
to convert 33916 back to our base 10 number,
339 = 9x160 | + 3x161 + 3x162 | |||
16 |
|
|
|
|
= 9x1 | + | 3x16 | + | 3x256 |
= 9 | + | 48 | + | 768 |
= 82510 |
|
|
|
|
To show the relationship between hex, binary, and octal, lets convert 82510 to octal & to binary and then back to hex.