The method of converting decimal integers into binary integers is "binary rounding". 127 is divided by 2 to get quotient 63, and the remainder is 1. When 63 is divided by 2, the quotient is 3 1 and the remainder is 1. Divide in turn until the quotient is zero. Take the first divided remainder as the lowest bit, the last divided remainder as the highest bit, and the last binary integer is111111.
Negative integer to binary:
First convert the corresponding positive integer into binary, then reverse the binary of the positive integer, and then add 1 to the result.
For example, taking 32 as an example, the negative integer 32 is -32.
Then, the decimal value 32 is converted into a binary value as follows:
The result of dividing 32 by 2 is 16, and the remainder is 0.
16 is divided by 2 to get 8, and the remainder is 0.
Divide 8 by 2 to get 4 and the remainder is 0.
Divide 4 by 2 to get 2 and the remainder is 0.
The result of dividing 2 by 2 is 1, and the remainder is 0.
1 is divided by 2 to get 0, and the remainder is 1.
The remainder is arranged in reverse order, and the binary numerical result of integer 32 is 100000.