Virtual Memory & Paging
![Question 7(ii), GATE 1996: A demand-paged system has 16-bit virtual addresses, 256-byte pages, 1 KiB physical memory, and LRU order [17,1,63] from least to most recent. Process hexadecimal addresses 00FF,010D,10FF,11B0 in order. Only three initial residents are listed, so assume the fourth frame is free. Identify the accesses causing page faults.](../../assets/questions/CS-1996-Q61-1.webp)
![Question 7(ii), GATE 1996: A demand-paged system has 16-bit virtual addresses, 256-byte pages, 1 KiB physical memory, and LRU order [17,1,63] from least to most recent. Process hexadecimal addresses 00FF,010D,10FF,11B0 in order. Only three initial residents are listed, so assume the fourth frame is free. Identify the accesses causing page faults.](../../assets/questions/CS-1996-Q61-2.webp)
Answer & solution
Answer: Faults at 00FF,10FF,11B0; 010D is a hit. (no official key was published)
The offset occupies eight bits because a page has 28 bytes. Discard the low two hexadecimal digits to obtain decimal page references 0,1,16,17. Physical memory holds 1024/256=4 pages.
At 00FF, page 0 is absent: fault, load into the free frame, order [17,1,63,0]. At 010D, page 1 is present: hit, remove it from its old LRU position and append it, order [17,63,0,1]. At 10FF, page 16 is absent and memory is full: evict 17, append 16, order [63,0,1,16]. At 11B0, page 17 is absent because the previous reference evicted it: evict 63, append 17, order [0,1,16,17].
A page fault need not cause a replacement when a free frame exists; this distinction matters for the first reference. The initial figure shows three residents despite four-frame capacity. If an unprinted fourth resident was intended instead, its identity and recency are necessary for a unique trace. We do not invent that page or silently change memory capacity to three frames.