Logical and Physical Address Space

Introduction

เคœเคฌ เค•เฅ‹เคˆ program run เคนเฅ‹เคคเคพ เคนเฅˆ, เคคเฅ‹ เค‰เคธเฅ‡ memory เค•เฅ€ เคœเคฐเฅ‚เคฐเคค เคนเฅ‹เคคเฅ€ เคนเฅˆเฅค

เคฒเฅ‡เค•เคฟเคจ เคฏเคนเคพเค เคเค• important เคฌเคพเคค เคนเฅˆ:

Program เคœเคฟเคธ address เค•เฅ‹ use เค•เคฐเคคเคพ เคนเฅˆ ,
เค”เคฐ actual memory (RAM) เคฎเฅ‡เค‚ เคœเฅ‹ address เคนเฅ‹เคคเคพ เคนเฅˆ

เคฏเฅ‡ เคฆเฅ‹เคจเฅ‹เค‚ same เคจเคนเฅ€เค‚ เคนเฅ‹เคคเฅ‡

เค‡เคธเฅ€ difference เค•เฅ‹ เคธเคฎเคเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เคนเคฎ เคชเคขเคผเคคเฅ‡ เคนเฅˆเค‚:

  • Logical Address
  • Physical Address

Logical Address เค•เฅเคฏเคพ เคนเฅ‹เคคเคพ เคนเฅˆ

Logical Address เคตเคน address เคนเฅ‹เคคเคพ เคนเฅˆ เคœเฅ‹ CPU เคฏเคพ program generate เค•เคฐเคคเคพ เคนเฅˆเฅค

เคฏเคน address user program เค•เฅ‹ เคฆเคฟเค–เคพเคˆ เคฆเฅ‡เคคเคพ เคนเฅˆ

Physical Address เค•เฅเคฏเคพ เคนเฅ‹เคคเคพ เคนเฅˆ

Physical Address เคตเคน actual address เคนเฅ‹เคคเคพ เคนเฅˆ เคœเฅ‹ main memory (RAM) เคฎเฅ‡เค‚ เคนเฅ‹เคคเคพ เคนเฅˆเฅค

เคฏเคนเฅ€ address memory hardware use เค•เคฐเคคเคพ เคนเฅˆ

Simple Definition

Logical Address = CPU เคฆเฅเคตเคพเคฐเคพ generate เค•เคฟเคฏเคพ เค—เคฏเคพ address
Physical Address = Memory เคฎเฅ‡เค‚ actual address

Main Difference

Logical AddressPhysical Address
CPU generate เค•เคฐเคคเคพ เคนเฅˆMemory เคฎเฅ‡เค‚ actual เคนเฅ‹เคคเคพ เคนเฅˆ
Virtual เคนเฅ‹เคคเคพ เคนเฅˆReal เคนเฅ‹เคคเคพ เคนเฅˆ
User เค•เฅ‹ เคฆเคฟเค–เคคเคพ เคนเฅˆUser เค•เฅ‹ directly เคจเคนเฅ€เค‚ เคฆเคฟเค–เคคเคพ

Address Translation

Logical address เค•เฅ‹ physical address เคฎเฅ‡เค‚ convert เค•เคฟเคฏเคพ เคœเคพเคคเคพ เคนเฅˆ

เคฏเคน เค•เคพเคฎ เค•เคฐเคคเคพ เคนเฅˆ: MMU (Memory Management Unit)

Working

  1. Program logical address generate เค•เคฐเคคเคพ เคนเฅˆ
  2. MMU เค‰เคธเฅ‡ convert เค•เคฐเคคเคพ เคนเฅˆ
  3. Physical address เคฎเคฟเคฒเคคเคพ เคนเฅˆ
  4. Memory access เคนเฅ‹เคคเฅ€ เคนเฅˆ

Example

เคฎเคพเคจ เคฒเฅ‹:

  • Program address = 100 (logical)
  • Base address = 1000

เคคเฅ‹:

Physical address = 100 + 1000 = 1100

Important Concept: Address Space

1. Logical Address Space

  • เคธเคญเฅ€ logical addresses เค•เคพ set

2. Physical Address Space

  • เคธเคญเฅ€ physical addresses เค•เคพ set

Types of Mapping

1. Compile Time Binding

Address เคชเคนเคฒเฅ‡ เคนเฅ€ fix เคนเฅ‹ เคœเคพเคคเคพ เคนเฅˆ

2. Load Time Binding

Program load เคนเฅ‹เคจเฅ‡ เคชเคฐ address fix เคนเฅ‹เคคเคพ เคนเฅˆ

3. Execution Time Binding

Run time เคชเคฐ address change เคนเฅ‹ เคธเค•เคคเคพ เคนเฅˆ

เคธเคฌเคธเฅ‡ flexible เคฏเคนเฅ€ เคนเฅ‹เคคเคพ เคนเฅˆ

Real Life Analogy

Logical Address = Map เคฎเฅ‡เค‚ location
Physical Address = Real เคœเค—เคน

Map เค”เคฐ real location เค…เคฒเค— เคนเฅ‹ เคธเค•เคคเฅ‡ เคนเฅˆเค‚

Why Important

  • Memory protection เคฆเฅ‡เคคเคพ เคนเฅˆ
  • Program relocation เค†เคธเคพเคจ เคฌเคจเคพเคคเคพ เคนเฅˆ
  • Multi-programming possible เคฌเคจเคพเคคเคพ เคนเฅˆ

Key Points

  • Logical vs Physical address
  • MMU role
  • Address translation
  • Binding types

Conclusion

Logical เค”เคฐ Physical Address Space memory management เค•เคพ base concept เคนเฅˆเฅค
เคฏเคน เคธเคฎเคเคจเคพ เคœเคฐเฅ‚เคฐเฅ€ เคนเฅˆ เค•เคฟ program address เค”เคฐ actual memory address เค…เคฒเค— เคนเฅ‹เคคเฅ‡ เคนเฅˆเค‚ เค”เคฐ MMU เค‰เคจเฅเคนเฅ‡เค‚ map เค•เคฐเคคเคพ เคนเฅˆเฅค

Leave a Comment

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

Scroll to Top