I am trying to understand how a RAM memory controller gets data with instant access while reading through the memory. Let's say initially, ram gets the data at address 0 and then to get the data at some random location like 1234, does it not have to loop through the first 1233 addresses before reaching 1234? Please explain. Thank you!
-
1$\begingroup$ This is a question about the implementation of memory in hardware, which is somewhat tangential to this site. Basically, your mental image of a tape is very different from how RAM is implemented, which is more like a bunch of matrices in which each cell can be accessed by “tagging” the row and the column. $\endgroup$– Yuval FilmusDec 20, 2019 at 21:15
1 Answer
The RAM makes use of direct-memory-access, briefly this means that
An element of data or instructions (such as a byte or word) can be directly stored or retrieved by selecting and using the locations on the storage media.
Now this can be happened with the use of a DMA controller, which bypasses CPU to transfer data directly between I/O device and memory.
If you want to understand precisely how this happens I suggest you read the book
Operating System Concepts 10th Edition (Chapter 13)
I hope this helped you to understand why RAM gets instant access, comment below if you have more questions.