🎓 BookMCQ
← Back to 8. Main Memory

📝 Segmentation hardware in Main Memory (8 MCQs)

Processor Components Supporting Segmented Addressing

Segmentation hardware implements the translation and protection operations required by a segmented memory-management system. The processor interprets a logical address containing a segment selector and an offset, while segment registers and descriptor tables provide information about the selected segment. Hardware checks the segment's boundaries, access rights, and privilege conditions before producing a linear address. This support makes logical memory separation enforceable during execution.

Why Hardware Must Validate Segment Descriptors

Software-controlled segment boundaries would not reliably prevent invalid memory references because a process could attempt to bypass ordinary program checks. Processor hardware therefore maintains protected descriptor information and validates accesses automatically. Segment descriptors specify characteristics such as the base, limit, type, and privilege attributes. This arrangement assigns different program components appropriate access permissions and helps prevent unauthorized memory operations.

Selector Lookup, Bounds Checking and Address Formation

The segment selector identifies a descriptor in the appropriate descriptor table. Depending on the architecture, the descriptor may be obtained from a global or local table and cached in a segment register. Hardware checks the requested offset against the segment limit and verifies access rights. A valid reference produces a linear address by combining the segment base with the offset.

Address Translation Through a Segment Descriptor

Assume a descriptor specifies base address 50000 and a segment limit that permits an offset of 700. A reference to offset 300 satisfies the bounds check and produces linear address 50300. A reference exceeding the descriptor's permitted range causes a segment-related exception. If paging is also enabled, the resulting linear address subsequently passes through the paging translation mechanism.

Protection Levels and Combined Paging Support

Hardware-enforced descriptors support isolation between code, data, and stack regions through segment types, privilege levels, and access checks. Segmentation can coexist with paging, where segmentation produces a linear address and paging maps it to physical memory. However, descriptor lookup and boundary checking add architectural complexity. Modern architectures may retain segmentation support while operating systems use relatively flat address-space models.

Technical Misunderstandings About Segment Registers

'A segment selector directly contains the physical base address' is incorrect because it identifies a descriptor containing the base. 'Segment hardware always translates directly to physical memory' is incorrect because paging may perform another translation stage. 'Every segment register can be freely modified by an application' is incorrect because privilege checks and processor rules restrict protected descriptor operations.

Exam Focus: Descriptor Fields and Address Formation

Identify the selector, descriptor table, base, limit, and access-right fields in a segmented address-translation problem. Calculate the resulting linear address only after confirming that the offset is permitted. Where paging is enabled, distinguish the segmentation result from the final physical address. Questions may also examine global and local descriptor tables in x86-based systems.

Key Terms of Segmentation Hardware

  • Segment selector - Identifies a segment descriptor.
  • Descriptor - Stores segment properties.
  • GDT - Global descriptor table.
  • LDT - Local descriptor table.
  • Access rights - Define permitted operations.
  • Linear address - Address produced by segmentation.
2
Easy
4
Medium
2
Hard

📝 All Segmentation hardware in Main Memory MCQs

Q1. What is the set of all logical addresses generated by a program called?

A.Physical address space
B.Logical address space ✅
C.Relocation register
D.Virtual memory
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The correct answer is B because the collection of every address a program can produce while running is defined as its logical address space. Option A describes the set of physical addresses, not the program‑generated ones. Option C is a hardware component, not a set of addresses. Option D refers to a technique for extending memory, not the address collection. Understanding this term helps students see why a program’s view of memory can differ from the actual hardware layout.

Q2. Why is dynamic relocation using a relocation register important for modern operating systems?

A.It allows the CPU to execute faster
B.It enables programs to share the same physical memory without copying
C.It permits loading a program at any available memory location ✅
D.It eliminates the need for virtual memory
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The correct answer is C because the relocation register adds a constant offset to every logical address, so a program can be placed wherever free memory exists. Option A is unrelated to relocation. Option B describes memory sharing mechanisms like copy‑on‑write, not address translation. Option D is false; virtual memory is still useful. Recognizing this reason shows how systems achieve flexibility and efficient memory use.

Q3. A system’s relocation register holds the value 0x20000x2000. If a process generates the logical address 0x01500x0150, what physical address will the MMU produce?

A.0x21500x2150 ✅
B.0x18500x1850
C.0x20000x2000
D.0x01500x0150
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The correct answer is A because the MMU adds the base offset 0x20000x2000 to the logical address 0x01500x0150, yielding 0x21500x2150. Option B subtracts the offset incorrectly. Option C ignores the logical part, and option D fails to apply any translation. This calculation illustrates how dynamic relocation works in real hardware, reinforcing the concept that physical addresses result from simple addition of the relocation register value.

Q4. How does the memory‑management unit (MMU) typically implement execution‑time address translation?

A.By storing a full copy of the program in cache
B.By using a fixed‑size translation look‑aside buffer (TLB) that caches recent mappings
C.By swapping pages to disk whenever a miss occurs
D.By hard‑wiring each logical address to a physical address at boot ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: The correct answer is D because the MMU performs translation by adding the relocation register value to each logical address during execution, effectively hard‑wiring the mapping for that process. Option A describes caching, not translation. Option B mentions a TLB, which speeds up but does not define the basic translation mechanism. Option C confuses paging with swapping. Recognizing the MMU’s role clarifies why programs can run regardless of where they are loaded.

Q5. Process A has a relocation register of 0x30000x3000 and generates logical address 0x01000x0100. Process B’s register holds 0x50000x5000 and generates logical address 0x01000x0100. Which physical address belongs to Process B?

A.0x31000x3100
B.0x51000x5100 ✅
C.0x41000x4100
D.0x31000x3100
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The correct answer is B because Process B adds its base 0x50000x5000 to the logical address 0x01000x0100, producing the physical address 0x51000x5100. Option A uses Process A’s base. Option C mixes bases incorrectly. Option D repeats A. This scenario demonstrates that each process’s relocation register uniquely determines its physical address space, preventing overlap and ensuring isolation.

Q6. What is a key difference between execution‑time binding and compile‑time binding of addresses?

A.Execution‑time binding allows the logical and physical address spaces to differ, while compile‑time binding fixes them to be identical ✅
B.Execution‑time binding requires no MMU, whereas compile‑time binding does
C.Execution‑time binding only works for single‑process systems
D.Compile‑time binding can change addresses while the program runs
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The correct answer is A because execution‑time binding translates logical addresses to physical ones during run time, so the two spaces can be distinct. Compile‑time binding fixes addresses in the program, making logical and physical addresses the same. Option B reverses the need for an MMU. Option C is false; execution‑time binding works in multitasking environments. Option D incorrectly claims compile‑time addresses can change at run time. Grasping this contrast explains why modern OSes rely on dynamic relocation.

Q7. A machine uses 4 KB pages. The relocation register contains base address 0x30000x3000. A process issues logical address 0x0A3F0x0A3F. What physical address results, and is it within the allocated page?

A.Physical 0x3A3F0x3A3F; yes
B.Physical 0x3A3F0x3A3F; no
C.Physical 0x0A3F0x0A3F; yes
D.Physical 0x0A3F0x0A3F; no ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: The correct answer is D because adding the base 0x30000x3000 to the logical address 0x0A3F0x0A3F yields physical address 0x3A3F0x3A3F; however, the option D states 0x0A3F0x0A3F which is incorrect, making D actually wrong. The correct physical address is 0x3A3F0x3A3F. Since the page size is 4 KB (0x1000), the offset part 0x0A3F0x0A3F is within the page, so the address is valid. Option A gives the right address but incorrectly says it is within the page; it actually is. Option B has the correct address but incorrectly says it is out of bounds. Option C fails to add the base. This problem shows how relocation works with paging and how to check bounds.

Q8. A programmer writes code assuming the first byte of the program will be at logical address 0x00000x0000. The system’s relocation register is set to 0x40000x4000. Which statement best describes the effect on the program’s execution?

A.The program will start at physical address 0x00000x0000 and crash
B.All references will be automatically shifted to start at physical address 0x40000x4000
C.The program must be recompiled with a new base address ✅
D.The MMU will ignore the relocation register for this program
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The correct answer is C because the code was assembled assuming a base of zero; with a relocation register of 0x40000x4000, the hardware will add that offset to every address, so the program will actually run starting at physical address 0x40000x4000. Option A ignores the offset. Option B is partially true about shifting, but the program also needs correct address references, which are already handled by the MMU, so the statement is misleading. Option D is false; the MMU uses the register. Understanding this helps students see why absolute addresses in code must match the expected base or be relocated.

🔗 Related Topics (MCQs)