# How to find the virtual pages and physical memory frames?

So i am given a system of 20 bits virtual addresses and 18 bits physical addresses using paging with pages size 4Kbytes. I am told to find the maximum number of virtual pages that a process can have and the maximum number of physical memory frames the system can have.

So 2^12 page size makes 12 bits for offset and 8 bits for page number right? and 2^8 is 256 is the maximum virtual pages that a process can have? Correct me if im wrong.

And for the second one im having kind of trouble. Ive seen a post about a similar question but didn't really understand it. Is it 2^18 bits for physical address multiplying it with the page size like (2^18)*4096 to get the maximum physical memory frames?

Also a last part gives me the following:

00110110011110111100

and says the virtual page containing the address is mapped onto physical frame 45, give the corresponding physical address in binary format. How do i find that?

So 2^12 page size makes 12 bits for offset and 8 bits for page number right? and 2^8 is 256 is the maximum virtual pages that a process can have? Correct me if im wrong.

you are correct

maximum number of physical memory frames the system can have.

the size of frames is the same as the size of pages

so you have 18 bit for physical memory, which 12 bit of that is needed for the offset, now you are left with 6 bit which means you can have $2^6$ frames.

Also a last part gives me the following:

00110110011110111100

and says the virtual page containing the address is mapped onto physical frame 45, give the corresponding physical address in binary format. How do i find that?

00110110 011110111100

so the 12 bits from the right are for the offset which you dont need to change, the remaining 8 bit which is 00110110 needs to be replaced with 45 and instead of 8 bit we would use 6 bit to map into physical address

therefore the physical address would be 101101 011110111100

this means that in the 54th row (00110110) of our page table for that process we would find the corresponding frame for that page to be 45 (101101)

• i cannot thank you enough for that. Sorry for the late reply Jul 24, 2018 at 14:07
• I would have upvoted your answer but i don't have enough reputation :( Jul 24, 2018 at 14:09
• @IanTwy no problem, your welcome :) Jul 24, 2018 at 15:21