Address Translation


In virtual memory, blocks of memory (called pages ) are mapped from one set of addresses (called virtual addresses ) to another set (called physical addresses). The processor generates virtual addresses while the memory is accessed using physical addresses. Both the virtual and physical memory are broken into pages, so that a virtual page is mapped to a physical page.

If the page resides on disk, the virtual page will not be mapped to a physical address. Physical pages can be shared by having two virtual addresses point to the same physical address. This capability is used to allow two different programs to share data or code.

The following figure shows an example of mapping from a virtual to a physical address. The page size is 212 bytes = 4 KiB.

The number of physical pages allowed in memory is 218, since the physical page number has 18 bits in it. Thus, main memory can have at most 230 bytes = 1 GiB, while the virtual address space is 232 bytes = 4 GiB. Key decisions in designing virtual memory systems include: