Hire a tutor

What are virtual and physical addresses in memory management?

Virtual addresses are used by the CPU during a program's execution, while physical addresses refer to actual hardware memory locations.

In more detail, a virtual address is a memory address that is generated by the CPU during a program's execution. This address is used within the context of a process or task, and it is translated into a physical address before the actual memory access is performed. The translation is done by the memory management unit (MMU) of the CPU, using a method known as paging. The use of virtual addresses allows a program to behave as if it has exclusive use of the main memory, even though other processes are also running and using memory. For a deeper understanding of the CPU's role in this process, see Central Processing Unit (CPU).

On the other hand, a physical address is a location in the actual hardware memory, such as RAM. This is the address that the memory controller circuitry on the motherboard uses to access the memory cells to read or write data. Physical addresses are typically not visible to the software running on the CPU; they are used by the MMU and the memory controller.

The use of virtual and physical addresses is a key aspect of modern operating systems and their memory management. It allows for the implementation of features such as virtual memory, where disk storage is used to extend the available memory, and memory protection, where each process is prevented from accessing the memory of other processes. This separation between virtual and physical addresses also enables processes to be moved in and out of memory, a technique known as swapping, which is used to manage memory usage efficiently. To explore how operating systems manage these functions, visit Functions of Operating Systems.

Furthermore, the overall purpose and benefits of using an operating system in efficiently managing both types of addresses can be further understood by reading about the Purpose of Operating Systems.


A-Level Computer Science Tutor Summary: In memory management, virtual addresses are created by the CPU during a program's run and allow the program to use memory as if it's the only one doing so. Physical addresses are actual locations in the computer's memory (RAM). A special part of the CPU, called the MMU, changes virtual addresses to physical ones, helping manage memory safely and efficiently.

Study and Practice for Free

Trusted by 100,000+ Students Worldwide

Achieve Top Grades in your Exams with our Free Resources.

Practice Questions, Study Notes, and Past Exam Papers for all Subjects!

Need help from an expert?

4.92/5 based on480 reviews

The world’s top online tutoring provider trusted by students, parents, and schools globally.

Related Computer Science a-level Answers

    Read All Answers
    Loading...