Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Convert the following virtual addresses (in hexadecimal) to the equivalent physi

ID: 3557678 • 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-byts 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 many provide answers in either 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 URU page-replacement algorithm choose in resolving a page fault?

Explanation / Answer

To determine the page of a given memory address, take the first P bits (of the N bit) number.

P = lg2(numberOfPages)
In your example, P=lg2(16)=4

So the first 4 bits of a given memory address will tell us the page. That means the rest should be the offset from the start of that page.

Your example address, 51996, is 1100101100011100 in binary. I.e. [1100:101100011100].

1100 (12 in decimal) is the page number
101100011100 (2844 in decimal) is the offset

Now we need to find where page 12 is in memory.
Looking at your frame table, it appears that page 12 is resident in the 6th frame. In a system where all memory is pageable (i.e. no memory mapped IO) the 6th page frame will be at(entriesPerPage*pageNum)-1

In this case, 4000*6-1 = 23999 (The "-1" is needed since memory is 0-indexed.)

Now all we have to do is add the offset and we have the physical memory address:

23999 + 2844=26843 = 0x68DB

Done!