Page Tables and Single-Level Paging

Last Updated : 3 Dec, 2026

A page table translates the virtual addresses used by a program into physical addresses in RAM.

  • The OS maintains a page table for each process, and the Memory Management Unit (MMU) uses it to perform address translation automatically.
  • The page number of a virtual address indexes the table, and each entry, called a Page Table Entry (PTE), stores the mapping to a physical frame.
bit_positions_32
Single Level Paging

Page Table Structure

The structure of the page table defines how virtual addresses are mapped to physical memory.

  • Stored in Main Memory: Page tables can become very large, so they are kept in RAM. This adds a slight delay to address translation, but the OS can access and update the table easily.
  • Managed by the OS: The OS creates, maintains and updates the page tables. Each process has its own table, which isolates memory so that one process cannot access another's.
  • Located Using the PTBR: The Page Table Base Register (PTBR) is a CPU register that stores the starting physical address of the current process's page table. It is updated on every context switch.

Page Table Entry (PTE)

Each PTE holds the information needed to translate and manage a page. The layout varies by architecture, and a typical 32-bit PTE is shown below.

bit_positions_33
32-bit PTE
  • Frame Number: Gives the physical frame in which the page resides. The number of bits needed is Frame bits = log₂(Size of Physical Memory / Frame Size).
  • Present / Absent Bit (P): 1 means the page is in RAM, and 0 means it is on disk, so accessing it causes a page fault. This supports demand paging, where pages are loaded only when needed.
  • Dirty Bit (D): Set to 1 when the page is modified after loading, so that only modified pages are written back to disk.
  • Reference Bit (A): Set whenever the page is read or written. Page replacement algorithms such as LRU use it to track which pages are in active use.
  • Protection Bits: R, W and X give read, write and execute permission, which protects memory from unauthorized access.
  • Caching Bit (C): Decides whether the page can be cached. It is useful for memory-mapped I/O, where fresh data from the hardware is needed instead of cached values.

Address Translation

In single-level paging, a virtual address is divided into two parts.

FieldDescription
Page Number (p)Indexes the page table to find the frame number
Page Offset (d)Gives the exact location within the page or frame

The steps of translation are:

  1. The MMU extracts the page number from the virtual address.
  2. It looks up the corresponding frame number in the page table.
  3. The frame number is combined with the page offset to form the physical address.

Page Table Size Calculation

Consider a 32-bit virtual address space with 4 KB pages.

  • Number of pages: 2³² / 2¹² = 220, which is about 1 million pages per process.
  • Page table size: With 4 bytes per PTE, the size is 220 × 4 bytes = 4 MB per process.

This large requirement is the main limitation of single-level paging, and it led to multi-level paging in modern 64-bit systems.

Overhead of Single-Level Paging

  • Memory Use: The entire page table must stay in memory, which takes a large space for each process.
  • Two Memory Accesses: Each data reference needs one access for the page table lookup and another for the data, which Translation Lookaside Buffers (TLBs) partly solve.
  • Contiguous Space: The page table needs a large contiguous block, which is inefficient for sparse address spaces.
Comment

Explore