Thu, 15 Sep 2011, 01:47
A student is confused about the addresses of memory locations and the data stored in each location. He writes: > If you have a memory address that points to a memory location, > that address itself takes up memory because it's made of of x number > of bits, correct? And if that memory address takes up memory it has > to be stored somewhere. That is correct, but ONLY the one address that you are using right now to access memory. Not ALL the addresses. And, the storage required is the single register known as the MAR. > So then, I was wondering how you access the storage location in which > the address is stored. The address is stored in the MAR. > If there's yet another address for that location doesn't that take > up yet more memory. It kind of seems like an infinite loop to me. > > Sincerely, > <<name withheld to protect the student with a basic misconception>> The misconception is that somehow you think that associated with every memory location is an address stored somewhere. Not true. We "know" the address of a memory location based on what output line of the decoder is connected to it. Look again at Figure 3.21 in Chapter 3 (that we drew on the blackboard today). There are four locations, each storing 3-bits. The four locations have addresses 00, 01, 10, and 11. Do you see those addresses stored anywhere? Answer: No. Then how do we know which address corresponds to which memory location? Answer: by looking at which output line of the decoder is connected to which 3-bit memory location. So, if we want to access a memory location, we load MAR with the address that we want to access. The MAR is input to a decoder which then gives you an output 1 for exactly ONE memory location. Which one? The one associated with that address. If you look at Figure 3.22, you will note that we wish to access location 11. The corresponding output of the decoder, designated by the output of an AND gate that is solid corresponds to the fourth word of memory. Note that that output is used to control the three muxes (also shown filled in) corresponding to the three bits of that fourth word of memory. Finally, if that output is ANDed with the WE (write enable) line, we have the GATE function we discussed in class earlier. That is, we are able to store a 3-bit value into that fourth memory location. Bottom line: There is no need to store the addresses of each of the four memory locations. ...or in the case of your laptop, there is no need to store the one billion addresses of the 1GB of memory. What is needed is to associate one output line of the decoder to each of the 2^30 memory locations. Of course this requires a decoder with 30 bits of input and 2^30 output lines. Also, in the case of the 1GB memory, each location contains 8 bits of information, not 3 as in the 2^2 by 3-bits we talked about in class. OK? Yale Patt