Two’s complement subtraction setup: To compute 43 − 15 in binary by addition, which 6-bit two’s-complement code should be added to 43 to represent “minus 15”?
-
A101011
-
B110000
-
C011100
-
D110001
Answer
Correct Answer: 110001
Explanation
Introduction / Context:Digital systems perform subtraction by adding the two’s complement of the subtrahend. Selecting the correct two’s-complement pattern is crucial for correct results and for understanding how ALUs handle subtraction internally.
Given Data / Assumptions:
- Operation: 43 − 15.
- Assume 6-bit words (sufficient since 43 is 101011₂ and 15 is 001111₂).
- Task: choose the 6-bit two’s complement of 15 to add to 43.
Concept / Approach:For two’s complement: –N = invert(all bits of N) + 1. Represent 15 in 6 bits, form its two’s complement, and identify the correct option.
Step-by-Step Solution:
15 (decimal) in 6 bits = 00 1111 → 001111.Invert: 110000.Add 1: 110000 + 000001 = 110001. This is the 6-bit code for –15.Therefore, to compute 43 − 15, add 43 + 110001 (the two’s complement of 15).Verification / Alternative check:Perform the addition: 43 (101011) + 110001 = 1 011100 (ignore carry) = 011100 = 28, which equals 43 − 15, confirming the correctness.
Why Other Options Are Wrong:
- 110000: Missing the +1 step; this is one’s complement of 15, not two’s.
- 101011 / 011100: These are unrelated values (43 and 28, respectively), not the needed complement.
Common Pitfalls:Forgetting to add 1 after inversion; using too few bits so that sign is lost; misreading leading zeros in fixed-width formats.
Final Answer:110001