NAME: STUDENT ID:
General Instructions: • Write your name and student ID clearly above. • You have 1 hour and 15 minutes to write the exam. No extra time will be given. • There are 4 questions in the exam, all with subparts. The questions combine for a maximum of 100 points. • You must write your answers clearly in the space provided for each question. You might use the backside of each page, as well as any additional sheets as required. If you are using additional space, you must clearly label the question no. that you are answering. Any loose sheets must have your name and student ID written clearly. • The exam is open book/open notes, however, no exchange of materials is allowed. You must use your own notes/book. • Electronic devices (laptops, notebooks, PDAs, cell phones, etc.) are strictly prohibited. • Read each question carefully before answering. • Good luck with the exam!
For Grading Use Only
1 2 3 4 TOTAL
1. Consider a 32-bit machine with 128 MB of physical memory, that uses virtual memory and demand paging for memory management. If the page size is 4 KB, answer the following questions. (Note: For ease of calculation, you can assume 1K=1000, 1M=1000K, etc.) (a) (3 pts) How many physical frames are there in the system? Ans: 128M = 32K 4K (b) (3 pts) What is the maximum number of pages that a process can have in its virtual address space? Ans: The amount of virtual address space addressable by each process = 232 = 4GB. Therefore, maximum number of pages = 4G = 1M 4K (c) (12 pts) Suppose the page table for a process P contains the following entries. Page No. 3 2 1 0 Frame No. 1 3 4 7
Specify what physical address does each of the following virtual addresses maps to? Show your calculations here. i. 3456 Ans: Note that a virtual address can be represented in terms of its page number and offset within the page as follows: Virtual address = Page no.* Page