GATE 2002
December 19, 2024GATE 2005
December 19, 2024GATE 2005
Question 16 |
The range of integers that can be represented by an n bit 2’s complement number system is:
– 2n-1 to (2n-1 – 1) | |
– (2n-1 – 1) to (2n-1 – 1) | |
– 2n-1 to 2n-1 | |
– (2n-1 + 1) to (2n-1 – 1) |
Question 16 Explanation:
The maximum (positive) n bit number is 011….1 (i.e., 0 followed by n-1 ones) which is equal to 2n-1 – 1.
The smallest (negative) n bit number is 100..0 (i.e., 1 followed by n-1 zeros) which is equal to – 2n-1.
1000…00
0111…11 <- 1’s complement
1000..00 <- 2’s complement
= – 2n-1
The smallest (negative) n bit number is 100..0 (i.e., 1 followed by n-1 zeros) which is equal to – 2n-1.
1000…00
0111…11 <- 1’s complement
1000..00 <- 2’s complement
= – 2n-1
Correct Answer: A
Question 16 Explanation:
The maximum (positive) n bit number is 011….1 (i.e., 0 followed by n-1 ones) which is equal to 2n-1 – 1.
The smallest (negative) n bit number is 100..0 (i.e., 1 followed by n-1 zeros) which is equal to – 2n-1.
1000…00
0111…11 <- 1’s complement
1000..00 <- 2’s complement
= – 2n-1
The smallest (negative) n bit number is 100..0 (i.e., 1 followed by n-1 zeros) which is equal to – 2n-1.
1000…00
0111…11 <- 1’s complement
1000..00 <- 2’s complement
= – 2n-1