How do virtual address spaces and hardware address translation give processes an isolated view of memory?
Vm Online Quiz Questions
Use this free practice quiz with 20 questions to review Vm, test your knowledge, and prepare for your next test or exam.
Select all statements that correctly describe how virtual memory can enable processes to share physical memory.
- A
Virtual addresses in different processes can map to the same physical address.
- B
Processes needing the same B bytes of data can share those physical bytes instead of keeping a separate copy for each process.
- C
Processes can share a read-only memory region containing library code.
- D
Processes can communicate through a memory region that they share.
True or false: A page fault always means that the accessed page was swapped out to disk.
- A
True
- B
False
What is the name of the special on-chip cache that stores page-table information to reduce address-translation costs?
During a context switch, the OS sets the RISC-V register to the physical address of the incoming process’s page table, which the MMU then uses for address translation.
Explain how the valid bit and the R, W, and X protection bits in a page-table entry govern access to a virtual page. Include the purpose of the W^X restriction.
For a system with 4 kB pages, a virtual address has VPN v and offset o, and the page table maps v to PPN p. Which expression gives the physical address?
- A
PPN×212+offset
- B
VPN×212+offset
- C
PPN×212+VPN
- D
PPN×212
Select all statements that correctly explain dense page-table space costs and how multi-level page tables can help with sparse virtual address spaces.
- A
A dense page table stores entries for every virtual page, including invalid pages.
- B
A multi-level page table can reduce wasted space when allocated pages are scattered across a large virtual address space.
- C
A multi-level page table stores a separate entry for every byte rather than every page.
- D
A multi-level page table is a tree-shaped alternative that can provide sparsity benefits at lower cost than the described hash-table approach.
True or false: When a program maps a file into memory, the entire file must be read into physical memory immediately, before the program accesses the mapped region.
- A
True
- B
False
What is the name of the RISC-V register that the OS sets during a context switch to identify the active page table?
Processors use a to cache page-table information and reduce the cost of address translation.
A Unix program uses mmap to associate a virtual-memory region with a file. Which statement best describes how the file's contents become available to the program?
- A
The entire file must be read into main memory before the program can use the mapped region.
- B
The OS loads file pages on demand as the program accesses the mapped region.
- C
The program receives the file's physical disk addresses and reads the disk directly.
- D
The mapped region contains only a duplicate of the file created when the program starts.
A tree-shaped multi-level page table can reduce the space cost of representing a sparse virtual address space compared with a dense table.
- A
True
- B
False
For a 4,096-byte page, how many bits are used for the offset within the page?
How do virtual address spaces and hardware translation let two processes use the same virtual address without necessarily referring to the same data?
- A
The OS assigns every process a permanently separate range of physical addresses, and programs use those physical addresses directly.
- B
Programs in all processes use the same page table, which makes identical virtual addresses refer to the same data.
- C
Each process has its own virtual address space, and hardware translates its virtual addresses using that process's page table.
- D
The MMU changes each program's virtual addresses before the program executes its memory instructions.
Virtual addresses in different processes can map to the same physical memory, allowing the processes to share data.
- A
True
- B
False
What event occurs when a process accesses an invalid virtual page and control is transferred to the kernel?
A program tries to store data to a page whose W protection bit is zero. What does the page-table protection setting indicate?
- A
The R bit, which determines whether a page is mapped.
- B
The W bit, which determines whether a page can be written.
- C
The X bit, which determines whether a page can be read.
- D
The valid bit, which determines whether instructions may execute on a page.
Which single-letter R/W/X protection bit controls whether a process may write to a page?
What is the role of a translation lookaside buffer (TLB) in address translation?
- A
A special on-chip cache for page-table information.
- B
A disk area where the OS stores pages that have been swapped out.
- C
A register holding the physical address of the active page table.
- D
A tree-shaped structure that stores page-table entries only for allocated pages.
Related study packs and tools
- Study guide
02 — Information and Representation
A progressive guide to how computers encode numbers, text, images, and sound as binary data, including the trade-offs and limits of digital representation.
- Quiz
2 Digital Logic
A 14-question medium-difficulty quiz on Boolean algebra, logic gates, truth tables, and combinational circuits.
- Flashcards
03 — Python Programming Fundamentals
A focused set of flashcards covering Python variables, data types, expressions, control flow, functions, input, output, and common programming practices.
- Study guide
3 CPU Architecture
Learn how registers, the ALU, datapath connections, and control logic work together to fetch and execute CPU instructions.
- Study guide
05 — Data Structures: Concepts, Operations, and Trade-Offs
A structured guide to the main data structures, their operations, efficiency trade-offs, representations, and practical selection criteria.
- Study guide
6 Computer Memory
Learn how computer memory stores and addresses information, how RAM and ROM differ, and how caches and the memory hierarchy balance speed, capacity, and cost.
- Study guide
07 Trees and Binary Search Trees
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
- Flashcards
08 — Discrete Mathematics for Computer Science
A focused review of propositional logic, quantifiers, sets, relations, functions, and foundational proof methods in discrete mathematics for computer science.
- Study guide
8 Software Documentation
Learn how to choose, structure, document, and maintain software documentation for users, developers, integrators, and operators.
- Study guide
9 Sorting Algorithms
A structured guide to comparison-based sorting algorithms, their complexity, stability, memory use, and practical selection criteria.
- Study guide
10 — Data, Systems, and Applications
A progression through how data is organized, searched, exposed through software interfaces, and managed through abstraction layers in modern computer systems.
- Quiz
12 — Foundations Capstone
A medium-difficulty quiz on integrating problem definition, representation, algorithms, complexity analysis, testing, correctness, ethical evaluation, and documentation in a computer science capstone.