Tarlac State University
COLLEGE OF COMPUTER STUDIES
OSA – Page Replacement Algorithm
Read the instructions before you start the exam.
All final answers should be in ink. Multiple answers will not be checked. Cross out all scratch work.
Only questions pertaining to typographical errors will be entertained.
Borrowing of writing materials, etc is considered as cheating.
During the duration of the exam, communication of any form with anybody other than the instructor is considered an act of
cheating.
Any attempt to cheat is punishable with a grade of 5.0 for the course
Test I - Problem Solving (60 points)
A} Consider the following page reference string
1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6
LRU
How many page faults would occur for the 1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6
following replacement algorithms, assuming
one, two, three, or even four frames?
Remember that all frames are initially empty, so
your first unique pages will all cost one fault
each. (3 pts each)
FIFO
1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6
LRU
1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3
FIFO Optimal
1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6
Optimal
1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3
2 Page Frames # Page faults
LRU replacement
FIFO replacement
1 Page Frame # Page faults Optimal replacement
LRU replacement
FIFO replacement
Optimal replacement
NAME :
STUDENT TEST SCORE
Year & Section :
INSTRUCTOR /PROFESSOR
Date : (sign if permit is presented)
Tarlac State University
COLLEGE OF COMPUTER STUDIES
OSA – Page Replacement Algorithm
LRU
LRU 1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6
1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3
FIFO FIFO
1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6
Optimal Optimal
1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6
3 Page Frames # Page faults
LRU replacement
FIFO replacement 4 Page Frames # Page faults
Optimal replacement LRU replacement
FIFO replacement
Optimal replacement
-- Nothing Follows --
NAME :
STUDENT TEST SCORE
Year & Section :
INSTRUCTOR /PROFESSOR
Date : (sign if permit is presented)