# Converting Decimal fraction to Binary

Converting decimal numbers to binary is a fundamental concept in computer science and digital electronics. Binary numbers are base-2 numbers, consisting of only two digits: 0 and 1. In this article, we will explore the methods to convert both whole decimal numbers and decimal fractions to binary, with detailed explanations and examples.

## Converting Whole Decimal Numbers to Binary

To convert a whole decimal number to binary, we use the method of repeated division by 2. Here’s how it works:

1. Divide the decimal number by 2.
2. Record the remainder (0 or 1).
3. Update the decimal number to the quotient obtained from the division.
4. Repeat steps 1-3 until the quotient is 0.
5. The binary number is the sequence of remainders read from bottom to top.

### Example 1: Converting 13 to Binary

1. Divide 13 by 2:

• Quotient: 6
• Remainder: 1
2. Divide 6 by 2:

• Quotient: 3
• Remainder: 0
3. Divide 3 by 2:

• Quotient: 1
• Remainder: 1
4. Divide 1 by 2:

• Quotient: 0
• Remainder: 1

Reading the remainders from bottom to top, we get 1101.

So, $13_{10} = 1101_2$.

## Converting Decimal Fractions to Binary

To convert a decimal fraction to binary, we use the method of repeated multiplication by 2. Here’s how it works:

1. Multiply the decimal fraction by 2.
2. Record the integer part (0 or 1).
3. Update the decimal fraction to the fractional part obtained from the multiplication.
4. Repeat steps 1-3 until the fractional part is 0 or you reach the desired level of precision.
5. The binary fraction is the sequence of integer parts read in order.

### Example 2: Converting 0.625 to Binary

1. Multiply 0.625 by 2:

• Result: 1.25
• Integer part: 1
• Fractional part: 0.25
2. Multiply 0.25 by 2:

• Result: 0.5
• Integer part: 0
• Fractional part: 0.5
3. Multiply 0.5 by 2:

• Result: 1.0
• Integer part: 1
• Fractional part: 0

The binary fraction is the sequence of integer parts, which gives us 0.101.

So, $0.625_{10} = 0.101_2$.

### General Conversion Method for Mixed Numbers

For numbers with both whole and fractional parts, convert each part separately and then combine the results.

### Example 3: Converting 13.625 to Binary

1. Convert the whole number part (13) to binary:

• $13_{10} = 1101_2$
2. Convert the fractional part (0.625) to binary:

• $0.625_{10} = 0.101_2$

Combine the two parts to get the binary representation: $13.625_{10} = 1101.101_2$

## Conclusion

Converting decimal numbers to binary involves different methods for whole numbers and fractions. Whole numbers are converted using repeated division by 2, while fractions are converted using repeated multiplication by 2. Understanding these processes is crucial for working with digital systems and binary arithmetic. With practice, you can easily convert any decimal number to its binary equivalent.

Categories IT