How to convert decimal to binary with decimals?

What should I do with the decimal part when converting from a decimal number to a binary number?

The integer part is divided by 2, and the fractional part is multiplied by 2 to take the integer part until the fractional part is 0.

For example

0.25 is converted to binary

0.25*2=0.5 The integer part is 0

0.5*2=1.0 The integer part is 1 and the fractional part is 0

So the result of the conversion of binary results in 0.01.

How to convert numbers with decimals decimal to binary ah?

The decimal decimal number N is converted to a binary number by repeatedly multiplying N by 2, resulting in an integer that is arranged in a smooth sequence.

Example 1-5 converts the decimal decimal number 0.5625 to a binary number.

Solution:

0.5625 x 2 = 1.125 The integer part is 1 and the decimal part is 0.125

0.125 x 2 = 0.25 The integer part is 0 and the decimal part is 0.25

0.25 x 2 = 0.5 The integer part is 0 and the decimal part is 0.5

0.5 x 2 = 1.0 integer part is 1, decimal part is 0

Thus, the binary representation of 0.5625 is 0.1001

And so on until the decimal part is 0 or until the requirement of precision is met (sometimes the decimal part will never be 0), from which it can be seen that repeated multiplication by two yields the integer part and arranges it in the order obtained as a1a2a3 …, is the binary representation of N.

How to convert decimal decimal into binary

The use of “multiply by 2 to take the integer, sequential” method can be converted to binary decimal, now in decimal 0.125 as an example of the demonstration, the specific operation please refer to the following steps.

1, the method is mainly a decimal part multiplied by 2, take the integer part of the sequence from left to right after the decimal point, until the decimal point is 0, to 0.125 for demonstration.

2, first multiply the decimal part of 0.125 by 2, get 0.25, and then take the integer part of 0.

3, then multiply the decimal part of 0.25 by 2, get 0.5, and then take the integer part of 0.

4, then multiply the decimal part of 0.5 by 2, get 1, and then take the integer part 1, there is no more decimal part.

5, the result of the binary is 0.001. After completing the above settings, you can convert decimal fractions to binary.

How do you convert the decimal and binary fractional parts, how do you convert them? For example, 0.65=? Or 0.101101=? Thanks…

Binary to decimal

:

Decimal point

The first bit behind the multiplication of two negative primary, the second bit multiplied by two negative quadratic, and so on behind the back, and then their sums add up

Decimal to binary

:Multiply the decimal part by 2, take the integer digit numbers, such as: 0.65 * 2 = 1.3 to take 1, and then 0.3 * 2 = 0.6 to take 0, and then 0.6 * 2 = 1.2 to take 1

And so on to take the five to six can be, the result is: 0.1010011