How is the logical address space generated by the CPU?

  • Thread starter Thread starter Peon666
  • Start date Start date
  • Tags Tags
    cpu Space
Click For Summary
Logical address space is generated by the CPU using a pair of base and limit registers, defining the range of addresses accessible to a specific program or user process. This logical address space is not randomly generated; it is determined at compile time or load time, with logical and physical addresses being identical in some cases. However, when addresses are created at execution time, they differ, with logical addresses referred to as virtual addresses.A relocation register is necessary for mapping logical addresses to physical memory because it allows for dynamic address translation, managed by the Memory Management Unit (MMU). The MMU, often integrated into the CPU, adds the value of the relocation register to each memory request, facilitating the mapping process. This dynamic relocation is crucial for preventing address collisions among multiple processes running concurrently, ensuring efficient memory management and isolation between processes.
Peon666
Messages
107
Reaction score
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.
 
Computer science news on Phys.org
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.

Peon666 said:
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.

Peon666 said:
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.
 
  • Like
Likes Greg Bernhardt
I am having a hell of a time finding a good all-in-one inkjet printer. I must have gone through 5 Canon, 2 HP, one Brother, one Epson and two 4 X 6 photo printers in the last 7 yrs. all have all sort of problems. I don't even know where to start anymore. my price range is $180-$400, not exactly the cheapest ones. Mainly it's for my wife which is not exactly good in tech. most of the problem is the printers kept changing the way it operate. Must be from auto update. I cannot turn off the...

Similar threads

Replies
10
Views
3K
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
Replies
19
Views
2K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 17 ·
Replies
17
Views
3K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
816
  • · Replies 9 ·
Replies
9
Views
3K