Binary to decimal and hexadecimal Calculator tool

import Binary :
decimalism :
hexadecimal :

(1) decimalism conversions Binary, divided into whole number part and small number part

① Whole number part

method: In addition to 2, every time the whole number part is divided by 2, the residual number is the number of the weight, and the quotient continues to divide by 2, the residual number is the number of the weight of the previous one, this step continues until the quotient is 0, and finally when the number is read, Read from the last remaining number to the first remaining number. Here is an example:

Example: decimalism 168 conversions into Binary

Results decimalism 168 conversions Binary, (10101000) 2

Analysis: In the first step, 168 is divided by 2, the quotient is 84, and the residual number is 0.

In the second step, divide the quotient 84 by 2, and the remaining number of quotient 42 is 0.

Third step, divide the quotient 42 by 2, and the number of the quotient 21 is 0.

Step 4, divide the quotient 21 by 2, and the number of the quotient 10 is 1.

Step 5, divide the quotient 10 by 2, and the number of the quotient 5 is 0.

Step 6, divide the quotient 5 by 2, and the conumber of quotient 2 is 1.

Step 7, divide quotient 2 by 2, quotient 1 has a conumber of 0.

Step 8, divide the quotient 1 by 2, and the number of the quotient 0 is 1.

Step 9, read number, because the last bit is received by dividing by 2 many times, so it is the highest bit, read Number from the last remaining number forward, that is, 10101000

(2) Small number part

method: multiplication by 2 method, that is, multiply the small number part by 2, then take the whole number part, continue to multiply the remaining small number part by 2, then take the whole number part, and multiply the remaining small number part by 2, until you get the small number part It stops at zero. Can never be zero, just like decimalism number rounding, according to the requirement to keep as many small numbers, according to whether the next digit is 0 or 1, the choice is zero, round off, is 1, into the digit. In other words, 0 round 1. To read the number from the first integer number to the last integer number, the following example:

Example 1: Converting 0.125 to Binary Results: Converting 0.125 to Binary (0.001) 2

Analysis: In the first step, multiply 0.125 by 2 to get 0.25, then the whole number part is 0, and the small number part is 0.25;

In the second step, multiply the small number part 0.25 by 2 to get 0.5, then the whole number part is 0 and the small number part is 0.5;

Step 3, multiply the small number part 0.5 by 2 to get 1.0, then the whole number part is 1 and the small number part is 0.0;

The fourth step, read the number, read from the first digit to the last digit, that is, 0.001.

Example 2, 0.45 conversions Binary (save to the fourth digit of a small number)

As you can see from the above steps, when subtraction is done for the fifth time, the receive result is 0.4, then the small number part continues to be multiplied by 2 to get 0.8, 0.8 and then multiplied by 2's to 1.6 and so on. Finally, it is impossible to receive a small number of zero, so at this time, we have to learn decimalism method for rounding, but Binary only 0 and 1 two, so 0 round 1. This is also the Calculator will cause errors during conversions, but because of the large number of reserved bits and high precision, it can be ignored.

then, We can get the Results 0.45 conversions as Binary about be tantamount to 0.0111

The above method is decimalism conversions for Binary method, we need to pay attention to is:

1) decimalism conversions are Binary and need to be divided into integer and small number conversions

2) when conversions integer number, use division by 2 method, and when conversions small number, use multiplication by 2 method

3) Notice that they read the number direction

Therefore, We use the above method, We can find that decimalism number 168.125 conversions is Binary 10101000.001, or decimalism number conversions to Binary number about be tantamount to 10101000.0111.

(3) Binary conversions for decimalism between whole number and small number

method: In addition to the weight, multiply the Binary number by the weight and add the binary number to a decimalism number. Example Convert Binary number 101.101 conversions to decimalism number.

Results: (101.101) 2=(5.625)10

You're doing Binary conversions into decimalism and the thing to notice is

1) To know the Binary each weight

2) To be able to find each value