A machine has 48-bit virtual addresses and 32-bit physical addresses. Pages are 8K. How many entries are needed for a conventional page table ?
The answer is 2^35 entries
Why not (2^32) / (2^13) = 2^19 entries...?
My doubt here is why does the number of page table entries depend on virtual address space rather than physical address space?
What does it mean to have more virtual address space than physical address space? The process can only access as many pages present in the physical memory. So it makes sense to have same have both virtual and physical memory address space same. But why have more virtual address space? Does it mean 2 different virtual address entries are mapped to the same physical location in the same page table? Guess that would lead to inconsistency right? Can someone help me get the bigger picture here..... I really need to internalize this concept.
Asked By : Ryan sams
Answered By : Kaustabha Ray
When we are using Virtual Memory, we are translating from a Virtual Address Space to a Physical Address Space.
To understand why it requires $2^{35}$ entries, consider the page size. In order to byte address $8$KB, we require $2^{13}$ entries. If we consider the Virtual Address given to us of $48$ bits, this gives us $48-13=35$ bits. These are the bits that are used for indexing into the page table for determining the address of the page or 'frame' in main memory.
The reason for having more virtual memory is because programs were getting so large that they couldn't be fit in main memory. So in order to allow a greater degree of multiprogramming, virtual memory was introduced. A program could have a 'large' memory to itself. However only rhe required parts would be loaded into memory as and when required a concept refered to as Demand Paging.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/52464
0 comments:
Post a Comment
Let us know your responses and feedback