How you can calculate the various parameters related to paging.
Assume a Logical Address Space of 64 pages of 1024 words, each mapped into a physical memory of 32 frames. How you can calculate the various parameters related to paging.
No. of bits needed for p = ?
No. of bits neede for f = ?
No. of bits needed for d =?
Logical address size (bits) = ?
Physical address size (bits) = ?
Solution:
1. No. of bits needed for p (Page Number): The number of bits needed for p can be calculated by using the following formula: p = log2(number of pages) In this case, the number of pages is 64, so: p = log2(64) = 6 bits
2. No. of bits needed for f (Frame Number): The number of bits needed for f can be calculated by using the following formula: f = log2(number of frames) In this case, the number of frames is 32, so: f = log2(32) = 5 bits
3. No. of bits needed for d (Displacement): The number of bits needed for d can be calculated by using the following formula: d = log2(page size in words) In this case, the page size in words is 1024, so: d = log2(1024) = 10 bits
4. Logical address size (bits): The logical address size can be calculated by adding the number of bits needed for p, f, and d. In this case, the logical address size is: 6 + 5 + 10 = 21 bits
5. Physical address size (bits): The physical address size can be calculated by adding the number of bits needed for f and d. In this case, the physical address size is: 5 + 10 = 15 bits
No comments