ENEE350H - Fall, 2004

Practice questions on Virtual Memory

1.  A machine has a 32-bit byte-addressable virtual address space. The page size is 16 KB. How many pages of virtual address space exist?


2.  Do you need algorithm like best fit when implementing paging, and why?
 

3.  A page table is indexed by the virtual page number to obtain the physical address of the block. Given a 28-bit virtual address, 4 KB page size, and 4 bytes per page entry, what is the maximum size of the page table assuming byte-addressable? (10)
 

4. A computer has 16 pages of virtual address space but only four physical pages.  Initially the physical memory is empty.  A program references the virtual pages in the order 0, 2, 4, 5, 2, 4, 3, 11, 2, 10.  Which references cause a page fault with the LRU page replacement policy?  Show your intermediate working in the table below with three columns.  Use as many rows as page faults.  [To specify your final answer, in the VPN list at the bottom, underline the VPNs that cause page faults.]

Page fault at:                 Evict:                            New contents:

(VPN)                          (VPN)                          (VPNs in any order)

                       ... fill in ...

 

0,   2,   4,   5,  2,  4,  3,  11,  2,  10.