Consider a machine that has 24-bit virtual addresses and 20-bit physical address
ID: 657269 • Letter: C
Question
Consider a machine that has 24-bit virtual addresses and 20-bit physical address. This machine uses a paging scheme, with 1K byte pages. A process page table has the following entries:
The left-most collumn is just counting to 4 (0, 1, 2, 3)
The V bit (valid bit) is 1 if the page is in memory, 0 if it is not. The page frame values are in binary. The process generates a virtual address with the hexadecimal value 000803. What is the corresponding physical address?
I lack a more conceptial understanding of how paging works when allocating memory, so any further descriptions would be much appreciated!
V PAGE FRAME 0 1 00 1101 1100 1 0 01 1100 0011 2 1 00 1110 1001 3 1 00 0110 1101Explanation / Answer
Given,
Size of Virtual address = 24 bit address
Size of Physical address=20-bit address
No. of pages= 1KB=2^10
The virtual memory consists of fixed size pages and the size of page is 2^n bytes. That is, 2^24 bytes. The vitrual address consists of page number and byte offset. The number of addressable page are 2^24/2^10=2^14.
The physical memory consists of frame number and byte offset. The maximum addressable physical memory is 2^14*2^10=2^24.
A pagetable is a data structure in memory. It holds the mapping of virtual address to physical address.
Given the virtual address is 000803 that is 083 decimal value.
The offset for the address is 083 mod 256=83
The logical/virtual page number is 083/256=0
In the given translation table the logical page 0 resides in 0011011100=220(physical page number).
So, the physical address=220*256+83=56403(in decimal)
=0D0C53(in hexadecimal).
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.