Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

***PLEASE SHOW ALL WORK, DO NOT JUST CIRCLE AN ANSWER!!!*** 12. Consider a virtu

ID: 3605456 • Letter: #

Question

***PLEASE SHOW ALL WORK, DO NOT JUST CIRCLE AN ANSWER!!!***

12. Consider a virtual memory system running on a RISCCPU. Page tables are not locked in memory and may be swapped to disk. An lw (load word) instruction reads one data word from memory; the address is the sum of the value in a register and an immediate constant stored in the instruction itself. Neither machine instructions nor page-table entries nor data words can cross a page boundary. In the worst case, how many page faults could be generated as a result of the fetch, decode, and execution of an lw instruction? 58 (A) 2 (B) 3 (C) 4 (D) 5 (E) 6

Explanation / Answer

The page fault is going to happen whenever memory is going to be accessed.In this case fetching an instruction is accessing the memory so a page fault can happen if the relevant page is not their and next access to memory will happen
during the execution of instruction as the data has to be read from the address
in memory. So a maximum of two page faults can happen in the worst case.