Consider the page references 7,0,1,2,0,3,0,4,2,3,0,3,2, Find the number of page fault using OPR and  FIFO, with 4 page frame.

  • Answered by Nemi
  • 0 Comments
  • 2 years ago

To calculate the page faults using OPR and FIFO page replacement algorithms, we first need to understand how these algorithms work.

FIFO (First-In-First-Out) algorithm replaces the page that has been in the memory for the longest time. It’s a simple algorithm that keeps track of the order in which pages were loaded into the memory and replaces the oldest page first.

OPR (Optimal Page Replacement) algorithm replaces the page that will not be used for the longest period of time. It’s an optimal algorithm that has the advantage of knowing the future behavior of the program and replacing the page that will not be needed for the longest time.

Let’s consider the given page references and find the number of page faults using FIFO and OPR algorithms, with a 4-page frame:

FIFO Algorithm:

7012030423
7777700111
000011222
11122333
2233444
FFFFFF
032
111
222
333
444
F

Total number of page faults using FIFO algorithm = 7

OPR Algorithm:

7012030423
7777733333
000000444
11111111
2222222
FFFFFF
032
333
444
112
000
FF

Total page faults using OPR algorithm: 8.

Therefore, the number of page faults using FIFO algorithm is 7, and the number of page faults using OPR algorithm is 8.

If you found any type of error on the answer then please mention on the comment or report an answer or submit your new answer.
Leave your Answer:

Click here to submit your answer.

s
Subscribe
Notify of
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments