if we look at a $5$ bit mantissa, the max value will be $11111$ which is $2^5-1$, Why is it in the form of $2^{bits}-1$ is it a combinatorial explanation?
Asked
Active
Viewed 56 times
0
-
2each bit has $2$ possibilities, $0$ or $1$, so there are $2^5$ possibilities for $5$-bit values, but the first $5$-bit value is $0$, so subtract $1$ to get the max value – J. W. Tanner Dec 30 '19 at 20:06
-
@J.W.Tanner why the first $5$-bit value is $0$? it all ones – newhere Dec 30 '19 at 20:09
-
2meaning among the $2^5$ possible $5$-bit values ($00000, 00001, 00010, 00011,$ etc.) the first value is $0$ – J. W. Tanner Dec 30 '19 at 20:11
-
@J.W.Tanner I see, why we have to remove it? as it can not be a max? – newhere Dec 30 '19 at 20:12
-
2I was listing the possibilities in order of value – J. W. Tanner Dec 30 '19 at 20:14
-
@J.W.Tanner I understood, what I do not get is why we have to remove the possibility of getting the value zero? – newhere Dec 30 '19 at 20:18
-
1Count $0$ as the first, so $11111$ is the last (the 32nd); $m-1$ is the $m$-th; so the max value is $2^5-1$ – J. W. Tanner Dec 30 '19 at 20:32
1 Answers
2
If you look at unsigned binary integers, the smallest in $n$ bits is $00000$ with $n$ zeros and the highest is $11111$ with $n$ ones. It is just like in base $10$ where the largest number with $n$ digits is all $9$s. Then to see that this equals $2^n-1,$ note that the bits are successively $2^0+2^1+2^2+\ldots +2^{n-1}$. The sum of this geometric series is $2^n-1$
Ross Millikan
- 374,822