Introduction / Context:
Two’s complement is the dominant representation for signed integers in computer systems because it yields a single representation for zero, simplifies arithmetic, and keeps addition/subtraction hardware uniform. This question asks for −7 in 16-bit two’s complement.
Given Data / Assumptions:
- Word size: 16 bits.
- Target value: −7.
- Representation system: two’s complement.
Concept / Approach:
- To obtain −N in two’s complement: write +N in binary, invert all bits (one’s complement), then add 1.
- Ensure the width (16 bits) is maintained throughout.
Step-by-Step Solution:
Write +7 in 16 bits: 0000 0000 0000 0111.Invert all bits (one’s complement): 1111 1111 1111 1000.Add 1: 1111 1111 1111 1000 + 0000 0000 0000 0001 = 1111 1111 1111 1001.Therefore, −7 = 1111 1111 1111 1001 (16-bit two’s complement).
Verification / Alternative check:
Add +7 and −7 in 16-bit two’s complement: 0000 0000 0000 0111 + 1111 1111 1111 1001 = 1 0000 0000 0000 0000 (discard carry) → 0000 0000 0000 0000, confirming correctness.
Why Other Options Are Wrong:
- 0000 0000 0000 0111: That is +7, not −7.
- 1000 0000 0000 0111: Sign-magnitude-like form, not valid two’s complement for −7.
- 1111 0000 0000 0001 and 0111 0000 0000 0000: Do not correspond to two’s complement of 7.
- None of the above: Correct here only because the accurate two’s complement (1111 1111 1111 1001) is not listed among the options.
Common Pitfalls:
- Forgetting to fix the bit-width before inversion and addition.
- Confusing sign-magnitude or one’s complement with two’s complement.
Final Answer:
1111 1111 1111 1001 (not listed), so 'None of the above' is correct.
Discussion & Comments