GATE / CS ARCHIVE

GATE CSE 1999 / QUESTION 19(a)

Size a one-page segment page table

Operating Systems · Virtual Memory & Paging · Full GATE CSE 1999 paper

GATE 1999, Q19(a) 2 marks · Descriptive
Report issue

Virtual Memory & Paging

Question 19(a), GATE 1999: A byte-addressed segmented-paging system has 2^16 bytes in each of its virtual and physical address spaces, divided into 8 equal virtual segments. The hardware segment table points to each segment’s page table in main memory. Each page-table entry is 2 bytes. GateForum visibly prints 2^16; GFG loses exponent formatting and appears as 216. Find the smallest power-of-two page size for which one segment’s page table occupies at most one page.
Question 19(a), GATE 1999: A byte-addressed segmented-paging system has 2^16 bytes in each of its virtual and physical address spaces, divided into 8 equal virtual segments. The hardware segment table points to each segment’s page table in main memory. Each page-table entry is 2 bytes. GateForum visibly prints 2^16; GFG loses exponent formatting and appears as 216. Find the smallest power-of-two page size for which one segment’s page table occupies at most one page.
Question 19(a), GATE 1999: A byte-addressed segmented-paging system has 2^16 bytes in each of its virtual and physical address spaces, divided into 8 equal virtual segments. The hardware segment table points to each segment’s page table in main memory. Each page-table entry is 2 bytes. GateForum visibly prints 2^16; GFG loses exponent formatting and appears as 216. Find the smallest power-of-two page size for which one segment’s page table occupies at most one page.
Tap to enlarge
Answer & solution

Answer: 128 bytes (no official key was published)

The eight segments need 3 segment-number bits, leaving 13 bits of segment offset. Each segment therefore contains 216/8=213=8192 bytes. If page size is P=2p bytes, the segment contains 8192/P pages and needs that many page-table entries. At 2 bytes each, its table occupies 16384/P bytes. The one-page requirement is 16384/P≤P, or P²≥16384=214. Thus p≥7 and the smallest allowed power of two is P=128. Verification: 8192/128=64 entries occupy 128 bytes exactly. The preceding power of two, 64 bytes, would need 128 entries or 256 bytes, exceeding one page. The hardware segment table does not add to the per-segment page-table storage being bounded.

Original paper, page 8