Question Detail

COM 101 COM 101 Past Questions Objective Question

Question

If you are given a word of size n bits, the range of 2's complement of binary numbers is ______
Options
A -2^(n+1) to +2^(n+1)
B -2^(n-1) to +2^(n-1)
C -2^(n-1) to +2^(n-1)-1
Correct Answer
D -2^n to +2^(n-1)-1
Correct Answer

Option C is the correct answer.

Detailed Explanation

In two's complement representation with n bits, the range is from -2^(n-1) to +2^(n-1)-1. For example, with 8 bits, range is -128 to +127 (-2^7 to +2^7-1).

Hint

For n bits, negative range includes -2^(n-1), positive goes up to 2^(n-1)-1.

Question Info