This question confused me for a long time. Now I am going to explain what I have learned about how to solve this question..
Page table entry size = 4B
Segment table entry size = 8B
Page table size = 1KB
Segment table size = 256KB
→ CASE1 : (Paging)
P1 : → 195KB/1 KB = 195 entries ;
→ Maximum number of entries allowed in page table = 1K/4 = 256 entries.
→ But we need 195 only, so we need 1KB(level1) and 1KB(level2) or 1+1 = 2KB page table overhead for P1.
Similarly for P2, and P3 we need 2KB and for P4 we need 3 KB.
So, P = 2 + 2 + 2 + 3 = 9KB
→ CASE2 : (Segmentation)
P1 : → we have 4 segments here and each one needs 8B. implies we need 4*8B of overhead in the main segment table for this process.
Similarly, we need 5*8, 3*8, and 8*8 for other processes.
So, S = 160B
→ CASE3 : (Segmentation + Paging)
P1 : → 4 segements each of size 256KB,
→ 256KB/1KB = 256 entries we want & we have 1KB/4B = 256(max entries in Page table).
→ So, we need a 1-page table per segment.
layout :
Process → Segmentation → Paging
195KB → break it into 4 segments (4 * 256KB) → 4* 1KB
So, T = 4KB(P1) + 5KB(P2) + 3KB(P3) + 8KB(P4) + (4*8 + 5*8 + 3*8 + 8*8)(Segment table size) = 20640B
Hence we can conclude that (S < P < T), Option B.