Difference Between Logical and Physical Address in Operating System


In computers, an address is used to identify a location in the computer memory. In operating systems, there are two types of addresses, namely, logical address and physical address. A logical address is the virtual address that is generated by the CPU. A user can view the logical address of a computer program. On the other hand, a physical address is one that represents a location in the computer memory. A user cannot view the physical address of a program.

Read this article to find out more about logical and physical address and how they are different from each other.

What is a Logical Address?

The logical address is a virtual address created by the CPU of the computer system. The logical address of a program is generated when the program is running. A group of several logical address is referred to a logical address space. The logical address is basically used as a reference to access the physical memory locations.

In computer systems, a hardware device named memory management unit (MMU) is used to map the logical address to its corresponding physical address. However, the logical address of a program is visible to the computer user.

What is a Physical Address?

The physical address of a computer program is one that represents a location in the memory unit of the computer. The physical address is not visible to the computer user. The MMU of the system generates the physical address for the corresponding logical address.

The physical address is accessed through the corresponding logical address because a user cannot directly access the physical address. For running a computer program, it requires a physical memory space. Therefore, the logical address has to be mapped with the physical address before the execution of the program.

Difference between Logical and Physical Address in Operating System

The following table highlights all the major differences between logical and physical address in operating system −

S. No. Logical Address Physical Address
1. This address is generated by the CPU. This address is a location in the memory unit.
2. The address space consists of the set of all logical addresses. This address is a set of all physical addresses that are mapped to the corresponding logical addresses.
3. These addresses are generated by CPU with reference to a specific program. It is computed using Memory Management Unit (MMU).
4. The user has the ability to view the logical address of a program. The user can’t view the physical address of program directly.
5. The user can use the logical address in order to access the physical address. The user can indirectly access the physical address.

Conclusion

A physical address is a memory address that is represented in the form of a binary number on the address bus circuitry in order to enable the data bus to access a particular storage cell of main memory. A logical address, on the other hand, is a memory address that is generated by the CPU and is translated into a physical address by the MMU in order to access a specific location in the main memory.

The most significant difference between a logical address and a physical address is that the logical address is a virtual address generated by the CPU that is used to access the physical address, while a physical address is a location in the computer’s memory unit.

Updated on: 05-Oct-2023

29K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements