FOR FREE YEAR SOLVED

Calculation of Logical address bit and Number of pages

 

Calculation of the number of bits required for Logical Address:

 

  • # Logical Address Space (LAS) = Size of process
  • # Logical Address Space (LAS) is divided into an equal number of pages
  • # Page size is always a power of 2.

 

Let Logical Address Space (LAS) = L bytes 

 

 

Example:

LAS = 128 MB = 227 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 = 2m bytes (We take as a power of 2)

 

Page size = P bytes = 2n bytes (We take as a power of 2)

 

 

And the number of bits for the page number in LAS = m - n

 

 

Example:

LAS = 256KB = 218 bytes and page size = 16KB = 214  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 = 2n bytes

 

So, page offset = n bits

 

So, here w - k bits = n bits