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 For FIFO page replacement algorithms with 3 frames, the number of page faults is?a.15b.14c.11d.16
Question
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 For FIFO page replacement algorithms with 3 frames, the number of page faults is?a.15b.14c.11d.16
Solution
Sure, let's go through the FIFO (First-In-First-Out) page replacement algorithm step by step with the given page reference string and 3 frames.
Page reference string: 1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6
-
Start with an empty set of frames: [ - , - , - ]
-
Process each page in the reference string:
- 1: [ 1 , - , - ] (Page fault)
- 2: [ 1 , 2 , - ] (Page fault)
- 3: [ 1 , 2 , 3 ] (Page fault)
- 4: [ 4 , 2 , 3 ] (Page fault, 1 is replaced)
- 2: [ 4 , 2 , 3 ] (No page fault, 2 is already in the frame)
- 1: [ 4 , 1 , 3 ] (Page fault, 2 is replaced)
- 5: [ 4 , 1 , 5 ] (Page fault, 3 is replaced)
- 6: [ 6 , 1 , 5 ] (Page fault, 4 is replaced)
- 2: [ 6 , 2 , 5 ] (Page fault, 1 is replaced)
- 1: [ 6 , 2 , 1 ] (Page fault, 5 is replaced)
- 2: [ 6 , 2 , 1 ] (No page fault, 2 is already in the frame)
- 3: [ 3 , 2 , 1 ] (Page fault, 6 is replaced)
- 7: [ 3 , 7 , 1 ] (Page fault, 2 is replaced)
- 6: [ 3 , 7 , 6 ] (Page fault, 1 is replaced)
- 3: [ 3 , 7 , 6 ] (No page fault, 3 is already in the frame)
- 2: [ 2 , 7 , 6 ] (Page fault, 3 is replaced)
- 1: [ 2 , 1 , 6 ] (Page fault, 7 is replaced)
- 2: [ 2 , 1 , 6 ] (No page fault, 2 is already in the frame)
- 3: [ 2 , 1 , 3 ] (Page fault, 6 is replaced)
- 6: [ 2 , 6 , 3 ] (Page fault, 1 is replaced)
Now, let's count the number of page faults:
- 1 (fault)
- 2 (fault)
- 3 (fault)
- 4 (fault)
- 1 (fault)
- 5 (fault)
- 6 (fault)
- 2 (fault)
- 1 (fault)
- 3 (fault)
- 7 (fault)
- 6 (fault)
- 2 (fault)
- 1 (fault)
- 3 (fault)
- 6 (fault)
Total page faults = 16
So, the correct answer is: d. 16
Similar Questions
For 3 page frames, the following is the reference string: 7 2 3 2 1 3 0 6 2 3 0 4 2 1 3 2 1 7 1 8 How many page faults does the LRU page replacement algorithm produceAnswer( Please choose a correct answer ) CLEAR10151216
The system uses 5 page frames with the page reference string as follows:0,1,2,3,0,1,4,0,1,2,3,7Find the number of page hits in FIFO Replacement Policy.
The sequence of pages which are to be referred by microprocessor is as follows:D,C,B,A,D,C,E,D,C,B,A,BThe number of page faults that will occur in the algorithm LRU with three page frames will beSelect one:a. 9b. 10c. 8d. 7
the page faults.(c) Repeat (b) above for the LRU page replacement algorithm. (d) What would be the lowest number of page faults achievable in this example, assuming an optimal page replacement algorit
Page sequence executed through FIFO is 8, 7, 6, 3, 7, 4, 2, 5, over a memory space. Choose the correct option:7 page faults occur if 5 blocks in memory6 page faults occur if 3 blocks in memory8 page faults occur if 3 blocks in memory9 page faults occur if 5 blocks in memory
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.