2. Demand Paged, Virtual Memory (VM): For a CPU with 14 bit addresses, paged vir
ID: 3775591 • Letter: 2
Question
2. Demand Paged, Virtual Memory (VM):
For a CPU with 14 bit addresses, paged virtual memory is used, there are 4 frames
of real memory, the displacement(offset) part of an address is 8 bits,
and it takes 5 millisecs (5 x 10-3 sec) to read or write a page to the swap flash,
and it takes 20 microsecs (20 x 10-6) to read or write main memory (ignore the time to translate in page table), the current page table contents are:
Page Entry Memory Frame Valid Dirty Clock time page loaded
0 3 0 0 120
1 0 1 0 108
2 1 0 1 100
3 2 1 1 112
(a) How large (bytes) is total, addressable (logical) memory?
(b) How large is a memory frame?
(c) How many entries (maximum) is the page table?
(d) If the hit rate is 95%, what is the average memory access time (with VM)?
(e) One of the page replacement algorithms (policy) is FIFO
(e.1) Briefly (few words), which page would be replaced?
(e.2) when does page replacement happen (in this VM)?
(f) For the following logical (data pointer) addresses, please give the
corresponding physical addresses (if possible):
(f.1) 0 ->__________
(f.2) 105 Hex ->___________________
(f.3) 385 Hex ->____________________
(g) How large (bytes) is total, physical memory?
(h) For each of the following, would this (be expected to) increase or decrease the average memory access time:
(h.1) Change reading swap disk pages to take 6 ms.
(h.2) Change real memory to 16KB.
(h.3) Put page table in real memory.
(i) For page entry 2, the dirty bit is 1. How would that be used?
Explanation / Answer
Answer:
(A) The size of the frame is as same as the size of the page.
Hence the size of a frame is 1024 bytes.
The physical memory is 32MB which is of 225 bytes, the number of frames is 225 / 210 = 215 .
The maximum number of pages that can be present in memory at the same time. The logical address
space is larger than the physical address space.
(C) The virtual address space of 2^32 and each page size is 2^12.
The number of files stored is (2^32/2^12) = 2^20 pages.
The entry given into this page table has an address of size 4 bytes.Hence 2^20*4 = 4MB.
Therefore the page table takes up 4MB in memory.
(E) The one of the most important concept is page replacement. The operating system maintains a list of all pages currently in memory, with the page at the head of the list the oldest one and the page at the upper position is the page which as just logged in. On a page fault, the page at the head is removed and the new page added to the upperl of the list.
FIFO in its pure form is rarely used.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.