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 covers −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1, so 8 bits span −128 to +127. Zero has a single representation (00000000), which leaves one extra negative value. Edge values need care—for example, −128 × −1 overflows because +128 cannot be represented. 16 bits cover −32,768 to +32,767 and 32 bits about ±2.1 billion. 0–255 is the same 8 bits interpreted as unsigned.
- 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.