Final answer:
When using FIFO and LRU replacement policies for pages in a paged virtual memory system, the pages in the main memory change after each reference. The number of page replacements (page faults) varies depending on the policy used.
Step-by-step explanation:
When using the FIFO (First in, First out) replacement policy for pages in a computer with paged virtual memory, the pages in the main memory are replaced based on the order they entered the memory. In this case, the main memory can hold four pages at a time. After each reference, the pages in the main memory would be as follows:
- 3
- 3, 4
- 3, 4, 6
- 3, 4, 6, 10
- 4, 6, 10, 3
- 6, 10, 3, 5
- 10, 3, 5, 3
- 3, 5, 3, 5
- 3, 4, 5, 5
- 4, 5, 3, 5
- 5, 3, 5, 3
Using the FIFO policy, there will be 7 page replacements (page faults) in total.
When using the LRU (Least Recently Used) replacement policy, the page that has been referenced the longest time ago is replaced. In this case, the main memory can hold four pages at a time. After each reference, the pages in the main memory would be as follows:
- 3
- 3, 4
- 3, 4, 6
- 3, 4, 6, 10
- 4, 6, 10, 3
- 6, 10, 3, 5
- 3, 6, 10, 5
- 5, 3, 6, 10
- 3, 5, 6, 10
- 3, 5, 4, 10
- 3, 5, 4, 5
Using the LRU policy, there will be 6 page replacements (page faults) in total.