Difficulty: Easy
Correct Answer: Correct — two’s complement = one’s complement + 1
Explanation:
Introduction / Context:
Two’s complement is the dominant representation for signed integers in digital systems. It simplifies hardware for addition and subtraction, supports a unique zero, and makes sign extension straightforward. This question confirms the canonical construction rule for two’s complement.
Given Data / Assumptions:
Concept / Approach:
To obtain the two’s complement of an n-bit binary number X, first invert every bit to get the one’s complement (~X), then add 1: (two’s complement of X) = (~X) + 1, computed modulo 2^n. This operation is central for negation: the negative of a number A is its two’s complement with respect to the chosen width.
Step-by-Step Solution:
Verification / Alternative check:
Example (8-bit): X = 00010110 (22). One’s complement = 11101001. Add 1 → 11101010, which represents −22 in two’s complement. Adding X and this result yields 00000000 with a carry out discarded, validating the rule.
Why Other Options Are Wrong:
Common Pitfalls:
Forgetting fixed width during inversion, mishandling carry out, or mixing sign-magnitude with two’s complement rules.
Final Answer:
Correct — two’s complement = one’s complement + 1
Discussion & Comments