Current location - Training Enrollment Network - Mathematics courses - How to convert decimal numbers into binary ones?
How to convert decimal numbers into binary ones?
Method: Multiply each binary number from right to left by the corresponding power of 2, and then from left to right after the decimal point.

For example, the binary number1101.01is converted to decimal.

1101.01(binary) =1* 20+0 * 21+kloc-0/* 2+65438. +0 * 2-1+1* 2-2 =1+4+8+0+0.25 =13.25 (decimal)

So to sum up, the general formula is:

Abcd.efg (binary) = d * 20+c * 21+b * 22+a * 23+e * 2-1+f * 2-2+g * 2-3 (decimal

Extended data

1, decimal integer is converted into binary integer.

Decimal integers are converted into binary integers by the method of "dividing by 2 to get the remainder and arranging in reverse order". The specific method is: divide the decimal integer by 2 to get a quotient and remainder; Divide the quotient by 2 to get a quotient and a remainder, and so on until the quotient is less than 1. Then, the first obtained remainder is used as the low-order significant bit of the binary number, and the last obtained remainder is used as the high-order significant bit of the binary number, which are arranged in turn.

2. Decimal decimals are converted into binary decimals

The method of converting decimal fraction into binary fraction is "rounding by 2, in order". The specific method is: multiply the decimal part by 2 to get the product, take out the integer part of the product, multiply the remaining decimal part by 2 to get another product, take out the integer part of the product, and so on until the decimal part of the product is zero, at which time 0 or 1 is the last bit of the binary. Or until the required accuracy is achieved.

Then, the extracted integer parts are arranged in sequence, with the first integer as the high-order significant bit of binary decimal and the last integer as the low-order significant bit.

Baidu Encyclopedia-Decimal to Binary