🎓 BookMCQ
← Back to 8. Main Memory

📝 Basic method of Segmentation in Operating System (9 MCQs)

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

What is Basic method of Segmentation in Operating System?

Definition:
Segmentation divides memory into variable-sized logical segments (code, data, stack) reflecting program structure with each segment identified by name and length.

Example:
A compiler generates segment table entries for CODE(base=1000,limit=4096)\text{CODE}(base=1000, limit=4096) and STACK(base=8000,limit=2048)\text{STACK}(base=8000, limit=2048) accessed via s,d\langle s, d \rangle pairs.

Reason:
Logical grouping supports sharing, protection, and dynamic growth better than fixed partitions aligning memory view with programmer’s mental model.

2
Easy
5
Medium
2
Hard

📝 All Basic method of Segmentation in Operating System MCQs

Q1. A program generates a logical address 0x0150. The relocation register (base) is set to 0x2000. What physical address will the MMU produce?

A.8528 ✅
B.8192
C.336
D.13568
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The MMU adds the base value to the logical address, so 0x2000 + 0x0150 = 0x2150. Option A matches this calculation, making it correct. Option B omits the offset, option C uses the logical address unchanged, and option D adds an incorrect large offset. Understanding this addition shows how dynamic relocation maps virtual addresses to real memory, which is essential for running programs without compile‑time address fixes.

Q2. What is the primary function of a relocation register in dynamic address translation?

A.To store the size of the logical address space.
B.To hold the base address that is added to every logical address. ✅
C.To translate virtual page numbers to frame numbers.
D.To cache recently accessed physical addresses.
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The relocation register contains the base address that the MMU adds to each logical address, enabling the program to run at different locations in memory. Option B describes this role accurately. Option A confuses it with address‑space size, option C describes a page table function, and option D suggests caching, which is unrelated. Recognizing the register’s purpose clarifies how address translation works at run time.

Q3. Process P1 has base register 0x3000 and generates logical address 0x0100. Process P2 has base register 0x4000 and generates logical address 0x0100. Which statement is true about the resulting physical addresses?

A.Both processes map to the same physical address.
B.P2 maps to a lower physical address than P1.
C.P1 maps to a lower physical address than P2. ✅
D.The addresses cannot be determined without page size.
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Physical address = base + logical offset. For P1: 0x3000 + 0x0100 = 0x3100; for P2: 0x4000 + 0x0100 = 0x4100. Hence P1’s address (0x3100) is lower than P2’s (0x4100), making option C correct. Option A would be true only if bases were identical, option B reverses the order, and option D is irrelevant because the calculation does not need page size. This demonstrates how separate base registers keep processes isolated in memory.

Q4. Why does the execution‑time address‑binding scheme allow a program’s logical address space to differ from the physical address space?

A.Because the compiler fixes addresses at compile time.
B.Because the MMU can change the base address during program execution. ✅
C.Because the operating system reserves separate memory for each process.
D.Because physical memory is always larger than logical memory.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Dynamic binding uses a relocation register that the MMU adds to each logical address at run time, so the same logical address can map to different physical locations. Option B captures this mechanism. Option A describes static binding, option C refers to protection rather than address mapping, and option D is not a rule; logical spaces can be larger or smaller than physical memory. Recognizing this flexibility explains why modern OSes can load programs anywhere in RAM.

Q5. If a system has 64 KB of physical memory and supports programs with a maximum logical address of 32 KB, what is the minimum number of bits required for the relocation register?

A.8 bits
B.15 bits ✅
C.16 bits
D.6 bits
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The base can range from 0 to (64 KB − 32 KB) = 32 KB, which is 2^15 = 32768 possible values, requiring 15 bits to represent. Option B provides this count. Option A (8 bits) only covers 256 values, option C (16 bits) is more than needed, and option D (6 bits) covers 64 values. Knowing the range of the base register helps designers size the hardware correctly for dynamic relocation.

Q6. A program’s base register is changed from 0x1000 to 0x1800 while it is running. Which effect does this have on the mapping of its existing logical addresses?

A.All previously generated physical addresses become invalid.
B.The physical addresses shift by the same amount as the base change.
C.The logical addresses are unchanged, but future translations use the new base. ✅
D.The program must be restarted to apply the new base.
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Logical addresses remain the same; the MMU simply adds the new base for subsequent translations, leaving earlier physical addresses unchanged. Thus option C is correct. Option A would only be true if the system required re‑translation, option B incorrectly suggests retroactive shifting, and option D is unnecessary because the base can be updated on the fly. This illustrates that dynamic relocation permits moving a process without altering its code.

Q7. What is a key advantage of dynamic relocation using a relocation register compared to static relocation performed at load time?

A.It eliminates the need for a memory‑management unit.
B.It reduces the size of the logical address space.
C.It guarantees that all processes have the same physical address.
D.It allows a process to be moved in memory without changing its code. ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Dynamic relocation lets the operating system change the base register while the program runs, so the process can be shifted to a different memory region without recompiling or patching addresses. Option D describes this benefit. Option A is false because the MMU is still required, option B misstates address‑space size, and option C is impossible because each process occupies distinct physical locations. This advantage is critical for multitasking and memory‑sharing.

Q8. Suppose the MMU adds the base register value to a 16‑bit logical address. If the base register holds 0xF000 and a program generates logical address 0x2000, what happens during address translation?

A.The result wraps around, producing physical address 0x1000.
B.The translation triggers a trap because the address exceeds physical memory. ✅
C.The MMU ignores the base register and uses the logical address directly.
D.The physical address becomes 0x11000, which is valid in a 20‑bit physical space.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Adding 0xF000 and 0x2000 yields 0x11000, which needs 17 bits and exceeds the 16‑bit physical address limit (0xFFFF). The MMU therefore raises a protection fault or trap. Option B reflects this behavior. Option A would only occur with modulo arithmetic, which MMUs do not use for address translation. Option C ignores the relocation mechanism, and option D assumes a larger physical address space that is not given. Understanding this overflow helps prevent illegal memory accesses.

Q9. How does the set of all logical addresses generated by a program relate to the set of physical addresses produced by the MMU?

A.They are always identical sets.
B.The logical set is a subset of the physical set. ✅
C.The physical set is a subset of the logical set.
D.They are unrelated and mapped arbitrarily.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Every logical address is translated to a physical address, so the collection of physical addresses includes all those translations, making the logical set a subset of the physical set. Option B states this correctly. Option A would require one‑to‑one identity mapping, option C reverses the relationship, and option D ignores the systematic mapping performed by the MMU. Recognizing this subset relationship clarifies how address translation preserves program semantics while fitting into actual memory.

🔗 Related Topics (MCQs)