Question

In: Computer Science

Consider the following virtual page reference sequence: page 1, 2, 3, 4, 2, 1, 5, 6,...

Consider the following virtual page reference sequence: page 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3. This indicates that these particular pages need to be accessed by the computer in the order shown. Consider each of the following 4 algorithm-frame combinations:

  • LRU with 3 frames
  • FIFO with 3 frames
  • LRU with 4 frames
  • FIFO with 4 frames

Print a copy of this page. For each of the 4 combinations, below, move from left to right as the virtual page numbers are requested in sequence. Put each virtual page into one of the frames by writing its number there (initially while empty frames remain, load them from top down). When all frames are already occupied by other pages, choose the right page to displace according to the applicable algorithm (LRU or FIFO) and mark the event with an F for Fault. (Do not count a fault when loading a missing page at a time when there is a frame unoccupied, in other words on the first 3 or 4 loads.) When finished, total the number of page faults and write it in where indicated.

Submit the printout. The assignment will be graded on 8 items: the 4 final page configuration figures at the extreme right (correct or incorrect), and the 4 page fault totals written (correct or incorrect). Please work carefully.

THREE Page Frames

Least-recently-used (LRU) method:

1 2 3 4 2 1 5 6 2 1 2 3

Number of page faults for LRU/3:                     

First-in-First-out (FIFO) method:

1 2 3 4 2 1 5 6 2 1 2 3

Number of page faults for FIFO/3:                     

FOUR Page Frames

Least-recently-used (LRU) method:

1 2 3 4 2 1 5 6 2 1 2 3

Number of page faults for LRU/4:                     

First-in-First-out (FIFO) method:

1 2 3 4 2 1 5 6 2 1 2 3

Number of page faults for FIFO/4:                    

Solutions

Expert Solution

Answer:-------------

THREE Page Frames

Least-recently-used (LRU) method:-----------
In the Least Recently Used (LRU) page replacement policy, the page that is used least recently will be replaced

1 2 3 4 2 1 5 6 2 1 2 3
1
1
2
1
2
3
4
2
3
4
2
3
4
2
1
5
2
1
5
6
1
5
6
2
1
6
2
1
6
2
1
3
2
F F F F F F F F F    F

Number of page faults for LRU/3: = 10

First-in-First-out (FIFO) method:------
In this method The oldest page, which has spent the longest time in memory is chosen and replaced.

1 2 3 4 2 1 5 6 2 1 2 3
1
1
2
1
2
3
4
2
3
4
2
3
4
1
3
4
1
5
6
1
5
6
2
5
6
2
1
6
2
1
3
2
1
F F   F F    F   F F   F F    F

Number of page faults for FIFO/3: =  10

FOUR Page Frames:-------------

Least-recently-used (LRU) method:----
In the Least Recently Used (LRU) page replacement policy, the page that is used least recently will be replaced

1 2 3 4 2 1 5 6 2 1 2 3
1
1
2
1
2
3
1
2
3
4
1
2
3
4
1
2
3
4
1
2
5
4
1
2
5
6
1
2
5
6
1
2
5
6
1
2
5
6
1
2
3
6
F   F F F    F F       F

Number of page faults for LRU/4: =   7

First-in-First-out (FIFO) method:---------------
In this method The oldest page, which has spent the longest time in memory is chosen and replaced.

1 2 3 4 2 1 5 6 2 1 2 3
1
1
2
1
2
3
1
2
3
4
1
2
3
4
1
2
3
4
5
2
3
4
5
6
3
4
5
6
2
4
5
6
2
1
5
6
2
1
3
6
2
1
F F F   F    F   F F F    F

Number of page faults for FIFO/4: = 9


Related Solutions

Consider the following page reference string:5, 1, 5, 5, 3, 6, 2, 3, 0 , 7,...
Consider the following page reference string:5, 1, 5, 5, 3, 6, 2, 3, 0 , 7, 2, 5, 2, 1, 7, 2, 3, 1, 4, 6.Assuming demand paging with three frames, how many page faults would occur for the following replacement algorithms?• LRU replacement• FIFO replacement• Optimal replacement
The following page-reference string: 1, 2, 4, 3, 2, 5, 4, 2, 4, 2, 1, 3,...
The following page-reference string: 1, 2, 4, 3, 2, 5, 4, 2, 4, 2, 1, 3, 2, 3, 1, 3, 6, 1, 6, 4. Main memory with 3 frames of 1 kilobyte available and they are all initially empty. Complete a figure, similar to Figure 8.14(in the slides or textbook), showing the frame allocation for each of the following page replacement policies: a. Optimal b. Least recently used c. First-in-first-out Then, find the relative performance of each policy with respect...
Consider the following page reference string: 0, 1, 2, 3, 1, 0, 4, 5, 1, 0,...
Consider the following page reference string: 0, 1, 2, 3, 1, 0, 4, 5, 1, 0, 1, 2, 6, 5, 2, 1, 0, 1, 2, 5 How many page faults would occur for the following replacement algorithms, assuming one, three, five, and seven frames? Remember that all frames are initially empty, so your first unique pages will cost one fault each. Optimal replacement LRU replacement CLOCK replacement FIFO replacement
Consider the following page reference string: 0, 1, 2, 3, 1, 0, 4, 5, 1, 0,...
Consider the following page reference string: 0, 1, 2, 3, 1, 0, 4, 5, 1, 0, 1, 2, 6, 5, 2, 1, 0, 1, 2, 5 How many page faults would occur for the following replacement algorithms, assuming one, three, five, and seven frames? Remember that all frames are initially empty, so your first unique pages will cost one fault each. Optimal replacement LRU replacement CLOCK replacement FIFO replacement
2. Consider the following data: x= 1, 2, 3, 4, 5 y =3, 2, 4, 6,...
2. Consider the following data: x= 1, 2, 3, 4, 5 y =3, 2, 4, 6, 5 By hand, not using Matlab, and showing your work: (a) Compute the correlation coefficient. (b) Find the least-squares line. (c) Find the standard deviation around the least-squares line.
Page Replacement Algorithms. Consider the following page reference stream and 3 page frames: 0 1 2...
Page Replacement Algorithms. Consider the following page reference stream and 3 page frames: 0 1 2 3 2 4 3 1 1 5 2 4 6 3 3 4 6 3 4 7. For the MIN, FIFO, and LRU algorithms, show the contents of the page frame after each reference, and then compute the total number of page faults, divided in to cold misses and other misses.
2. Consider functions f : {1, 2, 3, 4, 5, 6} → {1, 2, 3, 4,...
2. Consider functions f : {1, 2, 3, 4, 5, 6} → {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. (a) How many of these functions are strictly increasing (i.e. f(1) < f(2) < f(3) < f(4) < f(5) < f(6))? Hint: How many different possibilities are there for the range of f? For each range of f, how many strictly increasing functions are there? (b) How many of these functions are non-decreasing (i.e. f(1) ≤ f(2) ≤...
Consider the following data table: x 8 5 4 6 2 5 3 y 1 3...
Consider the following data table: x 8 5 4 6 2 5 3 y 1 3 6 3 7 2 5 (15 points) Create a scatterplot of the data either by hand or with a computer.  Does there appear to be a linear relationship between x and y?  If so, what is the strength and direction of the relationship? (20 points) Give the Simple Linear Regression Model, using x as the predictor variable and y as the response variable.  What is the meaning...
Consider a set A = { 1, 2, 3, 4, 5, 6, 8} Consider these relations,...
Consider a set A = { 1, 2, 3, 4, 5, 6, 8} Consider these relations, 1. R1 = { ( a, b) | a = 3b } Can you write down the pairs ? one such pair is ( 3, 1) 2. R2 = { (a, b) | 2a = b } Can you write down the pairs ? one such pair is (2, 4) 3. R3 = { ( a, b) | a >= 2b } Can you...
Consider the following pairs of observations.X 1 4 3 5 7 2 6 20
Consider the following pairs of observations. X 1 4 3 5 7 2 6 20 Y 3 12 10 12 19    7 17   60 A) Calculate the least squares line. B) Determine a 95% confidence interval for the mean value of Y using X = 6 C) Determine a 95% prediction interval for the Y value using X = 6
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT