FOR FREE CONTENT

Some Important Example 2:

 

1.  Logical Address Space (LAS) = 128KB, Physical Address Space (PAS) = 512KB and page size = 16KB.

 

Calculate:

a. Number of bits for Logical Address (LA)

b. Number of bits for Physical Address (PA)

c. Number of pages in LAS or process.

d. Number Frames in main memory or PAS.

e. Page Table size.

[This is a very important example of this type of question asked several times in NET/GATE/ISRO/Engineering/Degree Course.]

 

You should know:

Before seeing the solution please follow Calculation of offset for logical and physical address, Calculation of logical address bit and number of pages, Calculation of physical address bit and number of frames, Calculation of page table size. 

 

Solution:

 

LAS = 128KB, PAS = 512KB and page size = 16KB

 

a.  Number of bits required for LA:

 

So, the number of bits required for Logical Address (LA) = 17 bits.

 

b.  Number of bits for Physical Address (PA):

 

So, the number of bits required for Logical Address (LA) = 19 bits.

 

c.  Number of pages in LAS or process:

 

As we know the formula: Number of pages = Size of the process (LAS) / page size

 

d.  Number Frames in main memory or PAS:

 

PAS = 512KB  and as we page size and frame size is always the same.

As we know the formula: Number of frames = Size of the main memory (PAS) / frame size

 

e.  Page Table size:

 

As we know the formula: Page table size = Number of pages × Page entry size

 

But in this case, the page table entry size is not given. So, in any problem, if page table entry size is not given then we consider bits require for the frame as a table entry size.

 

Because one of the important information of page table entry is frame number.

 

We already calculate from the above number of pages = 23 bytes and number of frames = 25 bytes

 

And we also know if the frame size is 25 then the number of bits required for frame = 5 bits

Now, we elaborate the address fields of Logical Address (LA):

 

Number of pages23, so, the number of bits required for page number = 3 bits

 

And page size = 16KB = 214so, offset = 14 bits

 

We can also calculate offset = Total bits require of LAbits require for page number

                        =  17 bit  -  14 bits = 3 bits

 

Now, we elaborate the address fields of Physical Address (PA):

 

Number of frames25, so, the number of bits required for frame number = 5 bits

 

As we know offset is the same for both Logical Address (LA) and Physical Address (PA):

Offset = 14 bits

 

Note: This question is looks long but in the examination, you can solve it easily without calculating all steps after a good practice.