GATE / CS ARCHIVE

GATE CSE 2025 SET 2 / QUESTION 58

GATE CSE 2025 Set 2 Q58

Operating Systems · Virtual Memory & Paging · Full GATE CSE 2025 Set 2 paper

GATE 2025 Set 2, Q58 2 marks · NAT
Report issue

Virtual Memory & Paging

Question 58, GATE 2025: A byte-addressable logical space has 2^32 bytes and uses two-level paging with 4096-byte pages. Each inner-page-table entry takes 8 bytes, and an inner table occupies one page. An address contains b outer-index bits, an inner-table entry index, and a data-page offset. Find b.
Tap to enlarge
Answer & solution

Official answer: 11

A 4096-byte data page needs log2(4096)=12 offset bits. An inner page table stored in one 4096-byte page holds 4096/8=512=29 entries. Selecting one of those entries therefore needs 9 bits.

The complete logical address has 32 bits, so the remaining outer index has b=32−12−9=11 bits. As a coverage check, each inner table maps 512 data pages, or 512·4096=221 bytes. A 232-byte space therefore needs 232−21=211 such inner-table slots in its outer table.

Do not allocate 12 independent address bits to the inner entry index just because an inner-table page is 4096 bytes. Entries are 8 bytes each; their byte offsets are aligned, leaving only 9 independent selection bits. The question does not require the entire outer table to fit a single page. Answer: 11.

Original paper, page 44 · Answer key