Question

Consider the following page reference using four physical frames that are initially empty. (a) (5 points)...

Consider the following page reference using four physical frames that are initially empty.

(a) (5 points) Find the page faults using LRU algorithm, where the page reference sequence: 5,2,5,1,4,5,2,0,4,2,3,1,2,1,0,0,2,4,5,1?

(b) (5 points) Find the page faults using FIFO algorithm, where the page reference sequence: 5,2,1,5,1,0,3,1,2,1,4,0,5,4, 2,3,3, 4,2,1?

(c) (5 points) Find the page faults using LRU algorithm, where the page reference sequence: 5, 0, 4, 4, 0, 3, 0, 4, 1, 0, 2, 0, 5, 3, 0, 1?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Consider the following page reference using four physical frames that are initially empty.

(a) Find the page faults using LRU algorithm, where the page reference sequence: 5,2,5,1,4,5,2,0,4,2,3,1,2,1,0,0,2,4,5,1?

ANSWER: (a)

The first row represents the page reference sequence

The cells with bold number denote page fault.

5

2

5

1

4

5

2

0

4

2

3

1

2

1

0

0

2

4

5

1

5

5

5

5

5

5

5

5

5

5

3

3

3

3

3

3

3

4

4

4

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

1

1

1

1

0

0

0

0

1

1

1

1

1

1

1

5

5

4

4

4

4

4

4

4

4

4

4

0

0

0

0

0

1

The number of page faults using LRU = 11

(b) Find the page faults using FIFO algorithm, where the page reference sequence: 5,2,1,5,1,0,3,1,2,1,4,0,5,4, 2,3,3, 4,2,1?

The first row represents the page reference sequence

The cells with bold number denote page fault.

ANSWER: (b)

5

2

1

5

1

0

3

1

2

1

4

0

5

4

2

3

3

4

2

1

5

5

5

5

5

5

3

3

3

3

3

3

3

3

3

3

3

3

3

1

2

2

2

2

2

2

2

2

2

4

4

4

4

4

4

4

4

4

4

1

1

1

1

1

1

1

1

1

1

5

5

5

5

5

5

5

5

0

0

0

0

0

0

0

0

0

2

2

2

2

2

2

The number of page faults using FIFO = 9

(c) Find the page faults using LRU algorithm, where the page reference sequence: 5, 0, 4, 4, 0, 3, 0, 4, 1, 0, 2, 0, 5, 3, 0, 1?

ANSWER: (c)

The first row represents the page reference sequence

The cells with bold number denote page fault.

5

0

4

4

0

3

0

4

1

0

2

0

5

3

0

1

5

5

5

5

5

5

5

5

1

1

1

1

1

3

3

3

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

4

4

4

4

4

4

4

4

4

4

5

5

5

5

3

3

3

3

3

2

2

2

2

2

1

The number of page faults using LRU = 9

Method to find out page fault while using LRU page replacement:

1. For each page request in the reference sequence, check whether it is already there in one of the memory frames,

3. If yes, then continue with other pages in the reference sequence.

4. If no, insert it if there is a page frame available and consider a page fault.

5. If no page frame is available, then replace the least recently used one and consider a page fault.

Method to find out page fault while using FIFO page replacement:

1. For each page request in the reference sequence, check whether it is already there in one of the memory frames,

3. If yes, then continue with other pages in the reference sequence.

4. If no, insert it if there is a page frame available and consider a page fault.

5. If no page frame is available, then replace the first inserted one and consider a page fault.

Add a comment
Know the answer?
Add Answer to:
Consider the following page reference using four physical frames that are initially empty. (a) (5 points)...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT