GateMCQSCIENTIFIC PREP LAB
PlanSign Up
INTERMEDIATEFrequently Tested 4 min read 22 views

Virtual Memory, Multi-Level Paging & TLB Effective Access Time

Virtual/physical address bit calculations, optimal page size for multi-level page tables, EMAT, and Belady’s anomaly.

Page Replacement Algorithms & Belady’s Anomaly

AlgorithmSuffers from Belady’s Anomaly?Stack Property?Notes
FIFO🚨 YES (e.g. 3 vs 4 frames on 1,2,3,4,1,2,5,1,2,3,4,5)NoOldest loaded page evicted
Optimal (OPT / Belady)NoYesProvably minimum page faults (non-causal benchmark)
LRU (Least Recently Used)NoYesApproximated in hardware using Reference/Clock bit

Interactive 2-Level Paging + TLB Hardware Address Translation Drawing

Operating SystemsSVG Bus Diagram

Virtual Memory TLB + 2-Level Page Table Hardware Schematic

TLB Hit 90% ⇒ EMAT = 130.0 ns
32-BIT VIRTUAL ADDRESSP1(10) | P2(10) | d(12)Associative TLB (10ns)✓ HIT → Frame fOuter PT (L1)+100 ns RAMInner PT (L2)+100 ns RAMPhysical RAMFrame f + d+100 ns Data
Key Formulas Summary
Number of Pages & Frames
#Pages=2VA bitsPage Size,#Frames=2PA bitsPage Size\#\text{Pages} = \frac{2^{\text{VA bits}}}{\text{Page Size}}, \qquad \#\text{Frames} = \frac{2^{\text{PA bits}}}{\text{Page Size}}
Note: Page Offset bits = log_2(Page Size)
TLB Effective Memory Access Time (1-Level Page Table)
EMAT=h(tTLB+tm)+(1−h)(tTLB+2 tm)\text{EMAT} = h(t_{\text{TLB}} + t_m) + (1 - h)(t_{\text{TLB}} + 2\,t_m)
Note: For k-level page table, TLB miss takes (k + 1) memory accesses!
#OS#Paging#Virtual Memory#TLB#NAT

Practice Questions on This Chapter (2)

Q1GATE CS OS TLBNATMEDIUM
+2M • 0 Neg

A paging system uses a single-level page table in main memory (100 ns100\text{ ns} access time) and a TLB (20 ns20\text{ ns} lookup time) with a TLB hit ratio of 80%80\%. Assuming sequential TLB-then-memory lookup, what is the Effective Memory Access Time (EMAT) in nanoseconds?

Q2GATE CS 2023NATMEDIUM
+2M • 0 Neg

A system uses a 2-level hierarchical page table with a TLB. TLB access takes 10 ns10\text{ ns}, main memory access takes 100 ns100\text{ ns}, and the TLB hit ratio is 90%90\%. Assuming zero page faults, what is the Effective Memory Access Time (EMAT) in nanoseconds?

Previous TopicCPU Scheduling, Semaphores & Deadlock Banker’s FormulaNext Topic Page Replacement (FIFO, LRU, Optimal), Unix Inodes & Disk Arm Scheduling