Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

RAMCO INSTITUTE OF TECHNOLOGY

Department of Information Technology


Academic Year: 2023 - 2024 (Even Semester)

ASSIGNMENT SHEET

Degree, Semester& Branch: IV Semester B.Tech. Information Technology


Course Code & Title: CS3451 & Introduction to Operating Systems
Name(s) of the Faculty Member: Mr. Balaganesh M V, AP / IT

Assignment No: 2

Page replacement :

1. A computer has twenty physical page frames which contain pages numbered 101
through 120. Now a program accesses the pages numbered 1, 2, …, 100 in that order,
and repeats the access sequence THRICE. Which one of the following page
replacement policies experiences the same number of page faults as the optimal page
replacement policy for this program?
a. Least Recently Used
b. First in First out [CO3, L3]

2. A process has been allocated 3 page frames. Assume that none of the pages of the
process are available in the memory initially. The process makes the following
sequence of page references (reference string): 1, 2, 1, 3, 7, 4, 5, 6, 3, 1 If optimal
page replacement policy is used, how many page faults occur for the above reference
string? [CO3, L3]

3. A system uses 3 page frames for storing process pages in main memory. It uses the
First in First out (FIFO) page replacement policy. Assume that all the page frames are
initially empty. What is the total number of page faults that will occur while
processing the page reference string given below
4 , 7, 6, 1, 7, 6, 1, 2, 7, 2
Also calculate the hit ratio and miss ratio. [CO3, L3]

4. Assume that there are 3 page frames which are initially empty. If the page reference
string is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, find the number of page faults using the optimal
replacement policy. [CO3, L3]

5. Consider the page references 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3 with 4 page frame.


Find number of page fault in Optimal page replacement algorithm [CO3, L3]

6. A system uses 3 page frames for storing process pages in main memory. It uses the
Least Recently Used (LRU) page replacement policy. Assume that all the page frames
are initially empty. What is the total number of page faults that will occur while
processing the page reference string given below?
4, 7, 6, 1, 7, 6, 1, 2, 7, 2 [CO3, L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


7. A process has been allocated 4 page frames. Assume that none of the pages of the
process are available in the memory initially. The process makes the following
sequence of page references (reference string): 1, 2, 1, 3, 7, 4, 5, 6, 3, 1 If MRU page
replacement policy is used, how many page faults occur for the above reference
string? [CO3, L3]

8. Consider a main memory with five page frames and the following sequence of page
references: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3. Which one of the following is true
with respect to page replacement policies First-In-First Out (FIFO) and Least
Recently Used (LRU)?
a. Both incur the same number of page faults
b. FIFO incurs 2 more page faults than LRU
c. LRU incurs 2 more page faults than FIFO
d. FIFO incurs 1 more page faults than LRU [CO3, L3]

9. A system uses FIFO policy for page replacement. It has 4 page frames with no pages
loaded to begin with. The system first accesses 100 distinct pages in some order and
then accesses the same 100 pages but now in the reverse order. How many page faults
will occur?

[CO3, L3]

10. Consider page reference string 1, 3, 0, 3, 5, 6, 3 with 3 page frames. Find the number
of page faults in FIFO page replacement algorithm.
[CO3, L3]

11. Consider page reference string 1, 3, 0, 3, 5, 6, 3 with 3 page frames. Find the number
of page faults in MRU page replacement algorithm.
[CO3, L3]

12. Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the
following sequence of memory block requests: 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22,
8, 3, 16, 25, 7 If LRU replacement policy is used, which cache block will have
memory block 7?
[CO3, L3]

13. A system uses 3 page frames for storing process pages in main memory. It uses the
Optimal page replacement policy. Assume that all the page frames are initially empty.
What is the total number of page faults that will occur while processing the page
reference string given below
4 , 7, 6, 1, 7, 6, 1, 2, 7, 2
Also calculate the hit ratio and miss ratio.
[CO3, L3]

14. Consider a paging hardware with a TLB. Assume that the entire page table and all the
pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80
milliseconds to access the physical memory. If the TLB hit ratio is 0.6, find the
effective memory access time (in milliseconds).
[CO3, L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


15. A process has been allocated 3 page frames. Assume that none of the pages of the
process are available in the memory initially. The process makes the following
sequence of page references (reference string): 1, 2, 1, 3, 7, 4, 5, 6, 3, 1 If FIFO page
replacement policy is used, how many page faults occur for the above reference
string?
[CO3, L3]

16. Consider a computer system with ten physical page frames. The system is provided
with an access sequence (a1, a2, …, a20, a1, a2, …, a20), where each ai number.
Determine the difference in the number of page faults between the last-in-first-out
page replacement policy and the optimal page replacement policy.
[CO3, L3]

17. In which one of the following page replacement algorithms it is possible for the page
fault rate to increase even when the number of allocated frames increases?

a. LRU
b. OPT

[CO3, L3]

18. A process has been allocated 3 page frames. Assume that none of the pages of the
process are available in the memory initially. The process makes the following
sequence of page references (reference string): 1, 2, 1, 3, 7, 4, 5, 6, 3, 1. If LRU page
replacement policy is used, how many page faults occur for the above reference
string?
[CO3, L3]

19. Consider a 2-way set associative cache memory with 4 sets and total 8 cache blocks
(0-7) and a main memory with 128 blocks (0-127). What memory blocks will be
present in the cache after the following sequence of memory block references if LRU
policy is used for cache block replacement assuming that initially the cache did not
have any memory block from the current job?
0 5 3 9 7 0 16 55
[CO3, L3]

20. Determine the number of page faults when references to pages occur in order - 1, 2, 4,
5, 2, 1, 2, 4. Assume that the main memory can accommodate 3 pages and the main
memory already has the pages 1 and 2, with page 1 having brought earlier than page
2. (assume LRU algorithm is used)
[CO3, L3]

21. Assume that a main memory with only 4 pages, each of 16 bytes, is initially empty.
The CPU generates the following sequence of virtual addresses and uses the Most
Recently Used (MRU) page replacement policy. 7, 0, 1, 2, 0, 0, 3, 2, 1, 2, 0, 1, 7, 3, 0,
4, 2, 3, 0, 1, 2, 3, 4, 5, 4. How many page faults does this sequence cause?
[CO3, L3]

22. Suppose that the virtual Address space has eight pages and physical memory with four
page frames. If LRU page replacement algorithm is used, how many number of page
faults occur with the reference string. 0, 2, 1, 3, 5, 4, 6, 3, 7, 4, 7, 3, 3, 5, 5, 3, 1, 1, 1,
7, 2, 3, 4, 1. [CO3, L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


23. Consider a virtual page reference string 2, 0, 3, 0, 4, 7, 0, 1, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7,
0, 1 Suppose a demand paged virtual memory system running on a computer system
such that the main memory has 3 page frames. Among Optimal. Detailed presentation
should be given for each algorithm.
[CO3, L3]

24. Consider the page reference string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3 with 4 page


frames. Find number of page faults in LRU Page replacement algorithm. [CO3, L3]

25. A system uses 3 page frames for storing process pages in main memory. It uses the
Least Recently Used (LRU) page replacement policy. Assume that all the page frames
are initially empty. What is the hit and miss ratio?
4, 7, 6, 1, 7, 6, 1, 2, 7, 2
[CO3, L3]

26. Consider the following page reference string. Consider the following page reference
string. 4 2 1 5 7 6 3 2 1 2 3 6 6 1 1 2 3 2 3. Assume three frames and all frames are
initially empty. Find number of page faults in LRU Page replacement algorithm.
[CO3, L3]

27. Consider the following page reference string. Consider the following page reference
string. 1 2 3 4 2 1 3 2 1 2 3 6 5 6 1 2 3 7 6. Assume three frames and all frames are
initially empty. Find number of page faults in LIFO Page replacement algorithm.
[CO3, L3]

28. Consider the following page reference string. Consider the following page reference
string. 5 6 1 2 3 7 6 1 2 3 4 2 1 3 2 1 2 3 6. Assume three frames and all frames are
initially empty. Find number of page faults in Optimal Page replacement algorithm.
[CO3, L3]

29. Consider the following page reference string. Consider the following page reference
string. 5 6 1 1 2 1 2 3 7 6 3 2 2 3 4 1 2 3 6. Assume three frames and all frames are
initially empty. Find number of page faults in FIFO Page replacement algorithm.
[CO3, L3]

30. Consider the following page reference string. Consider the following page reference
string. 2 1 5 6 1 2 3 4 1 2 3 7 6 3 2 1 2 3 6. Assume three frames and all frames are
initially empty. Find number of page faults in Most Recently Used (MRU) Page
replacement algorithm.
[CO3, L3]

31. Consider a virtual page reference string 0, 3, 0, 4, 2, 3, 7, 0, 1, 2, 0, 3, 2, 1, 2, 0, 1, 7,


0, 1 Suppose a demand paged virtual memory system running on a computer system
such that the main memory has 3 page frames. Among FIFO. Detailed presentation
should be given for each algorithm. [CO3, L3]

32. Consider a virtual page reference string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7,


0, 1 Suppose a demand paged virtual memory system running on a computer system
such that the main memory has 4 page frames. Among Most Recently Used (MRU).
Detailed presentation should be given for each algorithm. [CO3, L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


33. A system uses 3 page frames for storing process pages in main memory. It uses the
Most Recently Used (MRU) page replacement policy. Assume that all the page
frames are initially empty. What is the total number of page faults that will occur
while processing the page reference string given below
4 , 7, 6, 1, 7, 6, 1, 2, 7, 2 . Also calculate the hit ratio and miss ratio. [CO3, L3]

34. Consider page reference string 1, 3, 0, 3, 5, 6, 3 with 3 page frames. Find the number
of page faults LIFO page replacement algorithm. [CO3, L3]

35. A system uses 3 page frames for storing process pages in main memory. It uses the
LIFO page replacement policy. Assume that all the page frames are initially empty. What
is the total number of page faults that will occur while processing the page reference
string given below
4 , 7, 6, 1, 7, 6, 1, 2, 7, 2
Also calculate the hit ratio and miss ratio. CO3, L3]

36. Consider a main memory with five page frames and the following sequence of page
references: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3. Which one of the following is true with
respect to page replacement policies Last-In-First Out (LIFO) and Most Recently Used
(LRU)?
a. Both incur the same number of page faults
b. LIFO has more page faults than MRU
c. MRU has more page faults than LIFO
[CO3, L3]

37. A system uses LIFO policy for page replacement. It has 4 page frames with no pages
loaded to begin with. The system first accesses 100 distinct pages in some order and then
accesses the same 100 pages but now in the reverse order. How many page faults will
occur?
[CO3, L3]

38. A system uses MRU policy for page replacement. It has 4 page frames with no pages
loaded to begin with. The system first accesses 100 distinct pages in some order and then
accesses the same 100 pages but now in the reverse order. How many page faults will
occur?
[CO3, L3]

39. Determine the number of page faults when references to pages occur in order - 1, 2, 4,
5, 2, 1, 2, 4. Assume that the main memory can accommodate 3 pages and the main
memory already has the pages 1 and 2, with page 1 having brought earlier than page 2.
(assume MRU algorithm is used)
[CO3, L3]
41. Determine the number of page faults when references to pages occur in order - 1, 2, 4,
5, 2, 1, 2, 4. Assume that the main memory can accommodate 3 pages and the main
memory already has the pages 1 and 2, with page 1 having brought earlier than page 2.
(assume LIFO algorithm is used)
[CO3, L3]

42. Consider a 2-way set associative cache memory with 4 sets and total 8 cache blocks
(0-7) and a main memory with 128 blocks (0-127). What memory blocks will be present
in the cache after the following sequence of memory block references if MRU policy is
used for cache block replacement assuming that initially the cache did not have any

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


memory block from the current job? 0 5 3 9 7 0 1 6 5 5
[CO3, L3]

43. Consider a computer system with ten physical page frames. The system is provided
with an access sequence (a1, a2, …, a20, a1, a2, …, a20), where each ai number.
Determine the difference in the number of page faults between the Most Recently Used
(MRU) replacement policy and the optimal page replacement policy. [CO3, L3]

44. Consider page reference string 1, 3, 0, 3, 5, 6, 3 with 3 page frames. Find the number
of page faults LRU Approximate page replacement algorithm. [CO3, L3]

45. Consider the following page reference string. Consider the following page reference
string. 6 3 2 1 2 3 4 2 1 5 6 1 2 3 7 1 2 3 6. Assume three frames and all frames are
initially empty. Find number of page faults in LRU Approximate Page replacement
algorithm.
[CO3, L3]

46. Determine the number of page faults when references to pages occur in order - 1, 2, 4,
5, 2, 1, 2, 4. Assume that the main memory can accommodate 3 pages and the main
memory already has the pages 1 and 2, with page 1 having brought earlier than page 2.
(assume LRU approximate algorithm is used)
[CO3, L3]

47. Suppose that the virtual Address space has eight pages and physical memory with four
page frames. If LIFO page replacement algorithm is used, how many number of pages
faults occur with the reference string. 1, 1, 1, 7, 2, 7, 3, 3, 5, 5, 3, 3, 4, 1, 0, 2, 1, 3, 5, 4, 6,
3, 7, 4.
[CO3, L3]
48. Suppose that the virtual Address space has eight pages and physical memory with
four page frames. If MRU page replacement algorithm is used, how many number of
pages faults occur with the reference string. 7, 3, 3, 5, 5, 3, 1, 2, 3, 4, 1, 0, 2, 1, 3, 5, 4, 6,
3, 7, 4, 1, 1, 7.
[CO3, L3]

49. Suppose that the virtual Address space has eight pages and physical memory with
three page frames. If LRU page replacement algorithm is used, how many number of
page faults occur with the reference string. 0, 2, 1, 3, 5, 4, 1, 1, 7, 2, 3, 4, 1, 6, 3, 7, 4, 7,
3, 3, 5, 5, 3, 1. [CO3, L3]

50. Consider the following page reference string. Consider the following page reference
string. 6 3 2 1 2 3 6 1 2 3 4 2 1 5 6 1 2 3 7. Assume three frames and all frames are
initially empty. Find number of page faults in LRU Approximate Page replacement
algorithm. [CO3, L3]

51. Consider the following page reference string. Consider the following page reference
string. 5 6 1 6 3 2 1 2 3 6 1 2 3 4 2 1 2 3 7. Assume three frames and all frames are
initially empty. Find number of page faults in MRU Page replacement algorithm.
[CO3, L3]

52. Consider the following page reference string. Consider the following page reference

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


string. 3 6 1 2 3 4 2 6 3 6 1 2 3 7 2 1 2 1 5. Assume three frames and all frames are
initially empty. Find number of page faults in MRU Page replacement algorithm.
[CO3, L3]

53. Consider the following page reference string. Consider the following page reference
string. 3 7 3 6 1 2 3 4 2 6 3 2 1 2 1 5 6 1 2. Assume four frames and all frames are initially
empty. Find number of page faults in LIFO Page replacement algorithm.
[CO3, L3]

55. Consider the following page reference string. Consider the following page reference
string. 2 6 3 2 3 7 3 6 1 2 3 4 1 2 1 5 6 1 2. Assume four frames and all frames are initially
empty. Find number of page faults in LRU Page replacement algorithm.
[CO3, L3]

56. A system uses 3 page frames for storing process pages in main memory. It uses the
LIFO page replacement policy. Assume that all the page frames are initially empty. What
is the total number of page faults that will occur while processing the page reference
string given below 6, 1, 2, 7, 2 , 4 , 7, 6, 1, 7, 5, 4, 3, 4, 2
Also calculate the hit ratio and miss ratio. [CO3, L3]

57. A system uses 3 page frames for storing process pages in main memory. It uses the
MRU page replacement policy. Assume that all the page frames are initially empty. What
is the total number of page faults that will occur while processing the page reference
string given below 1, 7, 5, 4, 3, 6, 1, 2, 7, 2 , 4, 7, 6, 4, 2
Also calculate the hit ratio and miss ratio. [CO3, L3]

58. Consider the page references 3, 0, 4, 2, 3, 0, 7, 0, 1, 2, 0, 3, 2, 3, 7, 6, 7, 1 with 4 page


frame. Find number of page fault in Optimal page replacement algorithm [CO3, L3]

59. Consider the page references 7, 0, 1, 2, 0, 3, 2, 3, 0, 4, 2, 3, 0, 3, 7, 6, 7, 1 with 4 page


frame. Find number of page fault in LIFO page replacement algorithm. [CO3, L3]

CO3: Students will be able to illustrate different page replacement algorithms, virtual memory
and relate various memory management schemes. (20 Marks)

Signature of the Faculty member HOD

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016

You might also like