🎓 BookMCQ
← Back to 8. Main Memory

📝 Address binding in Main memory (13 MCQs)

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

What is Address binding in Main memory?

Definition:
Address binding is the process of mapping symbolic or logical addresses to physical memory locations at compile time, load time, or run time using base registers or MMU translation.

Example:
When a program references variable xx at logical address 0x10000x1000, the OS binds it to physical address 0x7F0010000x7F001000 during loading by adding the base register value.

Reason:
Binding enables multiprogramming and memory protection by decoupling program code from fixed physical locations allowing flexible memory management.

4
Easy
6
Medium
3
Hard

📝 All Address binding in Main memory MCQs

Q1. Which component of the operating system is primarily responsible for converting symbolic addresses to physical memory locations when a program is loaded?

A.Assembler
B.Linker
C.Loader ✅
D.Compiler
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The loader reads the executable file, applies the address binding information, and maps the program’s symbolic addresses to actual physical addresses. The assembler only translates assembly code to machine code, the linker resolves external references but does not perform the final mapping, and the compiler works at a higher level before code generation. Understanding the loader’s role clarifies how programs become ready for execution in real hardware.

Q2. Why is it important for an operating system to perform address binding at load time rather than at compile time?

A.It allows the program to run on any memory configuration
B.It reduces the size of the executable file ✅
C.It eliminates the need for virtual memory
D.It speeds up the CPU clock
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Address binding at load time adapts the program to the actual memory layout present when it runs, but it does not affect the executable file size. Binding at compile time would fix addresses, limiting portability. Virtual memory and CPU speed are unrelated to the timing of binding. Recognizing this distinction helps students see why loaders handle binding dynamically.

Q3. How does static address binding differ from dynamic address binding in terms of flexibility and memory usage?

A.Static binding uses fixed physical addresses, increasing flexibility
B.Dynamic binding requires recompilation for each run
C.Static binding limits relocation, while dynamic binding allows programs to share memory efficiently ✅
D.Dynamic binding always results in larger binaries
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Static address binding fixes addresses at compile or load time, making relocation difficult and preventing memory sharing. Dynamic binding, often implemented with relocation tables, lets the OS place programs anywhere in memory, enabling sharing of common code and better utilization of RAM. This contrast highlights why modern systems favor dynamic binding for efficiency and flexibility.

Q4. A program compiled for a system with a 32‑bit address space is loaded on a machine that supports 64‑bit addresses. Which binding strategy ensures the program runs correctly without modification?

A.Static binding at compile time
B.Dynamic binding with relocation tables ✅
C.Hard‑coded absolute addresses
D.Link‑time address resolution
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Dynamic binding uses relocation tables that the loader can adjust to the actual memory addresses at run time, allowing a 32‑bit program to execute on a 64‑bit system. Static binding would fix addresses unsuitable for the new environment, and hard‑coded absolute addresses would likely reference invalid locations. Link‑time resolution occurs before loading, so it cannot adapt to the runtime address space.

Q5. During execution, a process attempts to access memory address 0x7FFF F000, but the OS maps it to a different physical frame. Which mechanism is responsible for this translation?

A.Paging ✅
B.Segmentation
C.Address binding performed by the loader
D.Cache coherency protocol
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Paging divides memory into fixed‑size pages and uses a page table to translate virtual addresses like 0x7FFF F000 to physical frames. Segmentation uses variable‑size segments, which is a different scheme. The loader’s address binding occurs before execution, establishing initial mappings, while cache protocols handle data consistency, not address translation. Knowing paging’s role clarifies how modern OSes manage virtual‑to‑physical address conversion.

Q6. A developer writes a program that uses a shared library compiled for a different version of the OS. Which binding technique allows the program to locate and use the correct library at run time?

A.Static linking
B.Dynamic linking ✅
C.Compile‑time binding
D.Hard‑coded library paths
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Dynamic linking defers the resolution of library functions until the program runs, enabling the OS to locate the appropriate version of the shared library and resolve addresses then. Static linking incorporates library code at compile time, preventing version flexibility. Compile‑time binding is similar to static linking, and hard‑coded paths limit portability. Understanding dynamic linking helps explain how programs can adapt to evolving library versions.

Q7. What advantage does logical address abstraction provide to programmers when writing portable code?

A.It hides the physical memory size ✅
B.It guarantees faster execution
C.It eliminates the need for error handling
D.It fixes the program’s binary size
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Logical addresses allow programmers to write code without knowing the actual physical memory layout, making the program portable across systems with different memory capacities. This abstraction does not directly affect execution speed, error handling, or binary size. Recognizing this benefit explains why operating systems expose logical addresses rather than raw physical addresses.

Q8. Consider a system where a process’s code segment must be relocated to a different base address each time it is loaded. Which binding approach best supports this requirement?

A.Static binding with absolute addresses
B.Dynamic binding with relocation information
C.Compile‑time address resolution
D.Hard‑wired address mapping ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Hard‑wired address mapping would fix the code at a single location, contradicting the need for relocation. Static binding with absolute addresses also lacks flexibility. Dynamic binding with relocation information enables the loader to adjust the base address at load time, satisfying the requirement. Understanding these options illustrates why dynamic binding is essential for relocatable code.

Q9. A program uses an array of size 1024 integers. If the system uses a page size of 4 KB, how many pages will the array occupy?

A.One page ✅
B.Two pages
C.Four pages
D.Eight pages
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Each integer typically occupies 4 bytes, so the array uses 1024×4=40961024 \times 4 = 4096 bytes, exactly one page of 4 KB. Therefore, the array fits within a single page. Miscalculations might assume more pages by overlooking the exact match between array size and page size. This example shows how address binding interacts with paging to determine memory allocation.

Q10. Why might an operating system choose to perform address binding at run time rather than at load time for certain processes?

A.To reduce compilation time
B.To allow address space randomization for security ✅
C.To increase disk I/O speed
D.To simplify the linker design
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Run‑time address binding enables techniques such as address space layout randomization (ASLR), which randomizes where code and data are placed in memory, enhancing security by making exploits harder to predict. It does not affect compilation speed, disk I/O, or linker simplicity directly. Recognizing the security motive clarifies why some systems defer binding until execution.

Q11. In a system that supports both paging and segmentation, which component primarily handles the translation from a logical address to a physical address?

A.The segment table
B.The page table ✅
C.The loader
D.The CPU cache
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: When both paging and segmentation are used, the logical address is first divided into a segment selector and offset; the segment table locates the segment, then the offset is further divided into page number and offset within the page, which the page table translates to a physical frame. Thus, the page table performs the final mapping. Understanding this hierarchy helps students see how multiple translation mechanisms cooperate.

Q12. Which term describes the address that a program uses while it is executing, independent of its actual location in physical memory?

A.Physical address
B.Logical address
C.Absolute address
D.Virtual address ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: A logical or virtual address is the address a program sees during execution; it is independent of where the operating system places the program in physical memory. Physical addresses refer to actual hardware locations, while absolute addresses are fixed values that do not change. Recognizing the distinction helps learners grasp why address translation is necessary.

Q13. A system uses a base register to add a constant offset to all addresses of a process. What kind of address binding does this represent?

A.Static binding
B.Dynamic binding with relocation
C.Base‑relative binding ✅
D.Segmented binding
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Base‑relative binding adds a constant offset (the base register value) to each logical address at run time, allowing the process to be relocated without changing the code. This is a form of dynamic binding because the actual physical address is calculated during execution. It differs from static binding, which fixes addresses at compile or load time, and from segmented binding, which uses segment descriptors.

🔗 Related Topics (MCQs)