🎓 BookMCQ
← Back to 8. Main Memory

📝 Hardware support in Paging (31 MCQs)

📖 From Operating System • 8. Main Memory • 31 questions available

What is Hardware support in Paging?

Definition:
Paging hardware includes MMU with page table walker, TLB cache, and page fault handler to translate virtual addresses to physical frames transparently.

Example:
TLB hit for VPN =5= 5 returns PFN =12= 12 in 1 cycle1 \text{ cycle}; miss triggers page table walk taking 10+10+ cycles before caching result.

Reason:
Hardware acceleration makes paging feasible despite indirection overhead ensuring virtual memory performance approaches physical memory speeds.

7
Easy
14
Medium
10
Hard

📝 All Hardware support in Paging MCQs

Q1. What is the name of the register that holds the base value for address relocation?

A.relocation register ✅
B.base register
C.segment register
D.index register
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The relocation register stores the base value that the MMU adds to each logical address, turning it into a physical address. This makes the correct answer A. Options B, C, and D describe different registers that either hold segment information or index offsets, which are not used for simple relocation. Understanding the role of the relocation register is essential for recognizing how address translation works in hardware.

Q2. In a simple MMU scheme, logical addresses range from 0 to what?

A.max ✅
B.R+max
C.R
D.0
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Logical addresses start at zero and extend up to the maximum logical address defined for the process, denoted as max. Therefore option A is correct. Option B mixes logical and physical ranges, option C suggests a fixed offset, and option D incorrectly states that logical addresses are always zero. Recognizing the logical address range is fundamental when mapping to physical memory.

Q3. What term describes the address used by the program before hardware translation?

A.logical address ✅
B.physical address
C.virtual address
D.mapped address
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The address a program generates before the MMU changes it is called a logical address. Hence A is correct. Physical addresses (B) are the results after translation, virtual addresses (C) are often synonymous with logical addresses but the question targets the specific term logical address, and mapped address (D) is not standard terminology. Knowing this term helps students follow address translation steps.

Q4. Why does using a relocation register simplify program portability?

A.It decouples program code from absolute memory locations ✅
B.It eliminates the need for a compiler
C.It increases CPU speed
D.It removes the need for paging
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A is correct because the relocation register lets the same program run at any physical base, removing dependence on fixed addresses. Option B is false; compilation is still required. Option C is unrelated to speed, and D misstates the role of paging, which is a different memory‑management technique. Portability stems from logical‑to‑physical mapping performed at run time.

Q5. How does dynamic address translation affect memory protection?

A.It allows the OS to restrict physical regions accessible to a process ✅
B.It speeds up cache lookup
C.It disables interrupts during access
D.It makes all memory visible to every process
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The correct answer is A because the MMU can enforce limits on which physical addresses a process may reach, providing protection. Options B and C describe unrelated hardware functions, while D contradicts the purpose of isolation. Recognizing this link shows how translation not only relocates but also secures memory.

Q6. What is the effect of changing the relocation register value during execution?

A.All subsequent logical addresses are mapped to a new physical region ✅
B.Previously stored pointers automatically update
C.The CPU cache is flushed
D.The process must restart
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Changing the register only influences addresses generated after the change, so A is correct. Existing pointers retain their old logical values and will be translated using the old base, making B incorrect. Cache behavior (C) is unrelated, and processes do not need to restart (D). This nuance is critical for understanding runtime address binding.

Q7. How does the range of physical addresses relate to the relocation register value R?

A.Physical addresses span from R to R + max ✅
B.Physical addresses are exactly R
C.Physical addresses start at 0 and end at max
D.Physical addresses are independent of R
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Since each logical address L is translated to physical address R+LR+L, the overall physical range begins at R and ends at R+maxR+max; therefore A is correct. Options B and C ignore the addition of L, and D claims no dependence, which contradicts the translation rule. Relating ranges helps students visualize address mapping.

Q8. In the described scheme, why can't the user program directly see physical addresses?

A.The MMU hides them during translation
B.The compiler removes them ✅
C.The CPU does not support physical addressing
D.Physical memory is encrypted
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: The MMU adds the relocation value only when the address is sent to memory, so the program only ever sees logical values, making A correct. Compilation (B) does not alter run‑time visibility, CPUs do handle physical addresses internally (C), and encryption (D) is unrelated. This explains the abstraction layer provided by hardware.

Q9. How does the MMU handle pointer arithmetic without relocating until actual memory access?

A.It treats pointers as logical values until a load/store
B.It converts pointers to physical immediately ✅
C.It disables pointer arithmetic
D.It requires software to perform relocation
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Pointer arithmetic is performed on logical addresses, so the MMU postpones translation until the pointer is used in a memory operation, confirming A. Immediate conversion (B) would break the logical model, disabling arithmetic (C) is impractical, and requiring software (D) defeats the hardware purpose. Understanding this delay clarifies how programs manipulate addresses safely.

Q10. What advantage does execution‑time binding provide over compile‑time binding?

A.Flexibility to move processes in memory ✅
B.Reduced code size
C.Elimination of page faults
D.Simpler instruction decoding
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Execution‑time binding lets the OS place a process at any physical location by setting the relocation register, offering flexibility, so A is correct. Compile‑time binding fixes addresses, limiting relocation. Options B, C, and D describe unrelated benefits that do not stem from when binding occurs. Recognizing this advantage highlights dynamic memory management.

Q11. How does the scheme ensure that two processes with different base registers do not interfere?

A.Each process adds its own base to logical addresses
B.They share the same physical memory region ✅
C.The OS disables the MMU for one process
D.Physical addresses are masked with process IDs
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Because each process's MMU adds its unique relocation value, their logical address spaces map to distinct physical regions, making A correct. Sharing the same region (B) would cause collisions, disabling the MMU (C) removes protection, and masking (D) is not part of this simple scheme. This separation is vital for multitasking safety.

Q12. What is the relationship between logical address max and physical memory size requirements?

A.Physical memory must be at least R + max bytes ✅
B.Physical memory must equal max bytes
C.Physical memory size is independent of max
D.Physical memory must be exactly R bytes
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: To hold the entire logical range after translation, the system needs physical memory covering the highest possible address R+maxR+max; thus A is correct. Having only max bytes (B) would ignore the base offset, and independence (C) contradicts the mapping rule. Exact R (D) would miss the logical span. This relationship guides memory‑capacity planning.

Q13. A process with base 20000 attempts to access logical address 500. What physical address will be used?

A.20500 ✅
B.200500
C.2050
D.21000
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The MMU adds the base (R = 20000) to the logical address (500), giving 20000+500=2050020000+500=20500. Therefore option A is correct. Option B misplaces a zero, C is too small, and D adds an extra 5000. Calculating the sum demonstrates how relocation works in practice.

Q14. If the relocation register is set to 15000 and a program stores pointer 1200, later uses it for a load, what physical address is accessed?

A.16200 ✅
B.1500
C.1200
D.1620
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When the load occurs, the MMU adds the current base (15000) to the stored logical pointer (1200), resulting in 15000+1200=1620015000+1200=16200. Hence A is correct. Options B and C ignore the base, and D mistakenly divides the sum. This illustrates that pointers are translated only at the moment of memory access.

Q15. Two processes A and B have bases 10000 and 20000 respectively. Both access logical address 300. Which physical addresses are accessed?

A.A: 10300, B: 20300 ✅
B.A: 300, B: 300
C.A: 10300, B: 300
D.A: 10000, B: 20000
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Process A translates to 10000+300=1030010000+300=10300 and B to 20000+300=2030020000+300=20300; therefore option A lists the correct pair. The other options either ignore the base or give incomplete mappings. This scenario shows how distinct bases keep processes isolated even with identical logical addresses.

Q16. A system runs out of physical memory; using this MMU scheme, what limitation arises?

A.Processes cannot be loaded beyond available space ✅
B.Logical addresses become larger than physical ones
C.Relocation registers stop working
D.All pointers become zero
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: When physical memory is exhausted, there is no room to place a process at its required base, so new processes cannot be loaded—option A. Logical‑to‑physical mapping still works mathematically (B), the registers themselves remain functional (C), and pointers retain their values (D). Recognizing this limitation connects address translation to overall memory capacity.

Q17. Suppose a program incorrectly assumes physical addresses start at 0. What error occurs?

A.Segmentation fault due to out‑of‑bounds access ✅
B.Faster execution
C.No effect on the program
D.Automatic correction by the OS
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: If the program adds offsets to an assumed zero base, it will address locations that the MMU maps to unintended physical regions, often causing illegal accesses and a segmentation fault—option A. Execution speed (B) is unrelated, and the OS does not silently fix such logic errors (D). Understanding this mistake highlights why programs must treat addresses as logical.

Q18. If the relocation register is changed from 14000 to 16000 during execution, what happens to previously stored pointers?

A.They continue to map using the old base value ✅
B.They automatically update to the new base
C.They become invalid and cause a crash
D.They are discarded by the MMU
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Stored pointers retain the logical value they held; when later used, the current base (now 16000) is added, so they are translated with the new base, not the old one. Thus A is correct: the old base is not remembered. Options B and D describe behavior not present in this scheme, and C exaggerates the effect. This nuance is key for developers handling dynamic bases.

Q19. A programmer wants to map a logical address range 0–4095 to physical addresses 8000–12095. What value should the relocation register hold?

A.8000 ✅
B.4000
C.12095
D.0
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: To map logical 0 to physical 8000, the relocation register must contain 8000, because the translation is R+LR+L. Hence option A is correct. Using 4000 (B) would map 0 to 4000, 12095 (C) would map 0 to 12095, and 0 (D) would leave addresses unchanged. This simple calculation shows how the base determines the whole range.

Q20. Given max logical address 65535 and R = 50000, what is the highest physical address?

A.115535 ✅
B.65535
C.50000
D.1155350
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The highest physical address is R+max=50000+65535=115535R+max = 50000 + 65535 = 115535. Option A matches this sum. Option B omits the base, C gives only the base, and D adds an extra zero. Performing the addition demonstrates how the relocation register expands the addressable space.

Q21. If a process attempts to access a logical address beyond max, what MMU response is appropriate?

A.Raise a protection fault ✅
B.Wrap around to zero
C.Ignore the excess bits
D.Automatically allocate more memory
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Accessing an out‑of‑range logical address violates the process's address space limits, so the MMU raises a protection (or segmentation) fault—option A. Wrapping (B) would corrupt data, ignoring bits (C) defeats protection, and automatic allocation (D) is not part of simple relocation. This behavior enforces memory safety.

Q22. Given a program that creates pointer p = 250, then increments p by 100, what physical address will be accessed after relocation with R = 14000?

A.15250
B.14350 ✅
C.14150
D.15200
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: After increment, p equals 250+100=350250+100=350. The MMU adds the base: 14000+350=1435014000+350=14350. Wait, that matches option B, not A. Correction: the correct physical address is 14350, so the correct answer is B. Option A adds the base to the original pointer, C adds incorrectly, and D miscalculates. This demonstrates how pointer arithmetic combines with relocation at the moment of access.

Q23. A system with this MMU wants to implement simple segmentation; how could the relocation register be used?

A.Load a different base for each segment ✅
B.Ignore segmentation and use a single base
C.Use the register to store segment limits
D.Replace the MMU with a segment table
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: By loading a new base value before accessing each segment, the same relocation mechanism can act as a rudimentary segment selector—option A. Ignoring segmentation (B) defeats the purpose, storing limits (C) is not what the register does, and swapping the MMU (D) is unnecessary. This shows how the basic scheme can be extended.

Q24. During dynamic loading, a module is loaded at physical address 30000. What logical address will the program see if R = 30000?

A.0 ✅
B.30000
C.30001
D.1
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Dynamic loading places the module at physical 30000, and the relocation register is set to the same value, so logical address 0 maps to physical 30000. Thus the program perceives the module starting at logical 0—option A. The other options either repeat the physical address or add offsets, which are not how logical addresses are presented.

Q25. If two processes share a common library loaded at different physical locations, how does each see its own logical addresses?

A.Each process uses its own relocation register value ✅
B.Both processes see the same physical addresses
C.The OS copies the library into a single location
D.Logical addresses are merged into one space
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Each process has its own relocation base, so the same logical address (e.g., 0) maps to different physical locations, preserving independence—option A. Sharing the same physical region (B) would cause conflicts, copying (C) defeats sharing benefits, and merging spaces (D) is not part of this scheme. This illustrates per‑process address translation.

Q26. A bug causes the relocation register to be set to 0 for a process that expects base 12000. What memory region will be incorrectly accessed?

A.The region starting at physical address 0 ✅
B.The region starting at physical address 12000
C.The region starting at physical address 24000
D.No region will be accessed incorrectly
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: With a zero base, logical address 0 maps to physical 0, so any reference that should have been offset by 12000 will instead hit the low‑memory region—option A. The expected region (B) is missed, and C doubles the intended offset. Recognizing this error shows why correct base initialization is critical.

Q27. How would you modify the scheme to support multiple segments with different bases?

A.Introduce a segment selector that chooses a base per segment ✅
B.Use a single larger relocation register
C.Eliminate the relocation register entirely
D.Assign each process a unique base only
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Adding a segment selector that picks the appropriate base before translation allows multiple segments, each with its own base—option A. A larger register (B) still provides only one base, removing it (C) loses translation, and assigning one base per process (D) does not give per‑segment flexibility. This extension builds on the original concept.

Q28. In a scenario where the MMU adds R to every address, how can you compute the physical address for a given logical address L?

A.Physical = R + L ✅
B.Physical = R − L
C.Physical = L / R
D.Physical = R × L
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The translation rule is simply Physical=R+LPhysical = R + L; therefore option A is correct. Subtracting, dividing, or multiplying (options B‑D) do not follow the defined relocation behavior. This straightforward calculation is the core of the scheme and helps students quickly determine actual memory locations.

Q29. If a program stores a pointer to logical address 0 in memory, later the OS changes the relocation register to 5000, what address will be accessed when the pointer is used?

A.5000 ✅
B.0
C.15000
D.5000 plus whatever offset is added later
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: When the pointer (logical 0) is finally used, the current base value (5000) is added, so the accessed physical address is 5000+0=50005000+0=5000—option A. The pointer does not retain the old base, so option B is wrong, and options C and D introduce unnecessary calculations. This scenario highlights that relocation is applied at use time, not at storage time.

Q30. For a process with base register 14000, what is the result of comparing two pointers 100 and 200 before relocation?

A.100 < 200, so the comparison is true ✅
B.Both pointers are equal after relocation
C.200 < 100, so the comparison is true
D.Comparison cannot be performed
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Pointer comparison uses the logical values directly; therefore 100 is less than 200, making the statement true—option A. Relocation does not affect the comparison because it occurs only when the pointers are used for memory access. Options B and C misinterpret the effect of relocation, and D denies a basic operation.

Q31. Why is it important for the MMU to perform relocation at the moment of memory access rather than earlier?

A.It allows the same logical address to map to different physical locations over time ✅
B.It reduces the number of registers needed
C.It speeds up instruction decoding
D.It prevents the need for a compiler
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Performing relocation at access time means the base can change during execution, enabling dynamic loading and process movement—option A. Reducing registers (B) or speeding decoding (C) are not primary reasons, and compilation (D) is unrelated. This timing ensures flexibility and supports modern operating‑system techniques.

🔗 Related Topics (MCQs)