VirtualMemory Intro Study 15
VirtualMemory Intro Study 15
Main memory
Cache
Registers
Words
Lines
(transferred Pages
explicitly (transferred
via load/store) automatically (transferred
upon cache miss) automatically
upon page fault)
Program 1
virtual address space
main memory
Program 2
virtual address space
Page Tables and Address Translation
Page table
register Page table
Virtual
page
number
Valid
bits
Other
flags
Main memory
virtual address
Address Translation
❑ A virtual address (logical address or programmer’s address) is translated to a physical
address (main memory address) by a combination of hardware and software
• So each memory request first requires an address translation from the virtual space to
the physical space
• A virtual memory miss (i.e., when the page is not in main memory) is called a page fault
How to Translate Fast?
• Problem: Virtual Memory requires two memory accesses!
• Page Table is in physical memory! => 2 main memory accesses!
• one to translate Virtual Address into Physical Address (page table lookup)
• one to transfer the actual data (cache hit)
data hit
miss hit
Page Table
lookup
data
Miss Miss Hit Impossible – data not allowed in cache if page is not in
memory