Doubt regarding Question 1 of Assignment 5

52 views
Skip to first unread message

Prakhar Gupta

unread,
Feb 24, 2021, 1:35:59 PM2/24/21
to Discussion forum for Operating System
Shouldn't the answer be 2 MB instead of 4 MB??
Can someone please explain.

Dhinesh

unread,
Feb 24, 2021, 10:13:31 PM2/24/21
to Discussion forum for Operating System, guptapr...@gmail.com

Yeah, i guess so. Since 15 bit near 16 bit. It should be 2MB only . I dont know how it became 4MB. we may need to wait for their solution.

Rahul Suresh Kumar

unread,
Feb 25, 2021, 7:39:14 PM2/25/21
to Discussion forum for Operating System, Dhinesh, guptapr...@gmail.com
Yeah the answer should be 2MB due to 15 bit being rounded of to 16bit. They might have took the sum of PD and PT but that's not needed in this case.

Parth Dhar

unread,
Mar 5, 2021, 6:50:19 AM3/5/21
to Discussion forum for Operating System, rahulsur...@gmail.com, Dhinesh, guptapr...@gmail.com
Apologies, we selected the wrong option.

Here's a detailed explanation:

A page entry is used to get the address of physical memory. Here we assume that a single level of Paging is happening. So the resulting page table will contain entries for all the pages of the Virtual address space.
    Number of entries in page table = (virtual address space size)/(page size) 
    Using the above formula we can say that there will be 2^(32-12) = 2^20 entries in the page table.
    No. of bits required to address the 128MB Physical memory = 27.
    So there will be 2^(27-12) = 2^15 page frames in the physical memory. And the page table needs to store the address of all these 2^15 page frames. Therefore, each page table entry will contain 15 bits address of the page frame and 1 bit for valid-invalid bit.
    Since memory is byte-addressable. So we take that each page table entry is 16 bits i.e. 2 bytes long.
    Size of page table = (total number of page table entries) * (size of a page table entry) = (2^20 * 2) = 2MB
Reply all
Reply to author
Forward
0 new messages