CST334 - Week 4
Week 4 Reflection Paging - Virtual address --> Physical address Find the VPN bits (first X bits of a virtual address). Find the offset bits of the virtual address, which are the last Y bits (or, the virtual address with leading VPN bits removed). Find the corresponding PTE (if available). If the most significant bit (MSB) is a 1, it is a valid address. If 0, it is not valid and a physical address cannot be obtained from this virtual address. Find the PFN, which is the last Y bits of the PTE. If one is not listed, the number of pages a physical address can hold determines the PFN bits using the formula: [log2(number of pages)]. Then, combine the PFN and offset in this order to obtain the translated physical address. Swapping Swapping makes use of a few policies to determine what pages to swap in memory: The optimal policy (aka Belady or MIN) replaces pages that are accessed furthest in the future to maximize cache hit rates. This is not very practical because implementing pr...