Difficulty: Medium
Correct Answer: –14 and –13; –27
Explanation:
Introduction / Context:Two’s complement is the dominant signed binary representation used by processors. Mastery involves recognizing negative values, converting between binary and decimal, and performing addition with correct overflow interpretation.
Given Data / Assumptions:
Concept / Approach:For two’s complement: if the MSB is 1, the value is negative and equals the negative of the two’s complement magnitude. To find magnitude: invert bits, add 1. Addition of two’s complement numbers uses ordinary binary addition; discard any carry beyond 8 bits, then interpret the result with sign bit.
Step-by-Step Solution:
Number A = 11110010 → MSB = 1 → negative. Invert: 00001101; add 1 → 00001110 = 14 → A = –14.Number B = 11110011 → MSB = 1 → negative. Invert: 00001100; add 1 → 00001101 = 13 → B = –13.Sum: –14 + –13 = –27 (decimal).Binary add (optional check): 11110010 + 11110011 = 1 11100101 (9-bit). Discard carry → 11100101. Invert to check magnitude: 00011010; add 1 → 00011011 = 27; MSB 1 → –27.Verification / Alternative check:Decimal arithmetic confirms –27. The sign bit of 11100101 is 1 and magnitude check yields 27, consistent with –27. No signed overflow occurred here because adding two negatives cannot overflow into positive in 8-bit unless magnitude exceeds range, which it does not (range is –128 to +127).
Why Other Options Are Wrong:
Common Pitfalls:Forgetting to invert then add 1 when decoding negatives; mishandling end carry; misinterpreting the sign bit after addition.
Final Answer:–14 and –13; –27
Discussion & Comments