码迷,mamicode.com
首页 > 其他好文 > 详细

logical vs physical address

时间:2015-06-17 00:27:57      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:

Logical vs physical address 

 

  1) An address generated by the CPU is a logical address. Whereas, an address seen by the memory unit, that is, the one loaded into the memory-address register of the memory, is a physical address.

 

  2) The user program never sees the physical addresses. The program creates a pointer to a logical address, say 346, stores it in memory, manipulate it, compares it to other logical addresses- all as the number 346. 

  Only when a logical address is used as memory address, it is relocated relative to the base/relocation register. The memory-mapping hardware device called the memory- management unit(MMU) converts logical addresses into physical addresses.
  

  3) Logical addresses range from 0 to max. User program that generates logical address thinks that the process runs in locations 0 to max. 
Logical addresses must be mapped to physical addresses before they are used. Physical addresses range from (R+0) to (R + max) for a base/relocation register value R.
  

  4) Example: 

技术分享

  Mapping from logical to physical addresses using memory management unit (MMU) and relocation/base register.
  
  The value in relocation/base register is added to every logical address generated by a user process, at the time it is sent to memory, to generate corresponding physical address.
  
  In the above figure, base/ relocation value is 14000, then an attempt by the user to access the location 346 is mapped to 14346. 
 

logical vs physical address

标签:

原文地址:http://www.cnblogs.com/mengdie/p/4582080.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!