Convert the following virtual addresses (in hexadecimal) to the equivalent physi
ID: 3557681 • Letter: C
Question
Convert the following virtual addresses (in hexadecimal) to the equivalent physics addresses. Please answer a,b and c and show how you got the answer. PLEASE DO NOT COPY FROM THE INTERNET. Solve the question using the same numbers in the question below.. Thanks
The page table shown in Figure 9.32 is for a system with 16-bit virtual and physical addresses and with 4,096-byte pages. The reference bit is set to 1 when the page has been referenced. Periodically, a thread zeroes out all values of the reference bit. A dash for a page frame indicates the page is not in memory. The page-replacement algorithm is localized LRU, and all numbers are provided in decimal. Convert the following virtual addresses (in hexadecimal) to the equivalent physical addresses. You may provide answers in either Page table for Exercise 9.22. hexadecimal or decimal. Also set the reference bit for the appropriate entry in the page table. Using the above addresses as a guide, provide an example of a logical address (in hexadecimal) that results in a page fault. From what set of page frames will the LRU page-replacement algorithm choose in resolving a page fault?Explanation / Answer
a)
* here total bit for virtual address = 16bit
size of page = 4k = 2^12 = 12bit hence offset = 12bit
bit for no. of pages = 16-12 = 4bit = 2^4 pages = 16 pages
for E12C = hence page number = E = 14 and offset = 12C
for page number 14 frame number = 3 from table.
hence frame number in hexadecimal = 3
hence physical address = 312C(offset will remain same)
* for 3A9D = hence page number = 3 in hex = 3 in dec and offset = A9D
for page number 3 frame number = 10 from table.
hence frame number in hexadecimal = A (10 in dec)
hence physical address = AA9D(offset will remain same)
* for A9D9 = hence page number = A = 10 and offset = 9D9
for page number 10 frame number = 5 from table.
hence frame number in hexadecimal = 5
hence physical address = 59D9(offset will remain same)
* for 7001 = hence page number = 7 = 7 and offset = 001
for page number 7 frame number = 15 from table.
hence frame number in hexadecimal = F
hence physical address = F001(offset will remain same)
*for ACA1 = hence page number = A = 10 and offset = CA1
for page number 10 frame number = 5 from table.
hence frame number in hexadecimal = 5
hence physical address = 5CA1(offset will remain same)
b) C001,C121 etc will give page fault because
page number = C in hex = 12 in dec
for page number 12 there is no frame...hence page error will occur
c) LRU will replace that frame which is least recently used in mapping