edited by
325 views
0 votes
0 votes
Difference between logical address and physical address.

M getting so confused between this two. Sometimes it is mentioned that logical address is what viewd by the user as user can't view physical address but then it is given it is generated by the CPU.

Explain in simple language not bookies words. Thanks.
edited by

1 Answer

0 votes
0 votes

First things first:

To be very honest, when we say "users" we don't mean you and I in this context.

A process in running state is using the CPU and it is the process which generates the addresses.

What is a logical address? Each process knows only about its own existence (at least by the code of conduct of good processes). Let's consider a hypothetical case:
Say a process has exactly 100 lines of instruction. It will generate addresses (while running) 0 to 99. These are logical addresses and the process knows only about these.

But in the memory (a.k.a. RAM) actual 0 through 99 is usually taken up by OS so the loader will try to put it somewhere, say, 2240 through 2339. These addresses are not known/visible to the process. Now at runtime the MMU will perform the mapping of say logical address 1 to physical address 2241.


Logical Adress space is a concept related to virtual memory. Say, a process generates 1000 addresses, but it can be provided only 100 locations, then the process will be brought into memory in installments. But, the process will never know about this cheating. It will innocently believe it has all the 1000 locations; because it sees only logical addresses :)

Note: the answer has been edited. The loader is resident in memory as part of the kernel.
         Memory Management Unit is set of hardware components that perform Logical Address to Physical Address mapping for run time binding.
 

Hope this was useful.

edited by

Related questions

0 votes
0 votes
1 answer
2
Mrityudoot asked Mar 20
149 views
If Page size = Frame size is always true and offset in Logical address = offset in physical address holdsThen how/why Logical address size can come different than physica...
0 votes
0 votes
0 answers
3
SSR17 asked Feb 8
208 views
we have 8 pages (each side 32B) to store in physical memory of 2^32 bits how many bits are required to identify each page , according to me 3 bits are required but that i...