Calculation of the number of bits required for Logical Address:
Let Logical Address Space (LAS) = L bytes
Example:
LAS = 128 MB = Byte then
So, number of bits requirement for logical address = 27 bits
We know Logical address contains two parts: page number and Offset
Calculation of the number of pages in Logical Address Space:
LAS (process size) = L bytes = bytes (We take as a power of 2)
Page size = P bytes = bytes (We take as a power of 2)
And the number of bits for the page number in LAS = m - n
Example:
LAS = 256KB = bytes and page size = 16KB = bytes
Number of bits required for the page number in LAS = 4
What we know from above
Now,
And
So, the number of bits for the page number in LAS = m - n bits = k bits.
We can also calculate page offset directly because we consider
Page size = P bytes = bytes
So, page offset = n bits
So, here w - k bits = n bits