Memory Management Units, Physical and Logical Memory

A Memory Management Unit maps a programmer's imaginary address space to actual physical RAM locations.

10 min read · 9 cards · 2 checks

Read in: English · हिन्दी · ગુજરાતી


Theory

The Classroom Bench Mix-up

Imagine your professor assigns you Roll Number 5 and tells you to sit at Seat 5 in the LabOne server room. But when you arrive, the first 10 benches are broken, so the lab technician shifts everyone down by 10 seats. Your mind still thinks you are at position 5, but your actual physical body is resting on Seat 15. If your program assumes it owns a specific memory spot, what happens when 30 students load code simultaneously into the same RAM chip?

Theory

The Mall Directory Map

Think of logical addresses like the internal blueprint of a standard retail outlet chain. No matter which city you visit, the stock room is always at the back, and the cash counter is at the front. That is your consistent local layout. But the physical address is the actual global GPS coordinates of that specific shop inside a city mall. The shopping mall directory acts as an instant translator, mapping your local layout query to an actual physical floor location.

Theory

Logical vs Physical Address Space

During compilation, the CPU generates reference locations starting from zero, known as a logical address. The entire collection of these positions is the logical address space. However, the actual hardware RAM chips contain raw storage slots known as a physical address. The software never interacts with raw physical RAM directly. Instead, a dedicated hardware circuit called the Memory Management Unit (MMU) translates every imaginary logical address into a real physical coordinate at lightning speed.

At a glance

Key structural differences between logical and physical memory addressing.

FeatureLogical AddressPhysical Address
Generated ByThe CPU during program executionThe hardware MMU chip mapping
VisibilityUser program can view and modify itHidden completely from user programs
Base ValueAlways starts from zero for every processDepends on available free blocks in RAM
Alternative NameVirtual AddressReal Address

Think first

Calculating the Real RAM Address

Suppose student1 loads a program on LabOne. The CPU generates a logical address of 342. The MMU contains a base relocation register set to 20000. Calculate the exact physical address where this data will be stored in RAM. Think through the addition steps mentally before revealing the answer.

Show the answer

Step 1: Identify the given values. Logical Address = 342. Base Relocation Register = 20000.

Step 2: Apply the MMU translation formula: Physical Address = Logical Address + Relocation Register.

Step 3: Substitute the numbers: Physical Address = 342 + 20000 = 20342.

Step 4: The MMU hardware sends the binary equivalent of 20342 along the address bus to fetch the byte from physical RAM.

Quiz

If a user program on LabOne crashes and prints a segmentation fault error showing memory address 0x0045, what type of address is the programmer looking at?

  1. A physical address pointing directly to a hardware transistor block
  2. A logical address generated by the CPU for that isolated process
  3. A core address inside the motherboard central power supply unit
  4. A physical layout map index generated by the local printer driver
Show the answer

A logical address generated by the CPU for that isolated process

User programs only ever see and print logical addresses. The operating system and hardware MMU carefully mask physical addresses to maintain security, preventing user programs from reading or corrupting actual hardware blocks belonging to other students.

Watch out

The Relocation Register Addition Mistake

A classic university exam trap is forgetting that the relocation register value represents the absolute starting block of physical memory. Students sometimes subtract the logical address or try to multiply values during translation questions. Remember, the logical address is just an offset: an entry distance from the start line. Always add the logical offset to the base register to find the final physical destination.

Theory

Why This Matters for Semester 3

This address separation is the secret shield of modern computing systems. In Semester 3, when you study advanced security and Android application frameworks, you will discover that this exact MMU mapping prevents a malicious downloaded game from snooping into your banking application data. Because each app has its own isolated logical address space starting at zero, it cannot reference another app's memory space.

Summary

Key takeaways

  • Logical addresses are generated by the CPU and always begin at zero for individual program simplicity.
  • Physical addresses correspond to actual electrical slots on physical RAM memory chips.
  • The Memory Management Unit is the hardware component responsible for real time address translation.
  • The base relocation register stores the starting physical address allocated to a program by the OS.
  • Formula to remember: Physical Address equals Logical Address plus Relocation Value.
  • Memory hook: Logical is conceptual, Physical is actual, MMU maps the factual!

Study this properly

This page is the lesson to read. In Gri-Learn the same topic is a graded deck: the self-checks are scored and your weak topics are tracked. Free to start.

Start this topic

Already have an account? Sign in

More from File and Memory Management

Gri-Learn · syllabus-mapped B.C.A. lessons in English, Hindi and Gujarati

Memory Management Units, Physical and Logical Memory · Operating System · Gri-Learn