In: Electrical Engineering
In a computer system with multiple types of memory (such as RAM and ROM), how does the computer identify where memory is stored?
Whenever a data is being used by the processor (CPU), it is brought in the faster memories (RAM) but when a specific data is not being used, its stored in the slowest memory (ROM/ HARD DRIVE).
Memory management scheme ensures that whenever a data needs to be access or altered, its ready to be identified and present in the faster memory.
The diagram given above shows this process clearly. This is explained below:
Cache memory is present between memory and processor.
Virtual Memory= Main Memory (MM) + Cache Memory.
The real address is the real physical memory address of a data. The virtual address, on the other hand, is a computer generated address which has a corresponding real address in the memory.
Now, an address consists of two parts: Page field and line field. Page field indicates which block of memory to look for and line field indicates which portion or line is to be accessed precisely. The translation table translates the virtual address to the real address.
After the real address is found, data from the memory (either MM or SM) is transferred to the processor via the data path.
The similar process follows while storing the data in the memory.
Hope this helps.