In: Computer Science
If we had 20,000(subscript 10) memory locations, what would be the least number of address lines needed to describe each location? (Hint: Change 20,000 to binary or hex and determine the number of bits needed.)
For 20000 to convert to binary, we need to divide 20000 continuously by 2. and set the value of quotient in place of 20000 and the value of reminder for our bit or we can say binary digit.
We need to keep doing the same till quotient gets 0 and the binary number would be al the bits from down to top.
The calculation would clear it easily.
Division by 2 | Quotient | Reminder |
---|---|---|
20000 / 2 | 10000 | 0 |
10000 / 2 | 5000 | 0 |
5000 / 2 | 2500 | 0 |
2500 / 2 | 1250 | 0 |
1250 / 2 | 625 | 0 |
625 / 2 | 312 | 1 |
312 / 2 | 156 | 0 |
156 / 2 | 78 | 0 |
78 / 2 | 39 | 0 |
39 / 2 | 19 | 1 |
19 / 2 | 9 | 1 |
9 / 2 | 4 | 1 |
4 / 2 | 2 | 0 |
2 / 2 | 1 | 0 |
1 / 2 | 0 | 1 |
So 2000010 = 1001110001000002
Since there are 15 bits in our resulting binary number. So, the least number of address lines is 15.
Solution ends.
Please comment and let me know if you have any further doubts. Please leave an upvote if you like my answer.
Thank you.
Have a good day.