What is a Physical Address?
A physical address is the actual address in the main memory where data is stored. It is a location in physical memory, as opposed to a virtual address. Physical addresses are used by the Memory Management Unit (MMU) to translate logical addresses into physical addresses. The user must use the corresponding logical address to go to the physical address rather than directly accessing the physical address. For a computer program to function, physical memory space is required. Therefore, the logical address and physical address need to be mapped before the program is run.
The term “physical address” describes the precise position of necessary data in a memory. Before they are used, the MMU must map the logical address to the physical address. This is because the user program creates the logical address and believes that the program is operating in this logical address. However, the program requires physical memory to execute. All physical addresses that match the logical addresses in a logical address space are collectively referred to as the “physical address space”
The translation from logical to physical addresses is performed by the operating system’s memory management unit (MMU) within the computer’s hardware architecture. The MMU uses a page table to translate logical addresses into physical addresses. The page table maps each logical page number to a physical frame number. While the operating system plan this process, it’s important to note that the MMU itself is a hardware component separate from the software-based elements of the operating system.
Similarities Between Logical and Physical Addresses in the Operating System
- Both logical and physical addresses are used to identify a specific location in memory.
- Both logical and physical addresses can be represented in different formats, such as binary, hexadecimal, or decimal.
- Both logical and physical addresses have a finite range, which is determined by the number of bits used to represent them.
Important Points about Logical and Physical Addresses in Operating Systems
- The use of logical addresses provides a layer of abstraction that allows processes to access memory without knowing the physical memory location.
- Logical addresses are mapped to physical addresses using a page table. The page table contains information about the mapping between logical and physical addresses.
- The MMU translates logical addresses into physical addresses using the page table. This translation is transparent to the process and is performed by hardware.
- The use of logical and physical addresses allows the operating system to manage memory more efficiently by using techniques such as paging and segmentation.
Logical and Physical Address in Operating System
A logical address is generated by the CPU while a program is running. The logical address is a virtual address as it does not exist physically, therefore, it is also known as a Virtual Address. The physical address describes the precise position of necessary data in a memory. Before they are used, the MMU must map the logical address to the physical address. In operating systems, logical and physical addresses are used to manage and access memory. Here is an overview of each in detail.