title: Calculating bits required to store decimal number
body: <p>This is a homework question that I am stuck with.</p>
  
  <blockquote>
    <p>Consider unsigned integer representation. How many bits will be
    required to store a decimal number containing:</p>
  </blockquote>
  
  <pre><code>i) 3 digits ii) 4 digits iii) 6 digits iv) n digits
  </code></pre>
  
  <p>I know that the range of the unsigned integer will be 0 to 2^n but I don't get how the number of bits required to represent a number depends upon it. Please help me out.</p>
  
  <p>Thanks in advance.</p>