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

#1. A process has a memory reference pattern as follows: 1 3 1 2 3 4 2 3 1 2 3 4

ID: 3849849 • Letter: #

Question

#1. A process has a memory reference pattern as follows: 1 3 1 2 3 4 2 3 1 2 3 4

The above pattern (which represents the virtual page numbers of the process) repeats

throughout the execution of the process. Assume that there are 3 physical frames.

Show the paging activity for a True LRU page replacement policy. Show an LRU

stack and the page that is replaced (if any) for the first 12 accesses. Clearly indicate

which accesses are hits and which are page faults.

Solution:

1

3

1

2

3

4

2

3

1

2

3

4

F1

F2

F3

LRU

H/PF

H: hit   PF: Page fault

#2. A process has a memory reference pattern as follows: 4 3 1 2 3 4 1 4 1 2 3 4

The above pattern (which represents the virtual page numbers of the process) repeats

throughout the execution of the process.

What would be the paging activity for an optimal page replacement policy for the first

12 accesses? Indicate which accesses are hits and which are page faults.

Solution:

4

3

1

2

3

4

1

4

1

2

3

4

F1

F2

F3

H/PF

Assume there are only three available physical frames. And H = hit,   PF = Page Fault.

Thanks for the help, please don't giuve half answers and answer both questions!

1

3

1

2

3

4

2

3

1

2

3

4

F1

F2

F3

LRU

H/PF

Explanation / Answer

PAGE FAULT :6

HIT: 6

2.

PAGE FAULT:6

HIT:6

1 3 1 2 3 4 2 3 1 2 3 4 F1 1 1 1 1 1 4 4 4 1 1 1 4 F2 3 3 3 3 3 3 3 3 3 3 3 F3 2 2 2 2 2 2 2 2 2 LRU F F F F F F