How is the logical address space generated by the CPU?

  • Thread starter Peon666
  • Start date
108
0
I do understand that logical address space/memory is generated by the CPU for the program and physical memory is the one on-to which the logical address space is mapped and which is on the physical memory. Plus, physical memory is not directly accessible to the user.

Now, my question is (I don't know whether this makes sense or not):

1- How is the logical address space generated by the CPU? And is this randomly generated?

2- Why do we need a "relocation register" to map it on the physical memory? Why can't it be directly mapped on the physical memory?

Thanks.
 

QuantumQuest

Science Advisor
Insights Author
Gold Member
830
429
First, we must note that the concept of a logical address space bound to some physical address space is of central role in order to have proper memory management.

1- How is the logical address space generated by the CPU? And is this randomly generated?
A pair of base and limit registers are used to define the logical address space. We must note here that main memory and registers are the only storage that can be accessed by CPU directly. Also, we talk about the logical address space per program or better stated, per user process.

Now, the set of all logical addresses used by a program defines its logical address space, and the set of all corresponding physical addresses defines its physical address space.
Addresses which are bound at compile time or load time have identical logical and physical addresses.
Addresses created at execution time have different logical and physical addresses. In this case, the logical address is also known as virtual address.

2- Why do we need a "relocation register" to map it on the physical memory? Why can't it be directly mapped on the physical memory?
The run time mapping of logical to physical addresses is handled by the MMU (Memory Management Unit), which is the hardware that supports the mapping of virtual memory addresses to physical memory addresses. In modern microcomputers it is built into the CPU chip. For run time mapping, the base register is named relocation register. In the usual dynamic relocation scheme that we talk about here - which is used in order to avoid collisions among multiple processes running simultaneously, relocation register value is added to every memory request at the hardware level. So, MMU adds the value of the relocation register to a logical address in order to form a physical address.
 

Want to reply to this thread?

"How is the logical address space generated by the CPU?" You must log in or register to reply here.

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top