Skip to main content

Logical VS Physical Address Space In Operating System

Basically an address generated by the CPU is commonly referred  as a logical address, whereas an address seen by the memory unit is commonly referred as a physical address.The compile-time and load-time address-binding methods generate identical logical and physical addresses. However, the execution-time address binding scheme results in differing logical and physical addresses. In this case, we usually refer to the logical address as a virtual address.


The set of all logical addresses generated by a program is a logical address space. The set of all physical addresses corresponding to these logical addresses is a physical address space. Thus, in the execution-time address-binding scheme, the logical and physical address spaces differ. The run-time mapping from virtual to physical addresses is done by a hardware device called the memory-management unit (MMU).


The user program generates only logical addresses and thinks that the process runs in locations 0 to max. However, these logical addresses must be mapped to physical addresses before they are used. The concept of a logical address space that is bound to a separate physical address space is central to proper memory management.



Logical Address is generated by CPU while running of program. The logical address is virtual address. This address is used as a reference to access the physical memory location by CPU. The hardware device called Memory-Management Unit is used for mapping logical address to its corresponding physical address. Physical Address is a physical location of required data in a memory. The user never directly deals with the physical address. For access it uses its corresponding logical address. The user program generates the logical address and thinks that the program is running in this logical address but the program needs physical memory for its execution. So the logical address must be mapped to the physical address by MMU before they are used.


In other  words the physical address space in a system can be defined as the size of the main memory in a system. It is an important task to always compare the process size with the physical address space. The process size must be less than the available physical address space. Logical address space can be defined as the size of the process. The size of the process should be less enough so that it can reside in the main memory.


Share, Follow and please comment if you find anything incorrect or to share more information about the topic discussed above.

Comments

Popular posts from this blog

Process & Its state And process control block :-

                ⇰  PROCESS :- A process can be thought of as a program in execution. Means when any program is executed it becomes process. A processwill need certain resources such as CPU time , memory, files and I/O devices to complete its task. These resources are allocated to the process either when it is created or at the time of execution.             A process is the unit of work in most systems. A system consistes of a collection of processes. All these processes may execute concurrently. Traditionally a process contained only a single thread. Most modern operating ststems now supports processes that have multiple threads.         The operating system is responsible for several important works of process management as - the creation and deletion of process, the schrduling of process, communication and deadlock handling of process. Process is broudly divided into two types:-  i> System  Process. ii> User Process. Early computers allowed only one program be ex

Semaphores In Process Synchronization

   ⇰  Semaphores :-   Semaphore is actually a method or tool to prevent race condition. Race condition can cause loss of data or even deadlock situation. For prevention from these conditions, the semaphore is one of the method.  Semaphore was proposed by Dijkstra in 1965. Simaphore    is a very significant technique to manage concurrent processes.  Semaphore is useful tool in the prevention of race condition. But the use of semaphore never means a guarantee that a program is free from these problems.     Semaphore is an integer variable which is used in mutual exclusive manner by various concurrent cooperative processes in order to acheive synchronization. Hence semaphore is one of the way to achieve synchronization.  Semaphore is basically  a variable which is non-negative and shared between threads. This variable is used to solve the critical section problem and to achieve process synchronization in the multiprocessing environment. Semaphore contains some operations as f

Quick Sort In Data Structure

    ⇰   QUICK SORT :- Quick sort is one of the type of sorting technique. It  follows the di vide and conquer algorithm.  The Quick sort   treats an array as a list of elements. When sorting process begins, it selects the List's middle element as the list pivote. The algorithm then divides the list into two sub-lists, one with the elements that are less then the list pivote and other list with elements greater then or equal to list pivote.    The algorithm then recursively invokes or calls itself with both the list. Each time when the sorting algorithm is invoked, it further divides the elements into smaller sub-lists.  This algorithm is quite efficient for large-sized data.  In quick Sort generally middle element of list is considered as pivote, but we can  take pivot in different ways as follows:-     i > picking first element as pivot.  ii > picking last element as pivot iii > Pick a random element as pivot. iv > Pick middle element as pivot (We are us