retagged by
1,506 views
2 votes
2 votes
Consider a virtual memory system where, physical memory = 4GB page size = 4KB, page table entry size = 4B and 45-bit virtual address. Assume every page table exactly fits into a single page. If page table entry size is 4B then how many levels of page tables would be required.
retagged by

1 Answer

1 votes
1 votes
In a virtual memory system, the virtual address space is divided into pages, and each page is mapped to a physical address. The mapping between virtual and physical addresses is done using a page table.

In this case, the physical memory is 4GB, which is equal to 4 * 2^30 bytes. The page size is 4KB, which is equal to 4 * 2^10 bytes. Therefore, the number of pages in physical memory is 4 * 2^30 / (4 * 2^10) = 2^20 pages.

The page table entry size is 4B, which is equal to 4 * 2^3 bytes. Therefore, each page table can hold 2^(12-3) = 2^9 page table entries.

The virtual address space is 45-bit, which means that there are 2^45 different virtual addresses. To map all these addresses, we would need 2^45/2^12 = 2^33 page tables.

Since each page table can hold 2^9 page table entries, and we need 2^33 page tables to map all the virtual addresses, we would need 2^33 / 2^9 = 2^24 page tables.

Since each page table exactly fits into a single page, we would need 2^24 page tables to map all the virtual addresses. And since each page table is represented by one entry in the page table, we would require 2^24 page table entries.

Therefore, the number of levels of page tables would be 1.

Related questions

1 votes
1 votes
4 answers
1
pC asked Dec 11, 2015
2,430 views
In a paged virtual memory organization with 32 bit virtual address and 1 KB page size PTE is 32 bits. The number of levels of paging required to limit the outer page tab...
0 votes
0 votes
0 answers
3
0 votes
0 votes
1 answer
4
admin asked Oct 26, 2019
418 views
Can you think of any situations where supporting virtual memory would be a bad idea, and what would be gained by not having to support virtual memory? Explain.