Need help with my Computer Science question – I’m studying for my class.
REPLYING TO TWO PEERS EACH ONE 100 WORDS ONLY
Discussion Title: Relationship of memory capacity to the address bus
Assume the main memory contains M addresses in a computer system (the memory addresses are represented as unsigned binary numbers starting from zero). Inside the memory, a decoder is used to enable one out of M addresses to perform memory reading/writing operation. In this discuss, please specify the required number of lines of address bus (one line can only transfer one address bit). You need to explain your conclusion.
Since a decoder is being used the number of address lines needed is going to be less than M. Then we need to take the number M and continually divide it by two and adding one to a new variable n every time we do, until M = 1. ( This is assuming M 1 is a perfect power of 2 which for memory it should be. If it is not a perfect power of two when a remainder of less than 1 is achieved you are done.) Then you will need n number of address bus lines. This idea is from the theory that x lines on the address bus correspond with 2^x possibilities of addresses when using a decoder. This is what allows the address bus to work more efficiently, without a decoder the number of address lines needed would be too large. Therefore n lines will be needed because 2^n = M.
Recall the definition of decoder, each time we give n inputs and it will generate 2^n outputs, one of the 2^n outputs is 1 and the rest are 0. For the question here, the 2^n = M, and M is given. We are supposed to calculate the minimum n required to make it possible of M addresses. Take the logarithm on both sides of the equation 2^n = M, and we get n = log(M), the base number is 2. However, as n has to be an integer, we need to round up n if M is not a full power of 2. Therefore, the required number of lines of the address bus is the round-up of log(M), the base number is 2.