For example, the binary number 0.00 1 is converted into a decimal number.
If the first digit is 0, then 0* 1/2, that is, 0 times 2 minus the power of 1.
The second digit is 0, so it is 0* 1/4, that is, 0 times the negative square of 2.
The third place is 1, so it is 1* 1/8, that is, 1 multiplied by the negative cubic of 2.
When all the numbers are added up, 0 *1/2+0 *1/4+1*1/8 will get decimal 0. 125.
Extended data:
Convert binary to decimal:
Methods: "Weighted expansion summation", the specific step of this method is to write binary numbers into weighted coefficient expansion, and then sum them according to the decimal addition rule.
Law: the number of digits in the unit is 0, the number of decimals is 1, ..., which increases in turn, while the number of digits in the tenth is-1, and the number of digits in the percentile is -2, ..., which decreases in turn.
Decimal to binary conversion:
When decimal numbers are converted into binary numbers, they should be converted into integer parts and decimal parts respectively, and then combined together.
The integer part adopts the method of "dividing by 2 to take the remainder and arranging it 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.
The decimal part should be rounded to 2. That is, multiply the decimal fraction by 2 and take away the obtained integer (it must be 0 or 1), then repeat the previous steps with the remaining decimal fraction until the remaining decimal fraction is 0, and finally arrange the integer parts obtained each time from left to right to get the corresponding binary decimal fraction.
Universal decimal conversion:
The essence of the conversion between different binary systems is to determine the numbers with different weight positions. There is a simple algorithm to convert positive integer decimal, which is to do long division with target radix; The remainder gives the "number" from the lowest bit.
References:
Baidu Encyclopedia-Binary