Decimal to Binary Conversion



Decimal to Binary Conversion

A decimal number can be converted to their equivalent binary number by using the double-dabble method. In this method, the integer part of the given decimal number is successively divided by 2 and the fractional part is successively multiplied by 2.

In the integer part, the remainders read from bottom to top give the integer part of the binary equivalent. In the fractional part, the carries read from top to bottom give the fractional part of the binary equivalent.

The following steps are followed to convert a decimal number to the binary equivalent −

Step 1 − Divide the integer part of the given decimal number successively by 2 and read the remainders from bottom to top.

Step 2 − Multiply the fractional part of the given decimal number successively by 2 and read the carries from top to bottom.

Let us see some examples to understand the conversion of a decimal number into its equivalent binary number.

Example 1

Convert (28)10 to binary equivalent.

Solution

The given decimal number is an integer. Thus, we divide the decimal number successively by 2 and read the remainders upwards to obtain the equivalent binary number.

Decimal Remainders
2 28
2 14 0
2 7 0
2 3 1
2 1 1
0 1

Reading the remainders from bottom to top, the result will be (11100)2. It is the binary equivalent of (28)10.

Example 2

Convert (165.75)10 to its equivalent binary.

Solution

The given decimal number is a mixed number having both integer and fractional parts. Thus, to obtain its equivalent binary number, we convert the integer and fractional parts separately.

The binary equivalent of 16510 is obtained as follows,

Decimal Remainders
2 165
2 82 1
2 41 0
2 20 1
2 10 0
2 5 0
2 2 1
2 1 0
0 1

Reading the remainders from bottom to top, the binary equivalent of 16510 is (10100101)2.

Now, let's convert the Fractional Part (0.75) of the given number.

To convert the given decimal fraction into binary, we multiply it by 2, as follows,

Decimal Product Carry
0.75 × 2 1.5 1
0.5 × 2 1.0 1
0 × 2 0

Reading the carries from top to bottom, the result is 0.11. Thus, the binary equivalent of (0.75)10 is (0.11)2.

Therefore, (165.75)10 = (10100101.11)2

Advertisements