0% found this document useful (0 votes)
136 views

Tutorial 1 Memory

This document contains multiple examples of calculating page faults using different page replacement algorithms including Optimal, LRU, and FIFO. The examples involve computing page faults for programs with various numbers of virtual pages and physical page frames. The optimal algorithm consistently results in the fewest page faults compared to LRU and FIFO according to the examples.

Uploaded by

Islah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views

Tutorial 1 Memory

This document contains multiple examples of calculating page faults using different page replacement algorithms including Optimal, LRU, and FIFO. The examples involve computing page faults for programs with various numbers of virtual pages and physical page frames. The optimal algorithm consistently results in the fewest page faults compared to LRU and FIFO according to the examples.

Uploaded by

Islah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Tutorial 1 – Memory

Page Replacement Algorithms

1. A Virtual memory is an economical method of extending the apparent size of the main memory
by augmenting it with disk space. This augmentation can be implemented by using a paging
scheme.

Assume a program with FIVE (5) virtual pages numbered from a to e. A program references
the virtual pages according to this order:
a, b, c, d, c, a, d, b, e, b, a, b, c, d

Compute the number of page faults with THREE (3) page frames. Assume the frames are
empty. Show your work using these replacement policies:

a. Optimal
b. Least Recently Used (LRU)
c. First-In/ First-Out (FIFO)

According to your answer, which policies is the best. Give your evidence.

2. Final Examination 2017/2018…..Sem 1


Virtual memory is an economical method of extending the apparent size of the main memory
by augmenting it with disk space. This augmentation can be implemented by using a paging
scheme.

Assume a computer has FIVE (5) virtual pages numbered from 0 to 4, but only TWO (2) physical
page frames. Initially the frames are empty. A program references the virtual pages according
to this order:
014421411204
Illustrates the above virtual memory mapping scheme, from the virtual pages mapped to the
physical frames, using these replacement policies:
i. Least Recently Used (LRU).
(CO2; PO1 – 5.5 marks)
ii. First-In/ First-Out (FIFO).
(CO2; PO1 – 5.5 marks)

iii. Optimal Page Replacement.


(CO2; PO1 – 5 marks)
3. Final Examination 2010/2011…..Sem 1
Virtual memory is an economical method of extending the apparent size of the main memory by
augmenting it with disk space. These augmentation can be perform by the implementation of either
paging or segmentation scheme.
a. A program with seven (7) virtual pages numbered from 0 to 6 references its pages in the order:

0313236045

Compute the number of page faults with two (2) page frames. Assume the two (2) page frames
are initially empty. Show your work using these replacement policies:
(i) Least Recently Used (LRU)
(ii) First-In/ First-Out (FIFO)
(iii) Optimal Page Replacement
(12 marks)

4. Final Semester 2008/2009….Sem 1


A program with five (5) virtual pages numbered from 0 to 4 references its pages in the order:
012301401234
a. Using FIFO replacement, compute the number of page faults with three (3) page frames.
Assume the three (3) page frames are initially empty. Show your work and also page fault.
b. Using LIFO replacement, compute the number of page faults with three (3) page frames.
Assume the three (3) page frames are initially empty. Show your work and also page fault.
c. Using optimal page replacement, compute the number of page faults with three (3) page
frames. Assume the three (3) page frames are initially empty. Show your work and also page
fault.

5. Final Sem 1…2011/2012


A program with SEVEN (7) virtual pages numbered from 0 to 6 references its pages in this order:
0 313236045
a. Using Least Recently Used (LRU) and Optimal page replacement policies, compute the
number of page faults with TWO (2) page frames. Assume the TWO (2) page frames are
initially empty.

b. Increase the size of memory so it contains THREE (3) page frames. Using the same page
requests as above and FIFO, compute the number of page faults.

You might also like