1,429 views
0 votes
0 votes
what is minimum no. of bits required to represent  //  (8)base 10              in binary  

 

formula : n >= log(8) base 2  = 3  but answer should be 4   ??  binary of 8 = 1000

1 Answer

Best answer
3 votes
3 votes

Talking about unsigned integers, range of numbers possible using n-bits is 0 to 2n - 1

Let the largest possible number be p,

p = 2n - 1

p + 1 = 2n

So, n = log2(p + 1)

In general for any number m, we require $\left \lceil log_{2}(m+1)\right \rceil$ bits to represent it in its binary equivalent

selected by

Related questions

1 votes
1 votes
1 answer
2
Rohit Gupta 8 asked Oct 24, 2017
658 views
Consider bandwidth of line is 100 Mbps and sequence number of field consists 32 bits on a TCP machine. How much time it will take to cover all possible sequence numbers? ...
1 votes
1 votes
0 answers
3
sh!va asked Jul 12, 2016
1,158 views
After scanning a file the frequencies of letters a,b,c,d,e and f are estimated as 12,2,7,13,14 and 85 respectively.No we encode each character using Huffman coding algori...