
Homework 2: CS 423, Fall 2007
Klara Nahrstedt/Sam King
Posted: November 26, 2007
Deadline: December 3, Midnight,
Delivery: Upload the HW2 to the Compass
Important: The homework effort is an Individual Effort. Any detected
group effort will be punished according the class cheating policies.
Problem 1 (20Points) : Virtual Memory
1. (6 Points) For each of the following decimal virtual addresses, compute the virtual
page number and offset for a 4-KB page and for an 8-KB page: 20000, 32768, 60000.
2. (2 Points) If an instruction takes 10 nsec and a page fault takes an additional n nsec,
give a formula for the effective instruction time if page faults occur every k instructions.
3. (2 Points) A machine has 48-bit virtual addresses and 32-bit physical addresses. Pages
are 8 KB. How many entries are needed for the page table?
4.. (6 Points) It has been observed that the number of instructions executed between page
faults is directly proportional to the number of page frames allocated to a program. If the
available memory is doubled, the mean interval between page faults is also doubled.
Suppose that a normal instruction takes 1 µsec, but if a page fault occurs, it takes 2001
µsec (i.e., 2msec to handle the fault). If a program takes 60 sec to run, during which time
it gets 15,000 page faults, how long would it take to run if twice as much memory were
available?
5. (4 Points) A computer provides each process with 65,536 bytes of address space
divided into pages of 4096 bytes. A particular program has a text size of 32,768 bytes, a
data size of 16,386 bytes, and a stack size of 15,870 bytes. Will this program fit in the
address space? If the page size were 512 bytes, would it fit? Note: a page may not contain
parts of two different segments.