Compare the Difference Between Similar Terms

Difference Between

Home / Technology / IT / Programming /Difference Between Logical Address and Physical Address

Difference Between Logical Address and Physical Address

June 19, 2011Posted byIndika

Thekey difference between logical address and physical address is thatCPUgenerates logical address during program execution whereas the physical address is a location in the memory unit.

In simple terms, CPU generates the logical address or virtual address. From the perspective of a program that is running, an item seems to be located at the address provided by the logical address. Memory unit observes the physical address. Moreover, it allows accessing a particular memory cell in the main memory by the data bus.

Difference Between Logical Address and Physical Address - Comparison Summary

CONTENTS

1.Overview and Key Difference
2.What is Logical Address
3.What is Physical Address
4.Side by Side Comparison – Logical Address vs Physical Address in Tabular Form
5.Summary

What is Logical Address?

CPU generates logical address. From the perspective of a program that is running, an item seems to be located at the address provided by the logical address. Application programs that are running on the computer do not see the physical addresses. They always work using the logical addresses. The logical address space is the set of logical addresses, a program generates. It is necessary to map the logical addresses to physical addresses before using them. The hardware device Memory Management Unit (MMU) handles this mapping process.

MMU Mapping Schemes

MMU follows several mapping schemes. In the simplest mapping scheme, the value in the relocation register is added to each logical address produced by application programs before sending them to the memory. There are also some other complex methods to generate the mapping. Address binding (i.e. allocating instructions and data into memory addresses) can happen at three different times.

Difference Between Logical Address and Physical Address

Figure 01: Logical and Physical Address

Firstly, it can happen in compile time if the actual memory locations are known in advance, and this would generate the absolute code in compile time. It can also happen at load time if the memory locations are not known in advance. For this, re-locatable code needs to be generated at compile time. Furthermore, address binding can happen at execution time. This requires hardware support for address mapping. In compile time and load time address binding, logical and physical addresses are the same. But this procedure is different when address binding happens in execution time.

What is Physical Address?

Memory unit observes the physical address or the real address. It allows the data bus to access a particular memory cell in the main memory. MMU maps the logical address to physical address. For example, using the simplest mapping scheme, which adds the relocation register (assume that the value in the register is y) value to the logical address, a logical address ranges from 0 to x would map to a physical address range y to x+y.

Furthermore, this is also called the physical address space of that program. All the logical addresses need to be mapped into physical addresses before they can be used.

What is the Difference Between Logical Address and Physical Address?

Logical Address vs Physical Address

Logical address is the address at which an item appears to reside from the perspective of an executing application program. Physical address is a memory address that is represented in the form of a binary number on the address bus circuitry in order to enable the data bus to access aparticularstorage cell of main memory, or a register of memory mapped I/O device.
Visibility
The user can view the logical address of a program. The user can not view physical address of program.
Method of Generation
CPU generates the logical address. MMU computes the Physical address.
Accessibility
The user can use the logical address to access the physical address. 用户不能直接访问物理地址。

Summary – Logical Address vs Physical Address

逻辑地址和自然史的区别l address is that CPU generates logical address when program executes whereas the physical address is a location in the memory unit. All the logical addresses need to be mapped into physical addresses before the MMU can use them. Physical and logical addresses are same when using compile time and load time address binding, but they differ when using execution time address binding.

Reference:

1.“Logical Address.” Wikipedia, Wikimedia Foundation, 30 Apr. 2018.Available here
2.“Physical Address.” Wikipedia, Wikimedia Foundation, 30 Apr. 2018.Available here

Image Courtesy:

1.’MMU principle’By Andre Schieleit – Own work, (Public Domain) viaCommons Wikimedia

Related posts:

Difference Between JSP and Servlets Difference Between Enumeration and Iterator Difference Between Directed and Undirected Graph Difference Between Prolog and Lisp Difference Between Flowchart and Data Flow Diagram (DFD)

Filed Under:ProgrammingTagged With:Logical Address,Physical Address

About the Author:Indika

Indika, BSc.Eng, MSECE Computer Engineering, PhD. Computer Science, is an Assistant Professor and has research interests in the areas of Bioinformatics, Computational Biology, and Biomedical Natural Language Processing.

Comments

  1. Sophiya Rajsays

    October 2, 2013 at 11:48 am

    good ans

    Reply
  2. Galibsays

    June 13, 2015 at 7:21 am

    good answere

    Reply
  3. vincentsays

    June 24, 2017 at 8:35 pm

    good answer with best and clear explanation.

    Reply

Leave a ReplyCancel reply

Your email address will not be published.Required fields are marked*

Request Article

Featured Posts

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and SARS

Difference Between Coronavirus and SARS

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Covid 19

Difference Between Coronavirus and Covid 19

You May Like

What is the Difference Between Kappa and Lambda Light Chains

What is the Difference Between Kappa and Lambda Light Chains

Difference Between Minisatellite and Microsatellite

Difference Between Minisatellite and Microsatellite

Difference Between Basketball and Netball

Difference Between Quick Ratio and Current Ratio

Difference Between Divinity and Theology

Difference Between Divinity and Theology

Latest Posts

  • What is the Difference Between Induction Cooker and Normal Cooker
  • What is the Difference Between Vitiligo and Psoriasis
  • What is the Difference Between Cancellous and Cortical Bone
  • What is the Difference Between Electric and Induction Cooktop
  • What is the Difference Between Prevention and Cure
  • What is the Difference Between DSM IV and DSM V Autism
  • Home
  • Vacancies
  • About
  • Request Article
  • Contact Us

Copyright © 2010-2018Difference Between. All rights reserved.Terms of Useand Privacy Policy:Legal.