What is the difference between logical and physical addressing?

What is addressing?

In one instant, our device's Operating System (OS) can switch back and forth between processes and handle their operations. So, they seem to progress concurrently.

Each process has a unique set of instructions that is accordingly referenced and stored in the physical memory The RAM of the computer that stores program instructionsspace.

It is essential to understand each process possesses an individual physical memory space that is referenced from 0 to a certain upper limit of addressing capacity. However, each process concretely shares the same physical memory that is uniquely segmented.

It is precisely this segmentation of physical memory that causes each program to possess a unique memory space. We term this impression address virtualization.

The large discretion between logical/virtual addressing, and physical addressing enables enable virtualization.

Logical addressing

Logical addressing is the simplified memory visualization from the perspective of the executing program.

The executing program perceives the addresses to be referenced from 00to a certain upper limit.

Note: The OS determines the amount of space that is to be allotted for each program. It allots space considering some buffer between the spaces of different programs, the computer's total main memory capacity, and the program's memory requirements.

The example shown below shows the virtual memory view of two different concurrent programs that are each allotted a maximum capacity of 1234 addressable slots.

Physical addressing

Physical addressing is how the OS of the machine perceives all the logical addresses of each program to be transcribed onto a singular physical memory resource. Each logical address of the program must be mapped onto a unique physical memory space to prevent the overwriting of different instructions.

The following is an example correspondence between logical addresses and physical addresses:

The OS's Memory Management Unit (MMU) handles the translation of logical addresses addressed by the program in execution into the appropriate physical memory address

The Memory Management Unit (MMU)

The MMU works by assigning a base register value or relocation register value to each process. It first verifies all logical addresses to check if they fall within the limits of the virtual space assigned, and then adds them to the value of the respective program's relocation/base register value. The registers are as follows:

  • Limit register: This register stores the upper limit of the virtual address space that is accessible to the process.

  • Relocation register: This register stores the additive factor that maps to the appropriate starting point of physical memory space of the respective process.

Below is an example of mapping a virtual address to the corresponding physical memory address:

1 of 4

On the whole, memory segmentation enables the virtualization of memory space that abstracts addressing for programmers and system developers, so they don't need to worry about concurrent processes running.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved