Logic circuits
What range of integers can be represented in 8-bit two's complement?
- A−128 to +127
- B−127 to +127
- C0 to 255
Show answer and explanation
Answer: A. −128 to +127
n-bit two's complement can represent values from −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1, so 8 bits cover −128 to +127. There is one more negative value because zero has only one representation. 0 to 255 is the unsigned 8-bit range.
- A. Correct. −2⁷ to 2⁷ − 1.
- B. −127 to +127 is the range of representations such as sign-magnitude, where zero has two forms.
- C. 0 to 255 is the unsigned 8-bit range.