1. Gyanastra
  2. Operating Systems
  3. Virtual Memory and Page Replacement
  4. Virtual Address Space and Logical Address Space Interchangeability
Free lesson, no account needed 5 min read 8 practice questions after it
Asked in past papers1 time
  • UGC NET2023

Operating Systems · Virtual Memory and Page Replacement

Virtual Address Space and Logical Address Space Interchangeability

Overview

The logical address space is also called the virtual address space, and a logical address is also called a virtual address.
Strictly the terms differ depending on whether the logical address space exceeds the physical address space, but modern systems use them interchangeably.
Main memory is divided into small equal-sized parts called frames, and page size equals frame size.

Key concepts

  • Logical address space = virtual address space: the two names refer to the same thing in modern usage.
  • Logical address = virtual address: the two names refer to the same thing in modern usage.
  • Strict/classical distinction: the term virtual is appropriate only when the logical address space is greater than the physical address space; then the logical address space should be called the virtual address space and the logical address should be called the virtual address.
    This naming is based on whether the program-visible address space exceeds the actual physical memory address space.
  • Modern usage: computers have evolved so much that virtual addresses and virtual address spaces are used everywhere, irrespective of the sizes of the physical address and logical address.
    Because the virtual memory concept is applied everywhere — irrespective of the size of main memory and the size of the process — the two sets of names are used interchangeably.
  • Frame: main memory is divided into many small parts, and each part is called a frame.
  • Page size = frame size: page size and frame size are the same.
Memory diagram: Virtual Address Space and Logical Address Space Interchangeability
Figure. Virtual Address Space and Logical Address Space Interchangeability

How it works

  1. Strictly speaking, the terms should be different; the classical distinction depends on the relative sizes of the logical address space and the physical address space.
  2. Under the strict definition, if the logical address space is greater than the physical address space, it should be called the virtual address space and the logical address should be called the virtual address.
  3. In practice, virtual addresses and virtual address spaces are used everywhere, irrespective of the sizes of the physical address and logical address.
  4. Since virtual memory is applied irrespective of the size of main memory and the size of the process, the two sets of names are used interchangeably.
  5. From this point onward, virtual address space and logical address space mean the same thing, and virtual address and logical address mean the same thing.
  6. After process size and main memory size, the next concept is page size or frame size; page size and frame size are the same.
  7. Main memory is divided into many small parts, each called a frame.

Comparison

TermsCommon modern usageStrict/classical distinction
Logical address space vs virtual address spaceUsed interchangeablyCall it virtual address space when logical address space > physical address space
Logical address vs virtual addressUsed interchangeablyCall it virtual address when logical address space > physical address space
Page size vs frame sizeSame sizePage size = frame size

Revision summary

  • Logical address space = virtual address space; logical address = virtual address.
  • Strictly, the term virtual is appropriate only when the logical address space is larger than the physical address space.
  • In modern systems, virtual memory concepts are applied regardless of main memory size and process size, so both terminologies are treated as identical.
  • The next unit of division after process size and main memory size is the page/frame; page size and frame size are equal.
  • Main memory is divided into small equal-sized parts, each called a frame.

Previous-year exam insights

  • A logical address is generated by the CPU during program execution; the set of all logical addresses generated by a program is its logical address space.
    A physical address is the address actually loaded into the memory-address register (MMU); the set of all physical addresses is the physical address space.
  • The run-time mapping from virtual (logical) addresses to physical addresses is done by the memory-management unit (MMU), typically using a page table; the page-table base register (PTBR) holds the page table's base address and the page-table length register (PTLR) its size.
  • For a logical address of m bits and page size of 2n2^{n} bytes, the high-order (m - n) bits give the page number and the low-order n bits give the page offset; the number of pages in the logical address space is 2m−n2^{m-n} and the number of entries in the page table equals the number of pages.
  • Physical memory is divided into frames of the same size as pages; a frame number needs log⁡2(number of frames)\log_{2}(\text{number of frames}) bits, and the physical address is formed by concatenating the frame number with the same page offset.
  • The page table maps page numbers to frame numbers; the page-table entry also holds control bits such as valid/invalid, protection, reference and dirty (modified) bits, and the page offset is not translated.
  • Paging suffers from internal fragmentation only in the last page of a process (average half a page wasted per process); there is no external fragmentation, but page tables themselves consume extra memory.
Pages 1–2 of 2