Multilevel Paging in Operating Systems: Address Splits, Page Tables and Solved Numericals
Learn to split virtual addresses, count allocated page-table pages, translate 0x12345ABC, and solve a two-level paging EMAT example step by step.
KnowledgeGate Team
Exam prep & CS education

A multilevel-paging question combines three jobs: find the offset, split the virtual page number across levels, and count only the page-table pages that exist. Mixing these jobs is where simple numericals go wrong. Memory management in OS: paging and segmentation explained covers flat translation and the paging-versus-segmentation distinction. Virtual Memory in Operating Systems: Paging, TLB and Page Replacement with Worked Examples uses 0x12345ABC to connect flat translation with faults and replacement; splitting that address into p1, p2, and offset exposes the multilevel walk, sparse allocation, and two-level TLB miss.
Multilevel paging: why a page table is split
A virtual address contains a virtual page number (VPN) and an offset. The VPN identifies a page, while the offset identifies a byte inside it. A page-table entry (PTE) maps that page to a physical frame and carries control bits such as valid, protection, referenced, or dirty.
Multilevel paging divides only the VPN into indexes such as p1 and p2. The offset is neither split nor changed during translation.
Consider a 32-bit address space with 4 KiB = 2^12 pages. The offset takes 12 bits, leaving 32 - 12 = 20 VPN bits. A single-level table therefore needs 2^20 = 1,048,576 entries. With 4-byte PTEs, it occupies 1,048,576 x 4 = 4,194,304 bytes = 4 MiB per process when most virtual pages are unused.
In a hierarchy, the first-level directory selects a lower-level table, and lower tables are allocated only for present virtual regions. Translation still requires a walk. The GATE CS Exam Preparation path pairs this method with the rest of the operating-systems syllabus.
Multilevel paging bit splits: calculate levels before translating
Start with powers of two. For page size 2^d bytes, the offset has d bits. If a table page is 2^d bytes and each PTE is 2^e bytes, one table holds 2^d / 2^e = 2^(d-e) entries. A full index therefore consumes d-e bits.
The level count is ceil((virtual-address bits - d) / (d-e)). When division is not exact, the top level gets the smaller remaining group.
With page size 4 KiB = 2^12 and PTE size 4 bytes = 2^2. Each table holds 2^(12-2) = 2^10 = 1024 entries. The 32-bit address has 32 - 12 = 20 VPN bits, so its format is:
p1: 10 bits | p2: 10 bits | offset: 12 bits
Each lower table fits in one 4 KiB page.
For a non-even split, take a 41-bit address, 4 KiB pages, and 8-byte PTEs. A table holds 4096 / 8 = 512 = 2^9 entries. The VPN has 41 - 12 = 29 bits, giving ceil(29 / 9) = 4 levels and the split 2 | 9 | 9 | 9 | 12. The top level uses the two remaining VPN bits. Four levels mean four page-table lookups, followed by the data access.
Multilevel paging worked translation: 0x12345ABC step by step
Keep the 32-bit, 4 KiB page, 4-byte PTE model. First write the address in binary:
0x12345ABC = 0001 0010 0011 0100 0101 1010 1011 1100
Now split it into 10 | 10 | 12 bits:
0001001000 | 1101000101 | 101010111100
The last 12 bits, equivalently the last three hexadecimal digits, form the offset. The remaining 20 bits form VPN 0x12345. Dividing that VPN into its high and low 10-bit groups gives 0x12345 >> 10 = 72 and 0x12345 mod 1024 = 837.
The fields are:
p1 = 0001001000 = 72 = 0x048p2 = 1101000101 = 837 = 0x345d = 101010111100 = 2748 = 0xABC
Assume L1[72] is valid and points to a second-level table named PT72. The first lookup selects this table. Assume PT72[837] is valid and contains physical frame number 0x5A3 = 1443. The second lookup selects that frame. Neither lookup modifies the 12-bit offset.
Concatenating the frame with the unchanged offset gives:
frame 0x5A3 | offset 0xABC = physical address 0x5A3ABC
Equivalently, the frame starts at byte address 0x5A3 x 0x1000 = 0x5A3000. Adding offset 0xABC reaches 0x5A3ABC within that frame.
Arithmetic gives the same result:
1443 x 4096 + 2748 = 5,910,528 + 2,748 = 5,913,276
The decimal value of 0x5A3ABC is 5,913,276, so both methods agree. If either L1[72] or PT72[837] were invalid, this mapping could not complete and the architecture's fault handling would take over.

Multilevel page-table memory: count only allocated lower tables
Suppose six mapped virtual pages belong to these (p1, p2) pairs:
p1=2:p2={4, 5, 900}p1=511:p2={0, 1023}p1=900:p2={73}
There are six data-page mappings but only three distinct first-level indexes. The first-level table has 1024 entries of 4 bytes, so it occupies one 4 KiB page. Each populated p1 entry points to a separate second-level table, regardless of how many listed p2 entries it contains. The process therefore needs one first-level table and three second-level tables. Page-table storage is 4 x 4096 = 16,384 bytes = 16 KiB.
The flat alternative occupies 1,048,576 x 4 = 4,194,304 bytes = 4 MiB. The saving is 4,194,304 - 16,384 = 4,177,920 bytes, or about 99.6% for this deliberately sparse process. This comparison excludes the six data pages and implementation metadata.
Now check the boundary case. If all 1024 first-level entries need lower tables, the hierarchy uses 1025 x 4096 = 4,198,400 bytes. That is one 4 KiB page more than the flat table. Multilevel paging saves table memory through sparse allocation, not because every possible mapping is intrinsically smaller.

Multilevel paging with a TLB: count the walk and the data access
Use the timing model stated in the question. With page tables in memory and no TLB, a two-level translation reads one L1 entry, one L2 entry, and then the requested data. That is three memory accesses. On a TLB hit, the cached VPN-to-frame mapping bypasses both table reads, but the data access remains.
Assume a serial TLB lookup, no page fault, 12 ns TLB time, 90 ns memory time, and a 0.93 hit ratio. Then:
Hit time:
12 + 90 = 102 nsMiss time:
12 + 3 x 90 = 282 nsEMAT = 0.93 x 102 + 0.07 x 282EMAT = 94.86 + 19.74 = 114.6 ns
Parallel lookup, cache hits, overlapping work, or a separate miss penalty changes the formula. Page Table Size and EMAT Numericals for GATE owns PTE sizing, level-count, and one-versus-two-level timing drills; the calculation above connects one two-level walk to its access cost.
Multilevel paging exam patterns and common traps
Questions commonly ask for VPN and offset bits, entries and levels, translation, sparse storage, or access counts under stated timings. Each format tests a different stage of the same address-walk model.
Trap | Why it fails | What to do instead |
|---|---|---|
Page size equals entries | Ignores PTE width | Divide by PTE size |
Splitting 32 bits | Includes offset | Split only the VPN |
Changing offset | Moves byte position | Preserve 12 bits |
Six pages, six tables | Pages share | Count |
One PTE, one page | Confuses units | Track entries and bytes |
TLB miss is page fault | PTE may be valid | Walk the table |
Use six steps: write sizes as powers of two; reserve offset bits; find entries and index bits per table; split only the VPN; follow valid entries; compute storage or timing from the stated assumptions.
Before accepting an answer, check 10 + 10 + 12 = 32, 72 < 1024, 837 < 1024, and 0x5A3 x 0x1000 + 0xABC = 0x5A3ABC.
Multilevel paging short version and next step
Keep this decision card beside your rough work:
page size -> offset bits -> entries per table -> index bits -> number of levels -> address split -> walk -> unchanged offset
The worked route is 0x12345ABC -> p1 72 -> p2 837 -> frame 0x5A3 -> physical address 0x5A3ABC.
Now hide the solution and split 0x12345ABC again. Then recalculate table storage for the six pages under p1={2, 511, 900}. You should be able to justify both 16 KiB and the three-access no-TLB walk without memorising the diagrams.
The GATE Test Series is an optional next step for applying this method in timed practice. If multilevel paging is your only focus, rework these two exact examples first. Then change one assumption at a time, such as the PTE size or the number of populated first-level entries, and rebuild the answer from the decision card.
Keep learning
Demand Paging in Operating Systems: Page Faults, Worked Examples and Exam Traps
Learn demand paging through a complete page-fault restart, a FIFO frame trace and effective access time calculations, then test yourself on common conceptual traps.
Virtual Memory in Operating Systems: Paging, TLB and Page Replacement with Worked Examples
Follow one virtual address through the TLB and page table, then calculate page faults, replacement traces and working-set pressure step by step.
Memory Management in Operating Systems: Paging, Virtual Memory and Worked Examples
Connect allocation, paging, segmentation and virtual memory through one address-translation system, two access-time calculations and a full replacement trace.
Virtual Memory and Demand Paging MCQs: 12 solved questions with explanations
Virtual memory and demand paging MCQs for GATE, UGC NET and placement: address translation, page-table size, effective access time, thrashing, frames.





