Decimal to Hexadecimal Conversion



Decimal to Hexadecimal Conversion

If a mixed decimal number is given that has integer and fraction parts. Then, to convert the given decimal number to its equivalent hexadecimal, we convert integer and fraction parts separately.

To convert the integer part, we successively divide the decimal integer by 16 till the quotient is 0. The integer part of the equivalent hexadecimal is obtained by reading the remainders from bottom to top.

To convert the fractional part, we multiply the decimal fractional number by 16 till the product is 0 or till the desired accuracy is obtained. The fractional part of the equivalent hexadecimal is obtained by reading the carries from top to bottom.

Let us see some examples to understand the decimal to hexadecimal conversion.

Example

Convert (524.26)10 to hexadecimal.

Solution

The given decimal number is a mixed number. Hence, we have to convert its integer and fractional parts separately.

Converting Integer Part (524)10 to Hexadecimal −

Decimal Remainders
16 524
16 32 12 (C)
16 2 0
0 2

Reading the remainder from bottom to top to obtained the hexadecimal equivalent, the result is (20C)16.

Converting Fractional Part (0.26)10 to Hexadecimal −

Decimal Product Carry
0.26 × 16 4.16 4
0.16 × 16 2.56 2
0.56 × 16 8.96 8
0.96 × 16 15.36 15 (F)

Reading the carries from top to bottom to obtain the equivalent hexadecimal number, the result is (0.428F)16.

Thus, the hexadecimal equivalent of the decimal number (524.26)10 is (20C.428F)16.

Advertisements