Why is the number of digits (bits) in the binary representation of a positive integer $n$ is the integral part of $1 + \log_2 n$?
If you have $n$ bits available you can represent the numbers $0$ to $2^n-1$ in binary. Therefore, if you want to represent a number $x$ in binary, you need a number of bits $n$ that is large enough so that

$$
\begin{split}
2^n - 1 &amp; \geq x\\
n &amp; \geq \log_2(x+1)\,.
\end{split}
$$

Now there are two cases for $\log_2(x+1)$:


It is an integer. Then $\log_2(x)$ won't be. It'll be slightly less. So $\lfloor\log_2(x)\rfloor + 1$ will yield the same value. (The exception where $x=1$ can be checked separately.)
It isn't an integer. In this case $\lfloor\log_2(x)\rfloor + 1$ yields the next largest integer just as $\lfloor\log_2(x+1)\rfloor + 1$ would.


In either case, because $n$ is always an integer we can write 

$$
n \geq \lfloor\log_2(x)\rfloor + 1\,.
$$