{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# a5 - CMPT 300 Assignment 5 Jake Wang 953022102 1 There are...

This preview shows pages 1–2. Sign up to view the full content.

CMPT 300 Assignment 5 Jake Wang 953022102 1. There are 2^32 / 2^7 = 2^25 memory addresses. Time to compact = (read + write) * access time * number of memory addresses = 2 x 10ns x 2^25 = 671 ms 2. First fit: (a) 20K (b) 10K (c) 18K Best fit: (a) 12K (b) 10K (c) 9K Worst fit: (a) 20K (b) 18K (c) 15K Next fit: (a) 20 KB (b) 18K (c) 9K 3a. There will be 12 bits page offset for 4KB pages and 13 bits for 8KB pages. Therefore: 2000010 = 01001110001000002. The page offset for both 4KB and 8KB pages is 3616. The VPN for 4KB is 4 (0100) while the VPN for 8KB page size is 2 (010). 3b. 3276810 = 10000000000000002. The page offset is 0 for both 4KB and 8KB pages. The VPN for 4KB is 8 and the VPN for 8KB page size is 4 . 3c. 6000010 = 11101010011000002. The page offset is 2656 for both 4KB and 8KB pages. The VPN for 4KB is 14 and the VPN for 8KB page size is 7. 4. For a one-level page table, there are 2^32/2^12 = 2^20 pages entries. For two-level paging, the main page table has 2^10 entries with each pointing to a second page table. Since only two entries are needed here, the total number of page table entries will be 3 (ie. 1 entry in first level table and 2 in each of the lower-level tables).

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}