You are on page 1of 2

CSE 3320 Homework Assignment 5 (Fall 2021)

Due date: Noon 11/10 (Wednesday)

(1) Assume that a logical address is 32-bit long. Size of physical address is 30-bit, page size is 4
Kbyte and size of each page table entry is 32-bit. The main memory is byte addressable. What’s
the maximum number of bits that can be used for storing protection and other information in
each page table entry? (10 points)

(2) Given a 32-bit address space, and an 8KiB page size, how is the address split into page numbers
and offset for a 2-level page table, assuming that the outer page table fits exactly in one page?
Assuming 4-byte page table entries, how many bytes are “wasted” due to unused entries? (10
points)

(3) 10.1 Under what circumstances do page faults occur? Describe the actions taken by the operating
system when a page fault occurs. (10 points)

(4) 10.2 Assume that you have a page-reference string for a process with m frames (initially all
empty). The page-reference string has length p, and n distinct page numbers occur in it. Answer
these questions for any page-replacement algorithms: (10 points)
a. What is a lower bound on the number of page faults?
b. What is an upper bound on the number of page faults?

(5) 10.8 Consider the following page reference string: 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6.


How many page faults would occur for the following replacement algorithms, assuming FOUR
frames? Remember that all frames are initially empty, so your first unique pages will cost one
fault each. (30 points)
a) LRU replacement
b) FIFO replacement
c) Optimal replacement

(6) 10.15 Assume that a program has just referenced an address in virtual memory. Describe a
scenario in which each of the following can occur. (If no such scenario can occur, explain why.) .
(10 points)
a) TLB miss with no page fault
b) TLB miss with page fault
c) TLB hit with no page fault
d) TLB hit with page fault

(7) 10.18 The following is a page table for a system with 12-bit logical and physical addresses and
256-byte pages. Free page frames are to be allocated in the order 9, F, D. A dash for a page frame
indicates that the page is not in memory. . (20 points)
Convert the following logical addresses to their equivalent physical addresses in hexadecimal. All
numbers are given in hexadecimal. In the case of a page fault, you must use one of the free frames to
update the page table and resolve the logical address to its corresponding physical address.
• 0x2A1
• 0x4E6
• 0x94A
• 0x316

You might also like