What is the two's complement of (-7)?

1 answer

To find the two's complement of a negative number, follow these steps:

1. Convert the number to binary.
- The binary representation of 7 is: 0111

2. Invert all the bits (change 0 to 1, and 1 to 0).
- The inverted bits are: 1000

3. Add 1 to the inverted bits.
- Adding 1 to 1000 gives: 1001

Therefore, the two's complement of -7 is 1001.