Decimal to binary, how to convert?There are two ways to do this:Direct calculations and power split conversions
Formulas for direct calculations:Integer division is reversed to the remainder, and decimal multiplication is rounded forward. So how do you determine a certain base number?rightHow much?It's simpleWhat is the base system, the right is how much。For example, the decimal weight is 10, the binary weight is 2, and so on.
Then, when it comes to specific calculations, integers and decimals are calculated separately.
The integer is constantly divided to take the remainder untilDividendSmaller than the weight. Then the remainder obtained by the first expulsionPut it on the far right, and the number that remains after the division can no longer be divided, that is, the remainder obtained by the last divisionPlace it on the far left, and place the rest in order, then the decimal conversion of the integer part is fine.
The decimal is constantly multiplied to take the integer, and the integer is to take the number in the part of the integer, not to useRoundingThis must be remembered!When does the ride end?The answer is to multiply until there are no decimals. Then, when taking the number, the integer obtained by the first multiplication is placedFar left, and finally multiply the integer putFar right, which is the opposite of the order in which integers are taken.
This method is used to convert the base system!It is necessary to be familiar with the values of the different powers of the target base system, at least by heart-10 to +10Values in this range. Because this is carried outPower split conversionThe foundation.
Based on this, the number of revolutions to be transferred is split intoThe form of addition of different powersFor example, 19 = 16 + 2 + 1 = 2 4 + 2 1 + 2 0, that is to say, the conversion of decimal 19 to binary is 10011, which is obviously much faster than direct calculation, and it is clear at a glance that those positions are not 0 and those positions are 0. Let's use a decimal for example: 08125 =0.5 + 0.25 + 0.0625 = 1 2 + 1 4 + 1 16 = 2 -1 + 2 -2 + 2 -4, so 0The binary number of 8125 is 01101.When converting, just pay attentionThe left is big and the right is smallrules.
At this point, you have learned about the two calculation methods of base conversion:Direct computation and power split transformations。Personally, it is recommended that after being familiar with the method of direct calculation, more training is carried out by using the method of power split conversion to base conversion, and it can also be seen from the above content that the calculation speed of using the power split conversion method is much faster, and even when the mental arithmetic is relatively strong, the base conversion can be completed without using a pen.