Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What is the complement of binary number-10101100? Thank you.
What is the complement of binary number-10101100? Thank you.
If the number you give is a short integer, it takes up two bytes of memory, each byte has eight bits, the first bit is the sign bit, 0 means positive, and 1 means negative.

For example, 1 is: 0000000001.

A negative number is the inverse code that stores its absolute value plus 1.

Such as:-1=~ 1+ 1

~ 1= 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10

- 1= 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

The number you gave seems to be missing a byte.

If the highest bit is 1, subtract 1 first, and then invert.

- 10 10 1 100- 1=- 10 10 10 1 1

Find the absolute value after inversion:

0 10 10 100=84

So the original number means -84.