2's-complement subtraction by addition When subtracting using the 2's-complement method, which operand is complemented before performing the addition?
-
Athe minuend and the subtrahend are both changed to the 2's-complement.
-
Bthe minuend is changed to 2's-complement and the subtrahend is left in its original form.
-
Cthe minuend is left in its original form and the subtrahend is changed to its 2's-complement.
-
Dthe minuend and subtrahend are both left in their original form.
Answer
Correct Answer: the minuend is left in its original form and the subtrahend is changed to its 2's-complement.
Explanation
Introduction / Context:Digital systems perform subtraction by reusing the same adder hardware used for addition. The trick is to convert subtraction into addition using 2's-complement arithmetic. This question asks you to recall which operand is complemented in that process.
Given Data / Assumptions:
- We want A - B using 2's-complement arithmetic.
- 2's-complement of a number X is formed by inverting all bits (1's-complement) and then adding 1.
Concept / Approach:Compute A - B as A + (2's-complement of B). The minuend A remains unchanged, and only the subtrahend B is transformed. Addition is then performed; any final carry out is discarded in fixed-width arithmetic, leaving the correct signed result.
Step-by-Step Solution:Form B' = 2's-complement(B) = NOT(B) + 1.Compute S = A + B' using the standard adder.Interpret result as signed 2's-complement value; ignore carry-out if present.
Verification / Alternative check:Example: 7 - 5. In 4-bit 2's-complement, 5 → 0101, B' = 1011. Add 0111 + 1011 = 1 0010; discard carry, result 0010 = 2, which is correct.
Why Other Options Are Wrong:
- Complementing both operands or the minuend changes the intended operation and breaks the identity A - B = A + (2's-complement of B).
- Leaving both unchanged would simply compute A + B, not subtraction.
Common Pitfalls:
- Forgetting to add 1 after inversion when forming 2's-complement.
- Misinterpreting carry-out handling in fixed-width arithmetic.
Final Answer:the minuend is left in its original form and the subtrahend is changed to its 2's-complement.