What is the Difference Between Logical Address and Physical Address?

🆚 Go to Comparative Table 🆚

The main difference between logical and physical addresses lies in their representation and existence in the memory system. Here are the key differences between logical and physical addresses:

  1. Generated by: Logical addresses are generated by the CPU during program execution, while physical addresses are computed by the Memory Management Unit (MMU).
  2. Existence: Logical addresses are virtual addresses that do not physically exist in the memory, whereas physical addresses are actual locations in the memory that can be accessed.
  3. Address Space: Logical addresses are part of the logical address space, which is the set of all logical addresses generated by the CPU for a program. In contrast, physical addresses belong to the physical address space, which is the collection of all physical addresses mapped to the connected logical addresses.
  4. Visibility: Users can view the logical address of a computer program, but they cannot view the physical address.
  5. Mapping: The MMU is used to map logical addresses to their corresponding physical addresses before the execution of the program.

In summary, logical addresses are virtual addresses generated by the CPU during program execution, while physical addresses represent actual locations in the memory system. The MMU is responsible for mapping logical addresses to their corresponding physical addresses for efficient memory access and management.

Comparative Table: Logical Address vs Physical Address

The difference between logical and physical addresses in an operating system can be summarized as follows:

Parameter Logical Address Physical Address
Access User can use the logical address to access the physical address User can indirectly access physical address but not directly
Editable Logical address can be changed Physical address will not change
Also called virtual address real address

Logical addresses are generated by the CPU and provide a layer of abstraction that allows processes to access memory without being concerned about the actual physical location of the data. They are also referred to as virtual addresses because they do not physically exist in the memory. Logical addresses are used by the CPU to access the actual physical memory location.

Physical addresses, on the other hand, are the actual addresses in main memory where data is stored. They are used by the Memory Management Unit (MMU) to translate logical addresses into physical addresses. The MMU uses a page table to translate logical addresses into physical addresses.

In summary, logical addresses are virtual addresses generated by the CPU and used to access physical addresses, while physical addresses are the actual locations in memory where data is stored. Both types of addresses are necessary for the proper functioning of an operating system.