In this article, we’re going to learn about address binding in memory management.
Before we begin, we need to have some basic knowledge about some of the basic concepts in memory management.
Let’s start with “Memory Address”.
Memory Address
Memory address is a reference to a specific memory location. Memory consists a large array of bytes.
Each of these bytes have a unique set of fixed-length sequences of digits so the computer can address each of these bytes.
Memory address is used by hardware and software at various levels to read, write and manipulate data stored in the main memory.
Memory Word
Memory word is the smallest unit of memory.
Ex: 32-bit memory addressing uses 32 bit word.
Memory word should be able to express every byte’s memory address in computer’s main memory.
Therefore the number of bits used to hold a memory address is referred to as word/word size.
Difference Between Logical Address (Virtual Address) And Physical Address
Logical address is generated by the CPU during the execution of a program.
Physical address refers to an actual location on the memory. This is the memory that is loaded into the memory-address register i.e. the address seen by the memory unit.
Apart from that, there’re few other differences between logical address and physical address. Here’s a few for you to check out,
| Logical Address | Physical Address |
| This is visible to the user i.e. user can view the logical address of a program | User can never view the physical address |
| User uses logical address to access the physical address | User can’t directly access the physical address |
How The OS Provides Memory Protection
CPU must check every memory access generated from user space to be legal.
It needs to check whether the address is in-between base and limit for that user (process).
Here’s how the OS provides memory protection,

When a program is selected for execution by the CPU scheduler relocation register (base) stores the smallest physical address which is assigned that process and the limit register contains a range of logical addresses.
Each must be less than limit register. MMU maps logical address in limit register to the corresponding physical address by base + limit.
If the process wants to access a memory location CPU checks whether the address is greater than or equal to the address in the base, then the CPU checks whether the requested address is in the range of contents of base + limit.
If both these conditions are true, process is allowed to access the requested memory.
If one of these conditions are false trap is send to OS stating the illegal addressing error.
Role Of Memory Management Unit (MMU)

MMU is a hardware component. Run-time mapping from virtual to physical addresses is done by this component.
The user process can only see the logical address. The physical address is not accessible or visible to the user.
Mapping in MMU happens in the following way.
The value in the relocation register is added to every address generated by a user process at the time the address is sent to memory.
For an example, if the base is at 1000, then an attempt by the user to address location 0 is dynamically relocated to location 1000; an access to location 346 is mapped to location 1346.
What Is Address Binding?

Address binding is performed by the OS on behalf of user programs that need access to memory.
The above figure depicts address binding in execution-time address binding method.
Since the value of the relocation register is 14000, an attempt by the user to address location 346 is dynamically relocated to location 14346.
User can’t see the physical address 14346.
The program can create a pointer to location 346, store it in memory, manipulate it, and compare it with other addresses—all as the number 346.
Conclusion
In this article, we have discussed about,
- Memory Address
- Memory Word
- Difference Between Logical and Physical Address
- How the OS Provides Memory Protection
- The Role of Memory Management Unit (MMU)
- Address Binding
If you have any questions, be sure to leave a comment down below and have a great day! 😊
Great explanation about memory management, nicely disgned the blog.keep it up!!
LikeLiked by 1 person
This article is really useful. It helps a lot to get a vast knowledge of address binding. And the simple language used is so comprehensive that anyone without technical knowledge can understand it too.
LikeLike
This is very good and very helpfull to know about memory management
LikeLike
Group_01_MM_FCT- This blog really helped me to gain my knowledge in memory management. Thank you. Keep it up!
LikeLike