Challenge your understanding of memory management techniques and addressing modes with these carefully crafted questions. This quiz explores essential concepts such as paging, segmentation, relative addressing, and effective memory utilization, ideal for anyone interested in computer architecture and operating systems.
Which statement best describes demand paging in the context of memory management within a modern operating system?
Explanation: Demand paging improves memory efficiency by loading only the pages that a process requires, reducing memory waste. Loading the entire process before execution (option B) is a characteristic of contiguous allocation, not demand paging. Permanently storing pages in secondary memory (option C) ignores the dynamic nature of page transfers. Pre-fetching all referenced pages (option D) is not necessary and would increase memory usage, defeating the purpose of demand paging.
In assembly language, how does the direct addressing mode differ from the indirect addressing mode when accessing memory locations?
Explanation: Direct addressing accesses the memory location specified explicitly in the instruction, while indirect addressing first retrieves an address (from a register or another memory location) to access the data. Option B describes indexed addressing, not direct or indirect. Option C is incorrect; pointer arithmetic is associated with some indirect variants, but not required for direct mode. Option D is wrong because indirect addressing cannot use immediate values, which represent data, not memory locations.
What is the primary function of the Translation Lookaside Buffer (TLB) in virtual memory systems?
Explanation: The TLB acts as a cache for recently used page table entries, reducing address translation time and improving performance. Managing memory for new processes (option B) is part of the operating system's memory manager, not the TLB. Backing up memory to storage (option C) is the function of swapping or paging, not the TLB. The TLB does not increase physical memory size (option D); it simply makes address translation faster.
Which statement accurately describes segmentation in memory management, particularly regarding program structure and memory allocation?
Explanation: Segmentation reflects the program's natural divisions, like functions or arrays, and allocates variable-sized memory units accordingly. Option B describes paging, which uses fixed-size blocks. Segments do not have to match the size of main memory (option C). Option D is incorrect; segmentation can lead to external fragmentation, whereas paging minimizes it.
If an instruction uses relative addressing with an offset of 8 and the current program counter is at 200, what is the effective address accessed by the instruction?
Explanation: Relative addressing calculates the effective address by adding the offset (8) to the current value of the program counter (200), resulting in 208. Option B (192) mistakenly subtracts the offset. Option C (200) ignores the offset altogether. Option D (8) confuses the offset value for the effective address, which is incorrect.