Tutorial 1 Memory
Tutorial 1 Memory
1. A Virtual memory is an economical method of extending the apparent size of the main memory
by augmenting it with disk space. This augmentation can be implemented by using a paging
scheme.
Assume a program with FIVE (5) virtual pages numbered from a to e. A program references
the virtual pages according to this order:
a, b, c, d, c, a, d, b, e, b, a, b, c, d
Compute the number of page faults with THREE (3) page frames. Assume the frames are
empty. Show your work using these replacement policies:
a. Optimal
b. Least Recently Used (LRU)
c. First-In/ First-Out (FIFO)
According to your answer, which policies is the best. Give your evidence.
Assume a computer has FIVE (5) virtual pages numbered from 0 to 4, but only TWO (2) physical
page frames. Initially the frames are empty. A program references the virtual pages according
to this order:
014421411204
Illustrates the above virtual memory mapping scheme, from the virtual pages mapped to the
physical frames, using these replacement policies:
i. Least Recently Used (LRU).
(CO2; PO1 – 5.5 marks)
ii. First-In/ First-Out (FIFO).
(CO2; PO1 – 5.5 marks)
0313236045
Compute the number of page faults with two (2) page frames. Assume the two (2) page frames
are initially empty. Show your work using these replacement policies:
(i) Least Recently Used (LRU)
(ii) First-In/ First-Out (FIFO)
(iii) Optimal Page Replacement
(12 marks)
b. Increase the size of memory so it contains THREE (3) page frames. Using the same page
requests as above and FIFO, compute the number of page faults.