Virtual address vs Physical address: Understanding the difference

BlogsCloudTechVirtual address vs Physical address: Understanding the difference

Virtual and physical addresses are the two types of addresses that define the memory’s unique locations. The user can see the virtual address but he cannot directly see the physical address. The virtual address is used as a reference to access the physical address in the operating system’s memory. There are some common differences between virtual or logical addresses and physical addresses.

One of the primary differences between these two addresses is that the CPU generates the virtual address when executing a program. And the Physical address is nothing but a location in the memory unit. Let’s understand the common differences between virtual and physical addresses.

What does Virtual Address Mean?

In computing, the virtual address is nothing but a binary number stored in Virtual memory that differs from a physical address. It enables a process that helps to use a preferred location in the computer’s main memory. It requires more space than exists in primary memory, so for that purpose, it relegates some contents to an internal flash drive and hard disk.

According to Techopedia, “A virtual address in memory is a pointer or marker for a memory space that an operating system allows a process to use. The virtual address points to a location in primary storage that a process can use independently of other processes.”

A virtual and physical address is different in the devices with memory management. The Memory Management Unit helps translate virtual addresses into physical addresses in such hardware. A memory management system and virtual address can assign a large amount of memory to a particular process. With virtual addresses, new systems can change the physical memory drive locations with the virtual memory addresses, and the device is divided into different storage types.

Physical Address in Operating System

The physical address present in the memory unit is nothing but the physical location of the information stored. The user can not directly see the physical location and require the logical address or virtual address for that purpose.

The user program generates the virtual address, but it cannot run it; instead, it needs physical memory for the execution of the program. Therefore, it is essential to map logical or virtual addresses to the physical address with the help of MMU (Memory management unit). Physical address space is used for all the physical addresses, and logical or virtual address space is used for virtual addresses.

MMU (Memory Management Unit) sets up the physical addresses for the particular virtual addresses in the system. The user can not directly access the physical address. Instead, he requires the corresponding virtual address to access the physical location of the memory.

What is Memory Management Unit (MMU)?

The memory management unit or MMU is responsible for the run time mapping between logical and physical addresses. The operating system handles the process of mapping and moves it between memory and disk. MMU updates the available and used memory space and combines two different registers, the base register and the limit register. The base register contains the process’s starting physical address, and the limit register mentions the limit relative to the base addresses.

Difference between Virtual and Physical Address

The addresses (Virtual and Physical) show the particular location in the memory unit whose actual code is placed in the OS. There are some common differences between virtual and physical addresses. Here we will discuss all of them with a comparison.

Virtual Address Vs Physical Address

Mapping Virtual Addresses to Physical Addresses

Memory consists of a large number of addresses. The central processing unit (CPU) is responsible for collecting instruction addresses from program files, and it may cause loading to a particular memory address. The address binding is nothing but the mapping process from one address space to another address space. Hence, there are three different methods to complete the address binding: compile time, load time, and execution time.

Compile Time:

If you know the compile time at which the process resides in the memory, then it will help you to generate the absolute address. The physical address generates at the time of compilation during the program’s execution.

Load Time:

If the compile time does not show where the process will reside, then relocated address will generate. Hence, the loader will translate this relocated address to an absolute address. Therefore, a loader will add the base address of the process to the virtual address to develop an absolute address.

Execution Time:

The central processing unit already has the instructions, and it will process them on time. During this process, the additional memory can allocate or relocate. Mapping addresses helps if the process can transfer from one memory to another.

Conclusion

In conclusion, the virtual address is used as a reference to access the physical address. The user can access the physical address in the memory unit by using a logical or virtual address. The set of all physical addresses and logical addresses is known as physical address space and logical address space. Compile and load time address binding methods generate identical virtual and physical addresses.

Also Read:

Technology and Tools Needed for Big Data Analytics

Best Data Lineage Tools Comparison

Data Lake Vs Data Warehouse: what’s the difference?

Related Blogs

    Subscribe


    By completing and submitting this form, you understand and agree to YourTechDiet processing your acquired contact information. As described in our privacy policy.

    No spam, we promise. You can update your email preference or unsubscribe at any time and we'll never share your details without your permission.