5.1. Memory Management Hardware

5.1.1. Memory Hierarchy

Computers have several different types of memory. This memory is often viewed as a hierarchy as shown below.

../_images/memory_hierarchy.png

Our main concern here will be the computer’s main or RAM memory. The cache memory is important because it boost’s the speed of accessing memory, but it is managed entirely by the hardware. The rotating magnetic memory or disk memory is used by the Virtual Memory Management.

5.1.2. Memory Management Unit

As a program runs, the memory addresses that it uses to reference its data is the logical address. The real time translation to the physical address is performed in hardware by the CPU’s Memory Management Unit (MMU). The MMU has two special registers that are accessed by the CPU’s control unit. A data to be sent to main memory or retrieved from memory is stored in the Memory Data Register (MDR). The desired logical memory address is stored in the Memory Address Register (MAR). The address translation is also called address binding and uses a memory map that is programmed by the operating system.

Note

The job of the operating system is to load the appropriate data into the MMU when a processes is started and to respond to the occasional Page Faults by loading the needed memory and updating the memory map.

../_images/mmu.png

Before memory addresses are loaded on to the system bus, they are translated to physical addresses by the MMU.