Operating System Addressing: Logical vs Physical Space

Logical address is generated by CPU and represents program instruction addresses, while physical address is the actual address where instructions are stored in main memory. Logical address is virtual and cannot be accessed physically, but physical address can be accessed with the help of logical address formula. Memory management unit generates physical address, and logical address space refers to set of logical addresses generated by program, while physical address space refers to set of physical addresses corresponding to logical address space. #KeyInsight: Logical and physical address are different but interrelated concepts in operating systems.

In operating systems, there are two types of addresses: logical address and physical address. Logical address is generated by the CPU, while physical address is located in the main memory. Logical address is an address of the instruction used by the program, whereas physical address is the actual address in the main memory where the instructions are stored.

Logical Address Space and Physical Address Space πŸ“Š

Logical address space refers to the set of logical addresses generated by the program, while physical address space refers to the set of physical addresses corresponding to the logical address space. A program contains a collection of instructions, and logical address means those instruction addresses. For instance, if a program contains 10 instructions, then we have 10 addresses, which are nothing but logical addresses.

Physical address means that the program will be loaded in main memory during the execution, and it is the location in the main memory where the instructions are stored. Physical addresses are the physical locations in the main memory, and they can be accessed physically.

Accessing Logical and Physical Addresses πŸ€”

Users can access logical address directly, as logical address means program address. However, physical address cannot be accessed by the user directly. But, the user can calculate physical address with the help of the logical address. For that, we have a formula: Physical Address = Logical Address + Relocation Register.

Relocation register is the base register containing the starting address of the process. When we add the relocation register value with the logical address, we get the physical address. The logical address doesn’t exist physically in the main memory, and it is termed as a virtual address.

Memory Management Unit and Physical Address πŸ‘¨β€πŸ’»

Logical address is generated by the CPU, while physical address is generated by the memory management unit (MMU). MMU is a hardware that performs the mapping between logical address to the physical address. It is present in the CPU and performs the mapping from logical address to physical address.

In summary, logical address and physical address are two types of addresses in operating systems. Logical address is generated by the CPU, and physical address is located in the main memory. Users can access logical address directly, while physical address cannot be accessed by the user directly. Physical address is generated by the MMU, which performs the mapping from logical address to physical address. Logical address space refers to the set of logical addresses generated by the program, while physical address space refers to the set of physical addresses corresponding to the logical address space.

Key Takeaways πŸš€

  • Logical address is generated by the CPU, while physical address is located in the main memory.
  • Logical address means program instruction addresses, whereas physical address means the actual address in the main memory where the instructions are stored.
  • Users can access logical address directly, while physical address cannot be accessed by the user directly.
  • MMU is a hardware that performs the mapping between logical address to the physical address.
  • Logical address space refers to the set of logical addresses generated by the program, while physical address space refers to the set of physical addresses corresponding to the logical address space.

FAQ ❓

Q: What is the difference between logical address and physical address?

A: Logical address is generated by the CPU, and it means program instruction addresses. Physical address is located in the main memory, and it is the actual address where the instructions are stored.

Q: Can users access physical address directly?

A: No, users cannot access physical address directly.

Q: What is MMU?

A: MMU stands for memory management unit, and it is a hardware that performs the mapping between logical address to the physical address.

Q: What is logical address space and physical address space?

A: Logical address space refers to the set of logical addresses generated by the program, while physical address space refers to the set of physical addresses corresponding

About the Author

Sudhakar Atchala
142K subscribers

About the Channel:

This channel contains educational videos which helps the students for their self learning.
Share the Post:
en_GBEN_GB