🎓 BookMCQ
← Back to 8. Main Memory

📝 Example of x86 64 bit Architectures (8 MCQs)

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

What is Example of x86 64 bit Architectures?

Definition:
x86-64 employs four-level paging with canonical addresses, NX bit, and PCID support enabling efficient 64-bit virtual memory with enhanced security.

Example:
Virtual address 0xFFFF8000123456780xFFFF800012345678 uses PML4→PDPT→PD→PT hierarchy with bits [47:39], [38:30], [29:21], [20:12] indexing respective tables.

Reason:
Four-level structure balances table size and lookup depth for 48-bit usable space while NX prevents code execution in data regions mitigating exploits.

2
Easy
4
Medium
2
Hard

📝 All Example of x86 64 bit Architectures MCQs

Q1. A compiler places a global integer variable in the global data segment, which has segment number 2. The variable is located 0x1F4 bytes from the start of that segment. Which logical address correctly refers to the variable?

A.<2, 0x1F4>
B.<0x1F4, 2> ✅
C.2:0x1F4
D.0x1F4:2
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The tuple <2, 0x1F4> correctly pairs the segment number (2) with the offset (0x1F4) that points to the variable inside the global data segment. Option B swaps the two fields, making the offset appear as the segment identifier, which the loader cannot interpret. Option C uses a colon syntax that is not the defined <segment, offset> format, and option D reverses the order entirely. Using the proper tuple ensures the CPU computes the right linear address, allowing the program to access the intended memory location.

Q2. What is the main advantage of representing memory addresses as <segment-number, offset> rather than as a single linear address in x86-64?

A.It allows the CPU to skip the paging hardware.
B.It enables programmers to think in terms of independent modules.
C.It reduces the size of the address bus.
D.It eliminates the need for virtual memory. ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: Representing addresses as <segment-number, offset> lets programmers view memory as separate logical units—code, data, stack—without needing to know their absolute positions. This abstraction simplifies program design and linking because each module can be placed anywhere in physical memory while retaining the same logical references. Options A and C describe unrelated hardware effects, and option D incorrectly claims virtual memory is unnecessary. The modular view is essential for building large, relocatable applications on x86-64 systems.

Q3. Module A is loaded with a code segment numbered 1, base address 0x400000, and limit 0x2000. Module B is loaded later; the OS renumbers its code segment to 3, base address 0x402000. If an instruction in module B jumps to offset 0x1500 within its code segment, what physical address is accessed?

A.67245312 ✅
B.4199680
C.4207872
D.67325952
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The OS assigned module B a base address of 0x402000 and a segment number of 3. Adding the offset 0x1500 yields the physical address 0x402000 + 0x1500 = 0x403500. Option A adds the offset to the wrong base, producing 0x4021500. Option B uses the base of module A, and option D inserts an extra zero, making the address unrealistic. The correct calculation demonstrates how the segment‑offset pair is translated during execution, preventing crashes caused by mis‑addressing.

Q4. During address translation, how is the offset part of a logical address used after the segment base is obtained?

A.It is added to the segment base to form the linear address.
B.It replaces the segment base. ✅
C.It is ignored if paging is enabled.
D.It determines which page table entry to use.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Once the CPU retrieves the base address for the specified segment, it adds the offset to that base to obtain the linear (or virtual) address used for further translation. Option B suggests the offset replaces the base, which would lose the segment context. Option C claims the offset is ignored when paging is active, which is false because paging operates on the resulting linear address. Option D confuses the offset with page‑table indexing. Adding the offset ensures the instruction references the correct location within the segment.

Q5. A stack segment has segment number 4, base physical address 0x600000, and limit 0x10000. A pointer uses logical address <4, 0x0F00>. What physical address does it refer to?

A.100667136 ✅
B.6295296
C.100732672
D.393456
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The physical address is found by adding the offset 0x0F00 to the segment’s base 0x600000, giving 0x600000 + 0x0F00 = 0x600F00. Option A inserts an extra zero, making the address too large; option C adds the offset to a non‑existent higher base; option D truncates the offset, producing an incorrect address. Understanding this calculation is vital for debugging pointer errors in low‑level code, as an incorrect physical address can lead to data corruption or crashes.

Q6. Why do low‑level implementations typically use numeric segment identifiers instead of textual segment names?

A.Numbers are easier for the assembler to parse. ✅
B.Numeric IDs allow faster indexing in the descriptor tables.
C.Names would increase the size of the address bus.
D.Numbers prevent segment aliasing.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Numeric segment identifiers map directly to entries in the segment descriptor tables, allowing the CPU to index them quickly using simple arithmetic. Textual names would require additional translation layers, slowing down address resolution. Option A is partially true but not the primary reason for performance. Option C exaggerates the impact on the address bus, and option D suggests numbers prevent aliasing, which is unrelated. Fast indexing is crucial for the high‑throughput demands of modern x86‑64 processors.

Q7. A program attempts to write to offset 0x12000 within a stack segment whose limit is 0x10000. Which hardware mechanism will raise an exception, and what type of exception is generated?

A.The segment limit check will raise a General Protection Fault.
B.The page fault handler will raise a Page Fault. ✅
C.The CPU will silently truncate the address.
D.The OS will raise a Segmentation Violation signal.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: When the offset exceeds the segment’s defined limit, the CPU’s segment‑limit check triggers a General Protection Fault (GPF), a type‑13 exception indicating an illegal memory reference. Option B describes a page fault, which occurs only after the linear address passes paging checks. Option C incorrectly claims the CPU silently truncates the address, which would hide bugs. Option D mentions an OS signal, which is a software response after the hardware exception. The GPF protects the system by halting execution before an out‑of‑bounds write can corrupt memory.

Q8. In x86‑64, how do segmentation and paging interact to produce the final physical address?

A.Segmentation produces a linear address, which is then translated by paging to a physical address.
B.Paging produces a linear address, which is then segmented to a physical address. ✅
C.Both mechanisms operate independently and their results are ORed together.
D.Segmentation is disabled when paging is enabled.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: In x86‑64, the segment selector yields a base address that, combined with the offset, forms a linear address. This linear address then passes through the paging subsystem, which translates it to a physical address using page tables. Option B reverses the order, which is inaccurate. Option C suggests an OR operation, which does not occur. Option D claims segmentation is disabled when paging is on, but segmentation still provides the base for the linear address. Understanding this two‑step translation is essential for writing correct low‑level code and for debugging address‑related faults.

🔗 Related Topics (MCQs)