CS FundamentalsVery hardGATE CS
Physical memory is 64 MB with 4 KB frames; virtual addresses are 32-bit. Each PTE holds a frame number plus 4 control bits, and PTE size is rounded up to a power-of-two number of bytes. How many PTEs fit in one page, and how many levels does a hierarchical table need if each table fits in one page?
- A. 1365 PTEs per page; 2 levels
- B. 1024 PTEs per page; 2 levels
- C. 1024 PTEs per page; 3 levels
- D. 512 PTEs per page; 3 levels
Correct answer: B. 1024 PTEs per page; 2 levels
Frames = 2²⁶ / 2¹² = 2¹⁴, so a PTE needs 14 + 4 = 18 bits, which rounds up to 4 bytes (the next power of two above 3). A 4 KB page holds 1024 PTEs (10 index bits). The VPN is 32 − 12 = 20 bits = 2 × 10, so 2 levels suffice.
More Operating Systems questions
- A process has page-fault rate p. Memory access = 100 ns; fault service = 20 ms. To keep the effective access time below 200 ns, p must be…
- Cylinders 0–49, head at 20, previous request was at 25 (so the head is moving toward 0). Requests: 10, 22, 20, 2, 40, 6, 38. What is the…
- A disk spins at 15,000 RPM; average seek is 3.5 ms; transfer rate is 200 MB/s. What is the average time for a random 64 KB read?
- How many times is "x" printed? (Every fork() succeeds.) c int main() { if (fork() == 0) { if (fork() == 0) fork(); } printf("xn"); }
- How many times is "x" printed? (Every fork() succeeds.) c int main() { for (int i = 0; i < 2; i++) { fork(); fork(); } printf("xn"); }
- How many times is "x" printed? (Every fork() succeeds.) c int main() { if (fork() || fork()) fork(); printf("xn"); }