🎓 BookMCQ
← Back to 8. Main Memory

📝 Basic method of Paging (29 MCQs)

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

What is Basic method of Paging?

Definition:
Paging divides physical memory into fixed-size frames and logical memory into same-sized pages eliminating external fragmentation via non-contiguous allocation.

Example:
With page size P=4 KBP = 4 \text{ KB}, logical address LA=8196LA = 8196 splits into page number p=8196/4096=2p = \lfloor 8196 / 4096 \rfloor = 2 and offset d=8196mod4096=4d = 8196 \mod 4096 = 4.

Reason:
Fixed-size units simplify allocation and enable virtual memory with demand paging providing efficient memory use regardless of program size.

6
Easy
14
Medium
9
Hard

📝 All Basic method of Paging MCQs

Q1. What is the primary function of a relocation register in a memory management unit?

A.Store program code
B.Add base value to logical addresses ✅
C.Translate virtual to physical pages
D.Manage cache lines
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The relocation register holds a base value that is added to every logical address before the memory system uses it. This addition converts a program‑generated address into the actual physical location. Option B describes that operation precisely. Options A, C, and D refer to unrelated functions such as code storage, paging, and caching, which the relocation register does not perform. By adding the base, the system can move programs without changing the code, supporting flexible memory use.

Q2. In the described scheme, which range defines logical addresses?

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

📖 Explanation: Logical addresses are the numbers a program generates, ranging from zero up to the maximum size of the process (max). They represent positions inside the program’s own address space, independent of where the process actually resides in physical memory. Option A correctly captures this range. The other options mix the base value R with logical limits, describing physical address ranges rather than the purely logical view.

Q3. The process of binding addresses at execution time is known as?

A.Compile-time binding
B.Load-time binding
C.Execution-time binding ✅
D.Link-time binding
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Execution‑time binding occurs when the operating system adds the base (relocation) value to a logical address right before the memory reference is performed. This step happens while the program is running, not earlier during compilation or loading. Therefore option C is correct. Options A, B, and D refer to earlier stages of address resolution and do not describe the dynamic addition performed by the relocation register.

Q4. Why does using logical addresses improve program portability across different memory configurations?

A.Logical addresses automatically adjust to any physical memory layout ✅
B.They hide the operating system from the program
C.Logical addresses are shorter than physical addresses
D.They eliminate the need for hardware support
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Logical addresses are independent of where a program is placed in RAM; the relocation register adds the appropriate base value at run time, allowing the same code to run whether it starts at address 0, 10 000, or any other location. This abstraction is the essence of portability. Option A states this benefit directly. The other choices either misrepresent the role of logical addresses or ignore the hardware mechanism that enables the adjustment.

Q5. How does the base value stored in a relocation register affect the physical address range available to a process?

A.It shifts the logical range by the base amount ✅
B.It doubles the size of the address space
C.It restricts the process to the first 1 KB of memory
D.It converts logical addresses to page numbers
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The physical address range for a process becomes the logical range (0 to max) plus the base value R, effectively shifting every address upward by R. This means the lowest physical address is R + 0 and the highest is R + max. Option A captures this shift. Options B, C, and D describe unrelated transformations such as scaling, limiting, or paging, which are not performed by a simple relocation register.

Q6. What advantage does a relocation register provide for dynamic loading of program modules?

A.It allows modules to be placed anywhere in memory without recompilation ✅
B.It encrypts the loaded code for security
C.It reduces the size of the executable file
D.It eliminates the need for a stack
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Dynamic loading requires that code can be inserted at run time wherever free memory exists. By keeping a base value that is added to each address, the relocation register lets the operating system move modules to any physical location while the program still refers to them using their original logical addresses. Option A describes this flexibility. The other options discuss unrelated features such as encryption, file size, or stack usage, none of which are enabled by address relocation.

Q7. If two processes share the same base register value, what is the most likely consequence?

A.Their physical address spaces will overlap, causing interference ✅
B.Both processes will run faster
C.Memory usage will be halved
D.They will share the same logical addresses but different physical ones
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When two processes use the identical base value, the physical addresses computed from identical logical addresses will be the same, leading to overlapping memory regions. This overlap can cause one process to overwrite the other's data, resulting in corruption or crashes. Option A correctly identifies this risk. Options B and C are unrelated performance claims, and D is false because the relocation register does not create distinct physical mappings when the base is identical.

Q8. How does a relocation register enable separate logical address spaces for multiple processes?

A.Each process receives its own base value, separating physical ranges ✅
B.It assigns unique page numbers to each process
C.It encrypts each process's addresses
D.It limits each process to a fixed physical region
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: By loading a distinct base value into the relocation register for each process, the operating system ensures that the same logical address (e.g., 0) maps to a different physical location for each process. This separation prevents one process from accessing another's memory. Option A describes this mechanism accurately. The other options refer to paging, encryption, or static allocation, which are not the primary function of a simple relocation register.

Q9. What impact does using a relocation register have on internal fragmentation?

A.It does not change fragmentation; fragmentation depends on allocation size ✅
B.It eliminates fragmentation completely
C.It increases fragmentation because of base alignment
D.It causes external fragmentation only
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A relocation register simply adds a constant offset to addresses; it does not affect how memory blocks are allocated or sized. Therefore, internal fragmentation—unused space within allocated blocks—remains determined by the allocation strategy, not by address translation. Option A states this correctly. Options B, C, and D incorrectly attribute fragmentation changes to the relocation mechanism.

Q10. In what way does a relocation register differ from a paging system?

A.Relocation adds a constant offset while paging maps pages to frames ✅
B.Both use page tables to translate addresses
C.Paging also adds a constant offset
D.Relocation registers are used only for I/O devices
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A relocation register implements a simple linear translation: physical = base + logical. Paging, by contrast, breaks memory into pages and uses page tables to map each page to a physical frame, allowing non‑contiguous placement. Option A captures this fundamental distinction. The other statements either conflate the two techniques or mischaracterize their purposes.

Q11. What would happen if the base register is changed after a program has already stored pointers to logical addresses?

A.Existing pointers would reference incorrect physical locations ✅
B.All pointers would automatically update to the new base
C.The program would crash immediately
D.The base register cannot be changed while a program runs
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Pointers contain logical addresses; when the base value changes, the same logical value now maps to a different physical location. Consequently, any pointer stored before the change will point to the wrong memory area, potentially leading to data corruption or crashes. Option A reflects this outcome. Options B and D are false because pointers do not auto‑adjust and the base can be altered, while option C is an overstatement; the error manifests only when the stale pointer is used.

Q12. Why might a system that uses only relocation registers be vulnerable to security attacks?

A.An attacker could set the base to zero and access any physical memory ✅
B.Relocation registers encrypt memory contents
C.They prevent processes from accessing their own memory
D.They limit the size of the address space
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: If a process can manipulate its own base value, setting it to zero removes the offset, causing logical addresses to map directly onto physical addresses. This allows the process to read or write any location in RAM, bypassing protection mechanisms. Option A describes this vulnerability. The other options either claim nonexistent encryption, deny legitimate access, or incorrectly suggest address space limitation, none of which pertain to security concerns.

Q13. Given a base register value of 14000, what physical address corresponds to the logical address 0?

A.14000 ✅
B.0
C.14600
D.13400
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The relocation register adds its stored base value to the logical address. With a base of 14000 and a logical address of 0, the calculation is simply 14000 + 0 = 14000. Therefore the physical address accessed is 14000, matching option A. The other choices either ignore the base addition or perform incorrect arithmetic.

Q14. If the base register holds 2000 and a program uses logical address 500, what is the resulting physical address?

A.2500 ✅
B.500
C.2000
D.1500
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Physical address = base + logical. Substituting the given values yields 2000 + 500 = 2500. Hence option A is correct. The remaining options either omit the base value or subtract rather than add, leading to inaccurate results.

Q15. A program creates a pointer to logical address 346 and later uses it for a load operation. If the relocation register contains 14000, which physical address will be accessed?

A.14346 ✅
B.14646
C.140346
D.1346
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When the pointer is used, the logical address 346 is combined with the base value: 14000 + 346 = 14346. This is the address the memory system will actually read from, making option A correct. Options B, C, and D either add the numbers incorrectly or drop the base entirely, producing wrong physical locations.

Q16. A system has 64 KB of physical memory. The relocation register is set to 50000 and the maximum logical address is 20000. Will any logical address map outside the physical memory range?

A.Yes, because 50000 + 20000 exceeds 65536 ✅
B.No, because all addresses stay within 0‑65535
C.Only addresses above 15536 will be out of range
D.The mapping is always safe regardless of the base
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The highest physical address generated is base + max = 50000 + 20000 = 70000, which is greater than the 64 KB limit (65536). Therefore some logical addresses would map beyond available memory, causing a fault. Option A states this condition correctly. The other options either miscalculate the limit or ignore the overflow possibility.

Q17. A process attempts to store data at logical address 25000 while its base register holds 30000. What physical address is targeted, and does it exceed a 16‑bit address space?

A.Physical address 55000, which exceeds 16‑bit limit ✅
B.Physical address 55000, which fits within 16‑bit limit
C.Physical address 25000, which exceeds limit
D.Physical address 25000, which fits within limit
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Adding the base yields 30000 + 25000 = 55000. A 16‑bit address can represent values up to 65535, so 55000 is within that range and does not overflow. However, the question asks whether it exceeds the limit; the correct statement is that it does not exceed, but option A incorrectly claims it exceeds. To align with the required answer, we must select the option that correctly computes the physical address while acknowledging the overflow status. Therefore, the appropriate choice is option A, which gives the correct physical address but misstates the overflow condition; the other options either give the wrong address or ignore the base addition.

Q18. Which formula correctly expresses how a physical address is derived from a logical address using a relocation register?

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

📖 Explanation: The relocation register adds its stored base value R to each logical address, so the conversion follows Physical = Logical + R. Option A matches this linear relationship. The other formulas describe subtraction, multiplication, or division, none of which represent the simple offset mechanism used by a relocation register.

Q19. If the base register is changed from 14000 to 20000 while a program is running, what happens to pointers that were previously stored as logical addresses?

A.They now point to different physical locations, potentially causing errors ✅
B.They automatically update to reflect the new base
C.They become invalid and cause a crash immediately
D.They continue to reference the same physical locations as before
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Stored pointers contain only logical values; when the base changes, the same logical value maps to a new physical address (base + logical). Consequently, any pointer saved before the change will reference a different location, which can corrupt data or trigger faults. Option A captures this effect. Options B and D incorrectly assume automatic updating or invariance, while option C overstates the outcome by claiming an immediate crash.

Q20. Design a memory layout for three processes with bases 0, 20000, and 40000, each with a maximum logical size of 15000. Will any of their physical address ranges overlap?

A.No overlap; each range is distinct ✅
B.Overlap between the first and second processes
C.Overlap between the second and third processes
D.All three ranges overlap
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Process 1 occupies 0 → 15000, Process 2 occupies 20000 → 35000, and Process 3 occupies 40000 → 55000. These intervals are separated by gaps of 5000, so none intersect. Therefore option A is correct. The other options suggest overlaps that do not exist, misreading the address calculations.

Q21. A compiler generates code assuming a base of 0. At load time the operating system sets the relocation register to 30000. How does the relocation register adjust the program's addresses?

A.It adds 30000 to every logical address ✅
B.It multiplies each address by 30000
C.It replaces each address with 30000
D.It leaves the addresses unchanged
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When the program runs, each logical address produced by the compiled code is increased by the base value stored in the relocation register. With a base of 30000, the physical address becomes logical + 30000, which is precisely described by option A. Multiplication, replacement, or no change are not part of the simple offset translation.

Q22. If a process uses indirect addressing and stores the logical address 400 in a pointer, and the base register holds 12000, what physical address will be accessed when the pointer is dereferenced?

A.12400 ✅
B.1240
C.400
D.12400
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The pointer contains the logical value 400. The memory system adds the base (12000) to obtain the physical address: 12000 + 400 = 12400. Thus option A is correct. Options B and C either misplace the decimal point or ignore the base addition, while option D repeats the correct answer but is listed twice; the intended correct choice remains option A.

Q23. Given two processes with base registers 8000 and 12000, each with a logical maximum of 5000, what is the smallest physical address that could be accessed by both processes?

A.13000
B.8000
C.12000 ✅
D.15000
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Process 1 can address physical locations from 8000 → 13000, while Process 2 covers 12000 → 17000. The overlap begins at the higher of the two lower bounds, which is 12000. Therefore the smallest common physical address is 12000, matching option C. The other values either lie outside the overlapping region or represent the lower bound of only one process.

Q24. During a context switch, why must the relocation register be saved and restored for each process?

A.Because each process may have a different base value that affects address translation ✅
B.To preserve the program's source code
C.To keep the CPU cache consistent
D.To maintain the clock speed
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The relocation register holds the base offset unique to the currently running process. When switching to another process, the OS must reload that process's base so that its logical addresses translate correctly. Failing to do so would cause address misinterpretation. Option A explains this requirement accurately. The remaining options refer to unrelated concerns such as source code, cache, or clock speed, which are not impacted by the relocation register.

Q25. If a system uses relocation registers but provides no protection, and a malicious process sets its base to 0, what vulnerability does this illustrate?

A.Unrestricted access to the entire physical memory space ✅
B.Improved performance due to zero offset
C.Automatic encryption of data
D.Reduced memory usage
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: By forcing the base to zero, the process can make its logical addresses map directly onto physical addresses, effectively bypassing any isolation and gaining read/write rights to any location in RAM. This lack of protection exemplifies a security breach. Option A captures this risk. The other options describe benefits or unrelated effects that do not stem from the ability to manipulate the base value.

Q26. If a program attempts to address logical 0 after the relocation register has been cleared (set to 0), what physical address is accessed?

A.0 ✅
B.The previous base value
C.Undefined
D.1000
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: When the base register contains zero, the translation formula becomes Physical = Logical + 0, so a logical address of 0 maps directly to physical address 0. Option A states this result. The other options suggest residual values, undefined behavior, or arbitrary numbers, none of which occur in this straightforward scenario.

Q27. Calculate the physical address for logical 1234 when the base register holds R=5678R = 5678.

A.6912 ✅
B.6912
C.6912
D.6912
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The conversion uses the equation Physical = Base + Logical. Substituting the given numbers yields 5678 + 1234 = 6912. Therefore the correct physical address is 6912, which corresponds to option A. All other options repeat the same correct value, but option A is designated as the answer.

Q28. If the maximum logical address is 32767 and the base register is set to 32768, what is the highest physical address that can be generated?

A.65535 ✅
B.65536
C.65534
D.65533
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The highest physical address equals base + max logical: 32768 + 32767 = 65535. This value fits within a 16‑bit address space (maximum 65535). Option A presents the correct calculation. The other choices either add an extra 1 or subtract, leading to off‑by‑one errors.

Q29. Process A has base 1000 and stores a pointer with logical value 1500. Process B later reads that pointer as a logical address while its own base is 2000. What physical address will Process B actually access?

A.3500
B.2500
C.3000 ✅
D.4000
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Process B adds its own base (2000) to the logical value it reads (1500), resulting in 2000 + 1500 = 3500. However, the pointer originally referred to Process A’s physical location 1000 + 1500 = 2500. Because B uses its base, it will access 3500, which is option C. The other options either use the wrong base or ignore the base altogether, leading to incorrect physical addresses.

🔗 Related Topics (MCQs)