Memory Management(QA) Week 7
Memory Management(QA) Week 7
Questions and Answers on address space, logical & physical address, MMU
Question1:
Describe about address space and memory space in Computer Science.
Answer:
An address used by a programmer will be termed as a virtual address and set of such addresses the
address space. An address in main memory is known as a physical address. The set of these locations is
termed as memory space. So address space is set of addresses produced by programs as they reference
instructions and data, memory space comprises actual main memory locations directly addressable for
processing.
Supposes a computer which has a main-memory capacity of 64K words (K=1024). 16-bits are required
to specify a physical address in memory because 64K = 216. Assume that computer has auxiliary memory
for storing information equivalent to capacity of 16 main memories. Let's signify address space by N
and memory space by M we then have for this illustration: N = 16 × 64 K = 1024K and M = 64K.
In a multiprogramming computer system, data and programs are transferred to and from auxiliary
memory and main memory based on demands obliged by CPU. Suppose program 1 is currently being
executed in CPU. Program 1 and a part of its associated data are moved from secondary memory in the
main memory as displayed in Figure below. Parts of programs and data require not being in contiguous
locations in memory because information is being moved in and out and empty spaces may be available
in scattered locations in memory.
Page 2 of 4
Question-02:
Describe the differences between Logical Address and Physical Address.
Answer:
Users can access the logical User can never access the physical address of the
1.
address of the Program. Program
Question-03:
explain the memory management unit (MMU) in OS with aid of suitable
example.
Answer:
Memory Management Unit(MMU) in OS
It is a hardware device that does the run-time mapping from the virtual address to the physical address.
It is located within the Central Processing Unit.
Let us understand the concept of mapping with the help of a simple MMU scheme and that is a base-
register scheme.
Page 3 of 4
In the above diagram, the base register is termed the Relocation register. The relocation register is a
special register in the CPU and is used for the mapping of logical addresses used by a program to
physical addresses of the system's main memory.
The value in the relocation register is added to every address that is generated by the user process at the
time when the address is sent to the memory.
MMU Example
Suppose the base is at 14000, then an attempt by the user to address location 0 is relocated dynamically
to 14000; thus access to location 356 is mapped to 14356.
It is important to note that the user program never sees the real physical addresses. The Program can
create a pointer to location 356 and store it in the memory and then manipulate it after that compare it
with other addresses as number 356.
User program always deals with the logical addresses. The Memory Mapping unit mainly converts the
logical addresses into the physical addresses. The final location of the referenced memory address is not
determined until the reference is made.
physical addresses (lies in the range R+0 to R+max for the base value R)
As we have told you above the user generates only a logical address and then thinks that the process
runs in locations 0 to max. However, these logical addresses must be mapped to physical addresses
before they are used.
Page 4 of 4