1. Logical Address Space (LAS) = 64KB, Physical Address Space (PAS) = 128KB and page size = 4KB.
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 = 64KB, PAS = 128KB and page size = 4KB
a. Number of bits required for LA:
So, the number of bits required for Logical Address (LA) = 16 bits.
b. Number of bits for Physical Address (PA):
So, the number of bits required for Logical Address (LA) = 17 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 = 128KB 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 = bytes and number of frames = bytes
And we also know if the frame size is then the number of bits required for frame = 5 bits
Now, we elaborate the address fields of Logical Address (LA):
Number of pages = , so, the number of bits required for page number = 4 bits
And page size = 4KB = , so, offset = 12 bits
We can also calculate offset = Total bits require of LA – bits require for page number
= 16 bit - 4 bits = 12 bits
Now, we elaborate the address fields of Physical Address (PA):
Number of frames = , 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 = 12 bits
Note: This question is looks long but in the examination, you can solve it easily without calculating all steps after a good practice.