Information Technology Reference
In-Depth Information
Converting Decimal to Hexadecimal
First things first, memorize Table 2-1. For larger numbers, there are two methods. The first
method is to convert decimal to binary and then from binary to hex. The second method is to
divide the decimal number by 16; the residual is the right-most bit. Then keep dividing until the
number is not divisible. 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 residual is the first digit. If the result is not divisible
by 16, you are done; the result and the residual are the hex number. If the division result is still
divisible by 16, follow the procedure again. This becomes clearer with the following examples.
Conversion Example 1: Convert 26 to Its Hex Equivalent
Divide by 16:
1
16
26
-16
10 = A h
Answer: 1A h
Conversion Example 2: Convert 96 to Its Hex Equivalent
Not divisible by 256; divide by 16:
6
16
96
-96
0 = 0 h
Answer: 60 h
Search WWH ::




Custom Search