Information Technology Reference
In-Depth Information
method is to divide the decimal number by 16—the residual is the rightmost hexadecimal
digit—and then keep dividing until the number is not divisible anymore. For the first
method, use the schemes described in later sections. For the second method, follow the
examples described here.
First, divide the decimal number by 16. The remainder of the division is the least-signifi-
cant (first) hexadecimal digit. Continue to divide the quotients (answer) of the divisions
by 16 until the quotient is 0. The remainder value of each later division is converted to a
hexadecimal digit and prepended to the previous value. The final remainder is the most-
significant digit of the hexadecimal equivalent. For large numbers, you might have to di-
vide many times. The following examples make the process clearer.
Divide by 16:
1
16
26
-16
10 = A h
Answer: 1A h
Conversion Example C-1
Convert 26 to Its Hex Equivalent
Not divisible by 256; divide by 16:
6
16
96
-96
0 = 0 h
Answer: 60 h
Conversion Example C-2
Convert 96 to Its Hex Equivalent
Divide by 16 first:
23
16
375
-32
55
-48
7
Now divide 23 by 16:
1
16
23
-16
7
Now take the residual from the first division (7) and concatentate it
with the residual from the second division (7), plus the result of the
second division (1), and the answer is 177 h .
Conversion Example C-3
Convert 375 to Its Hex Equivalent
Search WWH ::




Custom Search