Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider a virtual memory with size 4GB while it only has a physical size of 1 G

ID: 3819646 • Letter: C

Question

Consider a virtual memory with size 4GB while it only has a physical size of 1 GB. Page size is 4KB. How many entries to the page table, how many total bits/bits per entry, and where is the page table stored 3. Consider a virtual memory with size 4GB while it has only 1GB of physical memory. Page size is 4KB. (a). How many entries to the page table? How many bits in each entry of the page table? How many total bits in the page table? (b) Where is the page table stored? where is the address of the page table stored?

Explanation / Answer

a) Virtual memory is 4GB i.e. 232 bytes

page size is 4 KB i.e. 212 bytes.

number of entries in page table = virtual memory size/page size i.e. 232-12 = 220 entries in page table.

physical size is 1 GB i.e. 230 bytes. so number of bits required for physical memory is 30 bits.

to calculate number of frames we have frame size = page size.

i.e. no. of frames = 230-12 = 218.

Therefore, each page table entry will contain 18 bits address of the page frame and 1 bit for valid-invalid bit. As memory is byte addressable, So number of bits = 16 i.e. 2 bytes

I am assuming total bits of page table here means total size of page table.

toal size of page table = number of entries in page table* size of each entry in bytes

= 220*2 = 221 bytes = 221*23bits = 224bits

b) Page tables are stored in main memory i.e. RAM because they cannot be shipped out to the disk as they are used very frequently to see if the page is there in RAM or not. So it is stored in main memory at the time of process creation and the address of page table is stored in Process Control Block. For the processes that are not in execution and that have page tables build, there page tables can be stored in the disk but when they are executed, the page tables needs to be loaded to RAM. Note that Process Control Block always holds the page table of process in action.