Consider the page reference string for a memory with 3 frames. Determine the number of page faults using FIFO. optimal and LRU

Consider the page reference string: 1, 0, 7,1,0, 2,1,2,3, 2, 4, 0, 3, 6, 2, 1 for a memory with 3 frames. Determine the number of page faults using FIFO. optimal and LRU

Given page reference string: 1, 0, 7,1,0, 2,1,2,3, 2, 4, 0, 3, 6, 2, 1

Number of memory frames (frames): 3

ii) FIFO Algorithm: In the FIFO algorithm, we replace the page that has fist in to frame.

String1071021232403621
Frame -11111122222444422
Frame -2000001111100001
Frame -377777733333666
Fault (F) / Hit (H)FFFHHFFHFHFFHFFF
FIFO Algorithm

The total number of page faults using the FIFO algorithm is 11.

The total number of page Hits using the FIFO algorithm is 5.

ii) LRU Algorithm: In the LRU algorithm, we replace the page that has not been used for the longest time.

String1071021232403621
Frame -11111111111444666
Frame -2000000033300022
Frame -377722222223331
Fault (F) / Hit (H)FFFHHFHHFHFFFFFF
LRU Algorithm

The total number of page faults using the LRU algorithm is 11.

The total number of page Hits using the LRU algorithm is 5.

iii) Optimal Algorithm: In the Optimal algorithm, we replace the page that will not be used for the longest time in the future. This algorithm requires looking ahead in the page reference string to make replacement decisions.

String1071021232403621
Frame -11111111133333331
Frame -2000000000000000
Frame -377722222444622
Fault (F) / Hit (H)FFFHHFHHFHFHHFFF
Optimal Algorithm

The total number of page faults using the Optimal algorithm is 9.

The total number of page Hits using the Optimal algorithm is 7.

Leave a Reply

Your email address will not be published. Required fields are marked *