Difficulty: Medium
Correct Answer: -27
Explanation:
Introduction / Context:Two's complement is the standard representation for signed integers in modern digital systems. Interpreting an 8-bit two's complement binary number requires identifying whether it is positive or negative, and then decoding it properly.
Given Data / Assumptions:
Concept / Approach:In 2's complement, the most significant bit (MSB) is the sign bit. If MSB = 0, the number is positive and interpreted directly. If MSB = 1, the number is negative, and its magnitude is obtained by inverting all bits and adding 1.
Step-by-Step Solution:
Binary given: 11100101.MSB = 1 ⇒ number is negative.Invert bits: 00011010.Add 1: 00011011 (decimal 27).Therefore, value = −27.Verification / Alternative check:
Direct conversion: interpret as unsigned = 229. For 8-bit 2's complement, subtract 256: 229 − 256 = −27. Same result.Why Other Options Are Wrong:
+37, +27: positive, contradict MSB = 1.−31: would correspond to binary 11100001.−59: unrelated to this binary string.Common Pitfalls:
Forgetting to apply 2's complement inversion +1.Confusing sign-magnitude with 2's complement.Final Answer:
-27
Discussion & Comments