If a variable can take only integral values from $0$ to $n$, where $n$ is an integer, then the variable can be represented as a bit-field whose width is $($the log in the answer are to the base $2$, and $\left \lceil \log_{}{n} \right \rceil$ means the floor of $\log_{}{n}\ )$
@MRINMOY_HALDER, No, see its clearly written in question to take the floor and not ceil.
so floor(log2 17) + 1 = 4 + 1 = 5.
Option B with n=0 will give complex values. With approximation(see image) and floor, it will give us 4+1=5 bits to represent 0, which is wrong.
64.3k questions
77.9k answers
244k comments
80.0k users