What is the two's complement of (-7)?
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.
To find the two's complement of a negative number, follow these steps:
1. Represent the number in binary form. (-7 in binary is 111).
2. Invert all the bits (change 1's to 0's and 0's to 1's). After inverting, we get 000.
3. Add 1 to the result from step 2. 000 + 1 = 001.
So, the two's complement of -7 is 001.