If a variable can take only integral values from 0 to n. where n is a constant integer, then the variable can be represented as a bit-field whose width is the integral part of (the log in the answers arc to the base 2)
A. | log (n) + 1 |
B. | log (n - 1) + 1 |
C. | log (n + 1) + 1 |
D. | none of the above |
Answer : A Explanation :
Let n = 7. It needs actually a 3 bit-field. But log (n + 1) + 1 will be log (8 ) +1, i.e., 4, which is wrong. |
|
Option: A Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. |