Exercise #1: a. 20 logical page number = 20 / 8192 = 0 offset in page = 20 - 0 * 8192 = 20 physical frame = 13 (from page table) physical address: 13 * 8192 + 20 = 106516 b. 9100 logical page number = 9100 / 8192 = 1 offset in page = 9100 - 8192 * 1 = 908 physical frame = 8 (from page table) physical address: 8 * 8192 + 908 = 66444 c. 50321 logical page number = 50321 / 8192 = 6 page fault! d. 81589 logical page number = 81589 / 8192 = 9 offset in page = 81589 - 8192 * 9 = 7861 physical frame = 2 (from page table) physical address: 2 * 8192 + 7861 = 24245 ------------------------------- Exercise #2: a. There are 32 pages, so the logical page number is 5-bit There are 2^{11} bytes in a page, so the offset is 11-bit Therefore, logical addresses are 16-bit b. There are 8 frames, so there are 2^{3} * 2^{11} = 2^{14} bytes in RAM. Therefore, physical addresses are 14-bit ------------------------------- Exercise #3: a. A process can have an address space up to 2^{32} bytes, and each page is 2^{13} bytes. Therefore, an address space can have up to 2^{32 - 13} = 2^{19} pages. Therefore, there would be 2^{19} entries in a conventional 1-level page table. b. There are 2^{31} bytes in RAM, so there are 2^{31 - 13} = 2^{18} frames in RAM. Therefore, an inverted page table would have 2^{18} entries. ------------------------------- Exercise #4: a. The logical address space contains 2^{38} bytes, and a page is 2^{15} bytes. Therefore there are 2^{38 - 15} = 2^{23} pages in the logical address space. b. - The offset is 15-bit (because a page is 2^{15}-byte) - A frame is 2^{15} bytes and a page table entry is 8 bytes. Therefore, a frame can contain 2^{15 - 3} = 2^{12} page table entries. This is the "inner" page number - The "outer" page number is then whatever remains: 38 - 15 - 12 = 11. ---------------------------- The split is thus: | 11-bit | 12-bit | 15-bit | ---------------------------- c. The process address space itself contains 2^{33}/2^{15} = 2^{18} pages Each inner page table points to 2^{12} pages, so we need 2^{18} / 2^{12} = 2^{6} of them And then we need one outer page table page. Total: 2^{18} + 2^{6} + 1