Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume a main memory with four page frames (frame A through frame D). Assume tha

ID: 3589828 • Letter: A

Question

Assume a main memory with four page frames (frame A through frame D). Assume that the sequence of pages requested by a process is as shown below. 4, 1, 7, 10, 8, 4, 8, 7, 1, 4, 7, 10, 4, 8, 4, 1, 7, 10 For each reference in the above sequence, identify whether it will cause a page fault (F) or will result in a page hit (H), when using the page replacement algorithm specified in the sub-questions. For each sub-question, use the table provided for your solutions – use the Status column to indicate F or H and the Page Frame column to indicate into which page frame the page has been loaded. Assume that all page frames are initially empty.

Given the above information, complete the table presuming the we are using a Least Recently Used or LRU page replacement policy:

Page Status Page Frame 4                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       1                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       7                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       10                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       8                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       4                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       8                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       7                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       1                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       4                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       7                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       10                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       4                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       8                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       4                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       1                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       7                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]       10                            [ Select ]                       ["H", "F"]                                  [ Select ]                       ["A", "B", "C", "D"]      

Explanation / Answer

Page

Status

(Replaced frames)          Page Frame

4

[ F ]                       ["H", "F"]      

         [ A ]                       ["4", "-", "-", "-"]      

1

[ F ]                       ["H","F"]      

         [ B]                       ["4", "1", "-", "-”]      

7

[ F ]                       ["H", "F"]      

         [ C]                       ["4", "1", "7", "-"]      

10

[ F ]                       ["H", "F"]      

         [ D]                       ["4", "1", "7", "10"]      

8

[ F ]                       ["H", "F"]      

         [ A ]                       ["8", "1", "7", "10"]      

4

[ F ]                       ["H", "F"]      

         [ B]                       ["8", "4", "7", "10"]      

8

[ H ]                       ["H", "F"]      

         [ - ]                       ["8", "4", "7", "10"]      

7

[ H ]                       ["H", "F"]      

      [ - ]                       ["8", "4", "7", "10"]      

1

[ F ]                       ["H", "F"]      

      [ C ]                       ["8", "4", "1", "10"]      

4

[ H ]                       ["H", "F"]      

      [ - ]                       ["8", "4", "1", "10"]      

7

[ H ]                       ["H", "F"]      

       [ D ]                       ["8", "4", "1", "7"]      

10

[ F ]                       ["H", "F"]      

       [ A]                       ["10", "4", "1", "7"]      

4

[ H ]                       ["H", "F"]      

       [ - ]                         ["10", "4", "1", "7"]        

8

[ F ]                       ["H", "F"]      

      [ B ]                       ["10", "8", "1", "7"]      

4

[ F ]                       ["H", "F"]      

       [ C ]                       ["10", "8", "4", "7"]      

1

[ F ]                       ["H", "F"]      

       [ D ]                       ["10", "8", "4", "1"]      

7

[ F ]                       ["H", "F"]      

      [ A ]                      ["7", "8", "4", "1"]     

10

[ F ]                       ["H", "F"]      

      [ B]                       ["7", "10", "4", "1"]      

Least recently used algorithm tells replaced the page which is old enough to be replaced, which is not recently referenced.
By following that we fill the page frames with 4,1 ,7, 10 then 8 comes so if we see in the table 4 was the oldest one in the table so it will be replaced by 8.
Next page request is for 4 comes which is not there the table so next old frame in the table is 1 which is now replaced by 4. So if a page is not there in the table we call it a page fault.

Now next page request is for 8 comes and it is there in the table so it is a page hit.
similarly we can fill the above table.

Page

Status

(Replaced frames)          Page Frame

4

[ F ]                       ["H", "F"]      

         [ A ]                       ["4", "-", "-", "-"]      

1

[ F ]                       ["H","F"]      

         [ B]                       ["4", "1", "-", "-”]      

7

[ F ]                       ["H", "F"]      

         [ C]                       ["4", "1", "7", "-"]      

10

[ F ]                       ["H", "F"]      

         [ D]                       ["4", "1", "7", "10"]      

8

[ F ]                       ["H", "F"]      

         [ A ]                       ["8", "1", "7", "10"]      

4

[ F ]                       ["H", "F"]      

         [ B]                       ["8", "4", "7", "10"]      

8

[ H ]                       ["H", "F"]      

         [ - ]                       ["8", "4", "7", "10"]      

7

[ H ]                       ["H", "F"]      

      [ - ]                       ["8", "4", "7", "10"]      

1

[ F ]                       ["H", "F"]      

      [ C ]                       ["8", "4", "1", "10"]      

4

[ H ]                       ["H", "F"]      

      [ - ]                       ["8", "4", "1", "10"]      

7

[ H ]                       ["H", "F"]      

       [ D ]                       ["8", "4", "1", "7"]      

10

[ F ]                       ["H", "F"]      

       [ A]                       ["10", "4", "1", "7"]      

4

[ H ]                       ["H", "F"]      

       [ - ]                         ["10", "4", "1", "7"]        

8

[ F ]                       ["H", "F"]      

      [ B ]                       ["10", "8", "1", "7"]      

4

[ F ]                       ["H", "F"]      

       [ C ]                       ["10", "8", "4", "7"]      

1

[ F ]                       ["H", "F"]      

       [ D ]                       ["10", "8", "4", "1"]      

7

[ F ]                       ["H", "F"]      

      [ A ]                      ["7", "8", "4", "1"]     

10

[ F ]                       ["H", "F"]      

      [ B]                       ["7", "10", "4", "1"]      

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote