This homework is due on May 14, 2019 at 6pm in class.

This homework is due on May 14, 2019 at 6pm in class.

Page size = frame size Logical address space (size) = 2m Physical address space (size) = 2x (where x is the number of bits in physical address) Logical address space (size) = # of pages ? page size Physical address space (size) = # of frames ? frame size Page size= frame size= 2n # Of pages= 2m-n # Of entries (records) in page table = # of pages

Question 1 Consider a computer system with a 32-bit logical address and 4-KB page size. The system supports up to 512 MB of physical memory. How many entries are there in each of the following?

A conventional single-level page table.

# of pages= # of entries = ? Size of logical address space = 2m = # of pages ? page size 232 = # of pages ? 212 # Of pages =232 / 212= 220 pages

Question 2 Consider a logical address space of 256 pages with a 4-KB page size, mapped onto a physical memory of 64 frames.

a. How many bits are required in the logical address?

Method 1 Logical address space (/size) = 2m Logical address space (/size) = # of pages ? page size Logical address space (/size) = 256 ? 4 KB Logical address space (/size) = 256 ? 4096 Logical address space (/size) = 1048576 Logical address space (/size) = 220 m = 20 (Answer)

Method 2 Page size = 2n 4096 = 212 n = 12

# of pages = 2m ?n 256 = 2m ? 12 28 = 2m ? 12 28 + 12 = 2m

m = 20 b. How many bits are required in the physical address?

Let x be the number of physical addresses Physical address space (/size) = 2x Physical address space (size) = # of frames ? frame size Physical address space (size) = 64 ? 4 KB Physical address space (size) = 64 ? 4096 Physical address space (size) = 26 ? 212 = 218 Number of required bits in the physical address=x =18 bit

Question 3 Assuming a 1-KB page size, what are the page numbers and offsets for the following address references (provided as decimal numbers):

a. 3085 b. 42095 c. 215201 d. 650000 e. 2000001

Answer size = 2n = 1KB = 1024 = 210 # of bits in offset part (n) =10 Solution steps:

1. Convert logical address: Decimal to Binary 2. Split binary address to 2 parts (page #, Offset), offset: n digits 3. Convert offset & page #: Binary to Decimal

a. 3085 Decimal = 3085 Binary = 000000110000001101 Page # = 011 = 3 Page offset = 0000001101 = 13

b. 42095 Decimal = 42095 Binary = 1010010001101111 Page # = 101001 = 41 Page offset = 0001101111 = 111

c. 215201 Decimal = 215201 Binary = 110100100010100001 Page # = 11010010 = 210 Page Offset 0010100001 = 161

d. 650000 Decimal: 650000 Binary: 10011110101100010000 Page #: 1001111010 = 634 Page Offset: 1100010000 = 784

e. 2000001 Decimal Binary: 111101000010010000001 Page # = 11110100001 = 1953 Page Offset: 0010000001 = 129

Question 4 What is the purpose of paging the page tables?

Question 5 Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4,999. The drive is currently serving a request at cylinder 2,150, and the previous request was at cylinder 1,805. The queue of pending requests, in FIFO order, is: 2,069, 1,212, 2,296, 2,800, 544, 1,618, 356, 1,523, 4,965, 3681

Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests for each of the following disk-scheduling algorithms? a. FCFS b. SSTF c. SCAN e. C-SCAN

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download