Virtual Memory & Paging

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.


