GATE GUIDE

Paging and TLB Questions in GATE CSE: Levels, Bits and EAT

By MD ANISH AHAMADUpdated 1 Nov 20268 min read
Paging and TLB Questions in GATE CSE: Levels, Bits and EAT

Paging questions in GATE CSE come in a small number of fixed shapes. You are given a virtual address size, a page size, a page-table entry size and sometimes a TLB, and asked for the size of the page table, the number of levels, the bits in each index field, the memory a sparse process really uses for its tables, or the effective access time. The arithmetic is powers of two. Marks are lost on bytes versus bits, on the outer table nobody counted, and on walking a three-level table once instead of three times.

In this guide
  1. Key takeaways
  2. Where paging sits in the paper
  3. The formulas you actually use
  4. A multi-level question, worked end to end
  5. Effective access time with a TLB
  6. TLB reach and page size
  7. Inverted and hashed page tables
  8. The traps in one list
  9. How to practise

Key takeaways

Where paging sits in the paper

The official 2027 CS syllabus lists "Memory management and virtual memory" in the Operating System section, unchanged from 2026. Third-party analyst compilations put Operating System at 5 to 16 marks per paper from 2009 to 2026, with a tight band of about 6 to 10 marks since 2018 and an overall average near 8.8. These figures are unofficial, analysts differ by 2 to 3 marks on borderline questions, and you should check the current notification for the pattern of your year.

Inside that block, paging arithmetic is the most dependable item. The book's own eight-factor scoring, which is the author's judgement rather than a measured probability, rates paging arithmetic and multi-level page tables at 90.5 (Very High) and TLB effective access time at 77.0 (High). The approximate PYQ reconstruction lists multi-level paging items in 2003, 2008 and roughly every other year up to 2026, and reports that 2024 to 2026 papers tended to combine multi-level paging with a TLB in one numerical answer question. The subject-level ranking is in the Operating Systems important topics guide.

The formulas you actually use

Quantity Formula Typical trap
Offset bits log⁡2(page size in bytes)\log_2(\text{page size in bytes}) Page size given in KB, forgetting 1 KB=2101\ \text{KB} = 2^{10}
Number of pages 2v−o2^{v-o} for vv virtual bits, oo offset bits Using physical bits instead of virtual
Number of frames physical memorypage size\displaystyle \frac{\text{physical memory}}{\text{page size}} Using virtual size here
Single-level table size pages×PTE size\text{pages} \times \text{PTE size} PTE given in bits, answer wanted in bytes
Entries per table page page sizePTE size\displaystyle \frac{\text{page size}}{\text{PTE size}} Mixing up entries and bytes
Levels ⌈v−obits per level⌉\displaystyle \left\lceil \frac{v-o}{\text{bits per level}} \right\rceil Not rounding up when bits do not divide evenly
TLB reach TLB entries×page size\text{TLB entries} \times \text{page size} Multiplying by PTE size instead
Inverted table size frames×entry size\text{frames} \times \text{entry size} Sizing it by virtual memory

A plain translation is the cheapest 1-mark form. With 4 KB pages, the low 12 bits are the offset. Virtual address 0x3A7F2 splits into page 0x3A and offset 0x7F2. If page 0x3A maps to frame 0x15, the physical address is the frame number followed by the same offset, 0x157F2. The offset never changes during translation.

A multi-level question, worked end to end

Take a 39-bit virtual address, 4 KB pages and 8-byte page-table entries, with 16 GB of physical memory.

Offset bits=log⁡2(4 KB)=log⁡2212=12Page-number bits=39−12=27Frames=234212=222  ⇒  22-bit frame numberSingle-level table=227 entries×8 B=230 B=1 GB per processEntries per table page=40968=512=29  ⇒  9 bits per levelLevels=279=3 exactly\begin{aligned} \text{Offset bits} &= \log_2(4\ \text{KB}) = \log_2 2^{12} = 12 \\ \text{Page-number bits} &= 39 - 12 = 27 \\ \text{Frames} &= \frac{2^{34}}{2^{12}} = 2^{22} \;\Rightarrow\; 22\text{-bit frame number} \\ \text{Single-level table} &= 2^{27}\ \text{entries} \times 8\ \text{B} = 2^{30}\ \text{B} = 1\ \text{GB per process} \\ \text{Entries per table page} &= \frac{4096}{8} = 512 = 2^{9} \;\Rightarrow\; 9\ \text{bits per level} \\ \text{Levels} &= \frac{27}{9} = 3\ \text{exactly} \end{aligned}

An 8-byte entry has room for the 22-bit frame number plus the valid, dirty and protection flags. The 1 GB flat table is why nobody uses one level here.

The address split is therefore 9 | 9 | 9 | 12: three index fields of 9 bits and a 12-bit offset. Had the page-number bits been 28, you would need ⌈28/9⌉=4\left\lceil 28/9 \right\rceil = 4 levels, with the outermost level using only 1 bit. Setters ask for the outer level's size precisely because candidates assume every level is equal.

Memory actually used by a sparse process

Now let the process use only the bottom 6 MB of its address space for code and data and the top 2 MB for its stack. Work out what one table at each level covers.

Innermost table maps=512 pages×4 KB=2 MBMiddle table maps=512×2 MB=1 GBTop table maps=512×1 GB=512 GB=239 B, the whole space\begin{aligned} \text{Innermost table maps} &= 512\ \text{pages} \times 4\ \text{KB} = 2\ \text{MB} \\ \text{Middle table maps} &= 512 \times 2\ \text{MB} = 1\ \text{GB} \\ \text{Top table maps} &= 512 \times 1\ \text{GB} = 512\ \text{GB} = 2^{39}\ \text{B, the whole space} \end{aligned}

The bottom 6 MB needs 3 innermost tables, all under one middle table. The top 2 MB needs 1 innermost table under a different middle table, since it lies in the last gigabyte. Add the single top-level table.

Total=(1+2+4) table pages×4 KB=7×4 KB=28 KB\text{Total} = (1 + 2 + 4)\ \text{table pages} \times 4\ \text{KB} = 7 \times 4\ \text{KB} = 28\ \text{KB}

That is against 1 GB for a flat table. Two rules carry the marks: the outer table always costs a full page, and an inner table that is only partly used still costs a full page.

Effective access time with a TLB

The structure never changes. On a TLB hit you pay the TLB lookup and one memory access. On a miss you pay the TLB lookup, LL accesses to walk an LL-level table, and the data access. Weight the two by the hit ratio hh. For a serial lookup:

EAT=h (tTLB+tmem)+(1−h) (tTLB+(L+1) tmem)\text{EAT} = h\,(t_{\text{TLB}} + t_{\text{mem}}) + (1-h)\,\big(t_{\text{TLB}} + (L+1)\,t_{\text{mem}}\big)

Use tTLB=5 nst_{\text{TLB}} = 5\ \text{ns}, tmem=80 nst_{\text{mem}} = 80\ \text{ns} and h=0.9h = 0.9, with no page faults.

Setup Hit cost Miss cost EAT
One-level table, serial lookup 5+80=855 + 80 = 85 5+2×80=1655 + 2 \times 80 = 165 0.9×85+0.1×165=93 ns0.9 \times 85 + 0.1 \times 165 = 93\ \text{ns}
Three-level table, serial lookup 8585 5+4×80=3255 + 4 \times 80 = 325 0.9×85+0.1×325=109 ns0.9 \times 85 + 0.1 \times 325 = 109\ \text{ns}
Three-level table, overlapped lookup 8080 325325 0.9×80+0.1×325=104.5 ns0.9 \times 80 + 0.1 \times 325 = 104.5\ \text{ns}

In the overlapped case the TLB search runs alongside the memory access, so a hit costs only tmemt_{\text{mem}}, while a miss still pays for the failed search before the walk begins. The question states which model it means, so underline that line before you start.

The reverse form asks for the minimum hit ratio that meets a target. For the three-level serial case and a target of 100 ns:

85h+325(1−h)=100325−240h=100h=225240=0.9375\begin{aligned} 85h + 325(1-h) &= 100 \\ 325 - 240h &= 100 \\ h &= \frac{225}{240} = 0.9375 \end{aligned}

Notice how expensive misses become as levels are added. The one-level table already beats 100 ns at h=0.9h = 0.9, while the three-level table needs almost 94 percent hits.

This is the same weighted-average idea as cache access time in COA, and it is worth preparing once in both vocabularies alongside the cache memory question patterns. If a page-fault rate is added, the fault service time enters as a third branch; the demand-paging version and the replacement traces that produce the fault count are covered in the guide to page replacement questions.

TLB reach and page size

TLB reach is the memory the TLB can map without a miss: entries×page size\text{entries} \times \text{page size}. A 64-entry TLB with 4 KB pages reaches 64×4 KB=256 KB64 \times 4\ \text{KB} = 256\ \text{KB}. With 2 MB pages the same 64 entries reach 64×2 MB=128 MB64 \times 2\ \text{MB} = 128\ \text{MB}. Larger pages raise the reach and shorten the page table, at the cost of more internal fragmentation, since the last page of each region is on average half wasted. That trade is a favourite 1-mark conceptual MCQ.

Inverted and hashed page tables

An inverted page table keeps one entry per physical frame for the whole system, and each entry stores the owning process id and the virtual page number. With 16 GB of memory and 4 KB frames there are 2222^{22} entries; at 8 bytes each the table is 222×8 B=225 B=32 MB2^{22} \times 8\ \text{B} = 2^{25}\ \text{B} = 32\ \text{MB}, however many processes are running. Compare that with 1 GB per process for the flat table above.

The price is lookup. You cannot index by page number, so the table is searched or, in practice, accessed through a hash on (process id, page number). Sharing a frame between processes is also awkward, since each frame records one owner. Analyst reconstructions show these as periodic, mostly 1-mark items with a falling trend, so learn the size rule and the two drawbacks and move on.

The traps in one list

The cross-subject version is in common mistakes that cost marks in GATE CSE, and every formula above belongs on your formula sheet.

How to practise

Fix one configuration, such as a 32-bit or 39-bit address with 4 KB pages and 4-byte or 8-byte entries, and derive everything from it by hand: offset, pages, frames, flat table size, levels, bit split. Then change one parameter at a time, the page size, the PTE size, the address width, and watch which answers move. For EAT, write the hit and miss costs as separate lines before combining them, and redo each problem in both serial and overlapped form.

The Operating System chapter of the GATE CSE 2027 book works through the full set of paging patterns, including sparse layouts with several regions and combined TLB and page-fault questions, with the PYQ years for each pattern listed alongside.

Frequently asked questions

How do you calculate the number of levels in multilevel paging?

Divide the page size by the page-table entry size to get entries per page-table page, and take log⁡2\log_2 of that to get the index bits one level can resolve. Subtract the offset bits from the virtual address bits to get the page-number bits. The number of levels is ⌈page-number bitsbits per level⌉\displaystyle \left\lceil \frac{\text{page-number bits}}{\text{bits per level}} \right\rceil, so that every table fits in exactly one page.

How many memory accesses happen on a TLB miss with a multilevel page table?

With an LL-level page table and no page fault, a TLB miss costs LL memory accesses to walk the tables plus one more access for the data itself, so L+1L + 1 in total. A TLB hit costs only the single data access. Counting the walk once instead of LL times is the most common error in two-level and three-level questions.

What is TLB reach?

TLB reach is the amount of memory the TLB can map at once, equal to the number of TLB entries multiplied by the page size. A 64-entry TLB with 4 KB pages reaches 256 KB. Using larger pages raises the reach without adding entries, which is why huge pages reduce TLB misses for programs with large working sets.

Why is an inverted page table smaller than a normal page table?

A normal page table has one entry per virtual page of each process, so its size follows the virtual address space. An inverted page table has one entry per physical frame for the whole system, so its size follows physical memory. Each entry must store the process id and page number, and lookup needs a search or a hash instead of direct indexing.

Is paging asked every year in GATE CSE?

The analyst reconstruction used in this guide lists multi-level paging items across many papers from 2003 to 2026 and TLB effective access time items in most years, and the reported 2026 operating system topics included multi-level paging with a TLB. The record is approximate and unofficial, so treat paging as a high priority topic without assuming any particular question.

Sources

Dates, fees and the syllabus are set by the GATE 2027 organising institute and can change. Always confirm at gate2027.iitm.ac.in.

Keep reading

GATE CSE 2027 book1,020 pages · ₹250 ₹300
Buy now — ₹250