Consider a byte addressed memory system which has the following characteristics:
ID: 3837059 • Letter: C
Question
Consider a byte addressed memory system which has the following characteristics: The virtual address is 32 bits long. The page size is 2K bytes long. The physical address is 30 bits long. Consider the mapping from a virtual address to the corresponding physical address. Each page table entry contains a "valid" bit, a "dirty" bit, a disk address, and a frame number (the frame number is empty if the page is not in main memory.) Assume the disk address can be represented with the same number of bits as the frame number. Assume a page fault does not occur. Take 1K = 2^10, and 1 byte = 8 bits. (i) What is the size (i e, width in bits) of the (virtual) page number used to look up the page table? And do these bits constitute the low-order or high-order bits of the virtual address? (ii)What is the size of the page offset? And do these bits constitute the low-order or high-order bits of the virtual address? (iii) What is the size of the frame number? And do these bits constitute the low-order or high-order bits of the physical address? (iv) What is the size of the frame ofiset? And do these bits constitute the low-order or high-order bits of the physical address (v) How many entries are there in the page table? (vi) What is the total size (in bits) of the page table?Explanation / Answer
Question-1:
The virtual address is 32 bits long.
The page size is 2k bytes.
Physical address is 30 bits long.
Number of pages=2virtual address space/page size =232 /(210*2) =232-11 = 221
Therefore the size of the page number used to lookup the page table is 21.
These 21 bits constitute the most significant 21 bits in virtual address.
Question-2:
The size of page offset is determined by log(page size) / log2
Therefore the size of page offset is log211 / log2 = 11.
The least significant 11 bits of the virtual address denotes page offset and the rest 32-11=21 MSB denotes page number.
Question-3:
As page size in the virtual address space is same as the frame size in the main memory or in other way we can say that the number of pages is equal to the number of frames. Therefore the size of the frame number is 21 and these 21 bits constitute the MSB of physical address.
Question-4:
The size of frame offset = (size of physical address - size of frame number) = 30 - 21 = 9
The 9 least significant bits of the physical address constitute frame offset.
Question-5:
The size of page number is 21 bits.
Therefore we can address 221 = 2,097,152 number of pages.
Therefore 2,097,152 entries are there in the page table.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.