Tip:A–D to answerE for explanationV for videoS to reveal answer
The range of numbers that can be stored in 8 bits, if negative numbers are stored in 2's complement form is
- A.
−128 to +128
- B.
−127 to +128
- C.
−128 to +127
(Correct Answer) - D.
−127 to +127
Correct Answer: −128 to +127
Explanation
The correct answer is (c) -128 to +127.
Logic:
The range of signed integers using n-bit 2's complement representation is given by the formula:
Range=[−(2n−1) to +(2n−1−1)]
Given n=8 bits:
Putting it together:
Range for 8 bits=−128 to +127
Explanation
The correct answer is (c) -128 to +127.
Logic:
The range of signed integers using n-bit 2's complement representation is given by the formula:
Range=[−(2n−1) to +(2n−1−1)]
Given n=8 bits:
Putting it together:
Range for 8 bits=−128 to +127