2.3k views
Consider a system with byte-addressable memory, $32-bit$ logical addresses, $4$ $kilobyte$ page size and page table entries of $4$ $bytes$ each. The size of the page table in the system in $megabytes$ is_________________.

edited | 2.3k views

total no of pages $= \frac{2^{32}}{2^{12}} = 2^{20}$

We need a PTE for each page and an entry is $4$ bytes. So,
page table size  $= 4 \times 2^{20}$ = $2^{22}B =$ $\mathbf{4MB}$
by Active (5k points)
edited by
+1
Page table size=Number of pages$\times$Page table entry

(or)

Page table size=Number of pages$\times$Size of each page

(or)

Page table size=Number of pages$\times$Frame number
0
Here, size of page is 4 KB = 2 ^2 * 2^10 * 2^3 right, why is Byte not converted ?
+1

Given that system is byte-addressable memory. Which means a bit can address a byte. Total 4 kilobytes = 4096 bytes, which can be addressed by 12 bits. Ie page offset is 12 bits.

Bits required to represent the number of pages = 32-12 =20 bits, and total number of pages = $2^{20}$

Now

What is mean by 32 bit logical address ? 32 bits are used to represent a word. It doesn't mean that a word is bit. A word may be a byte or 2 byte etc.. its depend on the design of the machine. Usually we represent word = 1 byte. That is why page size is in byte.

LA=32 bits

Page size or offset =4KB=>12 bits

pages=32-12=20 bits ..so there are 220 pages .For each page there would be an entry in the page table ..and PTE=4 bytes

page table size= 220 * 4 B=> 4MB

by Active (1.9k points)
0
will answer remain same if i calculate size of PT1 then size of PT2  and then add both??..

i guess this method will also give same answer
0
page table size=number of pages in page table(which is 2^page number bits of virtual address)x page size.

why are we taking 2^20 bits of logical address as number  of pages.?

plz help