首页 > 其他 > 详细

logical vs physical address

时间:2015-06-17 00:27:45      阅读:213      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!