



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A university computer science midterm exam from the university of california, berkeley, department of electrical engineering and computer sciences, computer science division, cs 162, fall 2003. The exam covers topics such as principles of locality, virtual memory, disk scheduling, inode table, and page replacement. Students are required to answer questions related to these topics, including defining and distinguishing the principles of temporal and spatial locality, calculating page size and memory consumption in a virtual memory system, determining the order of request servicing in different disk scheduling algorithms, and analyzing the number of page faults in various page replacement algorithms.
Typology: Exams
1 / 6
This page cannot be seen from the preview
Don't miss anything!




College of Engineering Department of Electrical Engineering and Computer Sciences Computer Science Division
CS 162, Fall, 2003 Prof. Alan Jay Smith
Midterm 2, October 29, 2003
In a computer with 32-bit virtual address (A virtual address specifies a byte number) we subdivide the virtual address into 4 pieces as follows: 8-bit, 4-bit, 8-bit, 12-bit. We use a 3-level page table, such that the first 8 bits are used to index the page table for the first level, 4 bits for the second level, 8 bits for the third level, and 12 bits for the byte within page. Each page table entry is 48 bits, and contains a physical address (42 bits), 3 protection bits, valid, reference and dirty bits. Answer the following questions, showing how you reach the answer. A simple number will not receive any credit.
a. What is the page size in such a system? Explain your answers. (4)
b. How much memory is consumed by the page table, and how much is wasted by internal fragmentation for a process that has 64K of memory starting at address 0? (Don’t forget to include internal fragmentation in the page table.) Assume that we don’t allocate any page tables that have no valid entries in them. (6)
c. What is an inverted page table? If you use a global (i.e. shared by all processes, with a process ID) inverted page table, and you want to ensure that the page table was never more than 50% full, and the physical memory size is 32 MB, how many entries does the page table have? Why?
Given the following reference string: 5 4 3 2 5 4 6 5 4 3 2 6
determine the number of page faults when there are 3 or 4 page frames, for each of LRU, OPT and FIFO replacement.
Show your work.