I was reading the Wikipedia page on counting in binary and came across this statement that I don't quite understand:
In the binary system, each digit represents an increasing power of 2, with the rightmost digit representing 2$^0$, the next representing 2$^1$, then 2$^2$, and so on.
So does this mean that as we increase the number of digits, we increase in powers of 2? 2$^0$ is represented by 0001, 2$^1$ by 0010, 2$^2$ by 0100, and 2$^3$ by 1000?
I know with the decimal system, 10$^2$ gives me 100 available numbers. In binary, 2$^2$ (which equals 4) gives me this: 0, 1, 10, 11 (4 available numbers). But 2$^3$ (which equals 8) gives me this: 0, 1, 10, 11, 100, 101, 111 which is only 7 numbers. I'm not sure what I'm missing, in the decimal system we keep track of orders of magnitude with 10$^n$, but in binary is it 2$^n$-1?
It looks like you might have fudged your math a bit (pun intended). It happens when learning new bases. No biggy.
\begin{array}{c|l|c} \text{Base 10}& \text{Conversion} & \text{Binary}\\ \hline 1 & 2^0 & 001 \\ 2 & 2^1 & 010 \\ 3 & 2^1 + 2^0 & 011 \\ 4 & 2^2 & 100 \\ 5 & 2^2 + 2^0 & 101 \\ 6 & 2^2 + 2^1 & 110 \\ 7 & 2^2 + 2^1 + 2^0 & 111 \end{array}
With $n$ bits the max you can get to is $2^n-1$, or in this case, the max that you can reach is seven. Since, $2^3 - 1 = 8 - 1 = 7$. If you want to reach 8, then you'll have to add another bit.