A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Virtual Address Translation: Paging and TLBs

College Depth 97 in the knowledge graph I know this Set as goal
2topics build on this
359prerequisites beneath it
See this on the map →
Contiguous Memory Allocation and FragmentationVirtual Memory and PagingPage Fault Handling and Recovery
virtual-memory paging translation

Core Idea

Paging divides virtual and physical spaces into fixed-size pages; a page table maps virtual page numbers to physical frame numbers. Multi-level page tables reduce memory overhead; TLBs (translation lookaside buffers) cache recent translations for hardware-speed lookups.

Explainer

From your study of virtual memory, you know that each process operates in its own virtual address space, isolated from every other process. The question is: how does the hardware convert a virtual address into a physical address in RAM on every single memory access? Paging is the dominant answer. The virtual address space is divided into fixed-size chunks called pages (typically 4 KB), and physical memory is divided into same-sized chunks called frames. A page table — one per process — maps each virtual page number to the physical frame number where that page currently resides.

The translation works by splitting every virtual address into two parts: the virtual page number (VPN) and the offset within the page. The VPN indexes into the page table to find the corresponding physical frame number. The offset stays the same — it tells you where within the page the byte lives. The hardware concatenates the frame number with the offset to produce the physical address. For example, with 4 KB pages (12-bit offset), a virtual address with VPN 5 and offset 200 might map to frame 17, producing physical address (17 × 4096) + 200. This split-and-lookup operation happens on every memory reference your program makes.

The problem with a simple flat page table is size. A 32-bit address space with 4 KB pages has over a million page table entries; a 64-bit space would need an impossibly large table. Multi-level page tables solve this by turning the page table into a tree. The VPN is split into multiple indices — for example, a two-level scheme splits it into a directory index and a table index. The first index finds a page directory entry, which points to a second-level page table, which contains the actual frame mapping. Pages of the page table that correspond to unmapped virtual memory need not exist at all, saving enormous amounts of memory. Modern x86-64 processors use four-level page tables for this reason.

Even with efficient page tables, every memory access would require multiple memory reads just to walk the page table — one read per level. This would make programs several times slower. The Translation Lookaside Buffer (TLB) eliminates this cost for the common case. The TLB is a small, fast hardware cache that stores recent virtual-to-physical translations. On a TLB hit, the translation completes in a single cycle with no page table walk. On a TLB miss, the hardware walks the page table, installs the result in the TLB, and retries. Because programs exhibit strong locality — they access the same pages repeatedly — TLB hit rates typically exceed 99%, making paging nearly free in practice despite the complexity of the translation machinery underneath.

Practice Questions 5 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersIntroduction to ExponentsOrder of OperationsInteger Order of OperationsVariable ExpressionsThe Distributive PropertyVariables and Expressions ReviewIntroduction to PolynomialsAdding and Subtracting PolynomialsMultiplying PolynomialsFactorialPermutationsCombinationsCounting Principles: Addition and Multiplication RulesIntroduction to Graph TheoryPropositional Logic FoundationsLogical EquivalencesBoolean AlgebraBoolean Type and Truth ValuesComparison Operators and Boolean TestsLogical Operators and Boolean AlgebraBoolean Algebra and Fundamental LawsLogic Gates FundamentalsImplementing Boolean Functions with GatesKarnaugh Map SimplificationCombinational Circuit DesignFlip-Flops and LatchesBinary Counters: Design and AnalysisBinary ArithmeticFixed-Point Number RepresentationTwo's Complement RepresentationOverflow and Underflow DetectionBinary Adders: Half-Adders and Full-AddersFull Adder and Carry PropagationCarry Lookahead Adder DesignHalf Adder Circuit DesignMultiplication Circuit DesignSequential Circuit DesignRegisters and Register FilesInstruction Set Architecture (ISA)Assembly Language BasicsMemory Organization and AddressingMemory HierarchyCache Memory DesignCache Replacement PoliciesVirtual Memory and PagingVirtual Address Translation: Paging and TLBs

Longest path: 98 steps · 359 total prerequisite topics

Prerequisites (2)

Leads To (1)