The addresses determine a location in the memory. In the operation system, once we talk about memory we discuss a ar where the actual code lives in the system. Favor we have actually the deal with of our residence so that anyone can reach out to us. In the very same way, we save the data in the storage at different locations through addresses for this reason that us can accessibility the data again whenever required in the future. There space two varieties of addresses that are supplied for storage in the operating system i.e. The physics address and also logical deal with about which us will discover in this blog. So, let's gain started.

You are watching: What is the difference between a physical address and a virtual address?

Physical Address

The physical attend to refers to a location in the memory. It allows access to data in the main memory. A physical resolve is no directly obtainable to the user routine hence, a logical address needs to it is in mapped to it to do the deal with accessible. This mapping is done by the MMU. Memory monitoring Unit(MMU) is a hardware ingredient responsible for translating a logical address to a physical address.

Logical Address

A logical resolve or virtual attend to is an resolve that is produced by the CPU throughout program execution. A logical deal with doesn't exist physically. The logical address is offered as a reference to accessibility the physics address. A logical deal with usually arrays from zero come maximum (max). The user program that generates the logical address assumes the the process runs top top locations between 0 come the max. This logical address(generated through CPU) combines v the base attend to generated by the MMU to form the physical address.

The diagram below explains just how the mapping in between logical and physical addresses is done.


The CPU generates the reasonable address(here, 324).The MMU will generate the base deal with (here, 2000) which is save on computer in the Relocation Register.The worth of Relocation Register(here, 2000) is included to the logical attend to to get the physical address. I.e. 2000+324= 2324(Physical Address).Difference in between the physical and logical address The an essential difference between a physical attend to and the logical deal with is the logical attend to is produced by the CPU while the routine is to run whereas the physical deal with is a location in memory.The logical attend to is created by the CPU conversely, physical resolve is computed by the MMU.The logical resolve does no exist physically in the memory therefore it is sometimes known as virtual attend to whereas the physical attend to is a place in the memory unit.The logical deal with is provided as a referral to accessibility the physics address. The physical address cannot be accessed directly.Users can view the logical deal with of a program. But, lock cannot view the physical resolve of a program.The collection of all the logical addresses generated in reference to a regime by the CPU is dubbed Logical deal with Space whereas the collection of every the physics addresses mapped come the logical resolve is called Physical deal with Space.

This was around the differences between logical and also physical addresses. Expect you learned something new today.

See more: The Proud Family Don T Leave Home Without It, Don'T Leave Home Without It

Do re-publishing this blog with your friend to spread out the knowledge. Visit our YouTube channel for more content. You deserve to read much more blogs indigenous here.