Start: 15:47 Paused: 16:40 Resume: 17:40

  1. c
  2. c
  3. d
  4. a
  5. b
  6. c
  7. c
  8. a (disagreement)
  9. b
  10. d
  11. a
  12. c
  13. d (incorrect?)
  14. c
  15. d
  16. a
  17. b
  18. b
  19. d
  20. a
  21. b
  22. a (verify)
  23. b
  24. d
  25. a
  26. c
  27. b
  28. d
  29. a
  30. b
  31. b
  32. a
  33. c
  34. c
  35. b (off by 10
  36. a (wrong)
  37. b
  38. a
  39. b
  40. c
  41. b
  42. d
  43. a
  44. fuck this question

fuck this q. p2

Cache access time = 20ns Memory access time = 500ns HDD access time = 0.01ms

; pseudocode function fetch(address) { data = fetchFromCache(address); if data { return data; }

return fetchFromMemory(address);

}

pageTable = fetch(); page = pageTable.get();

if page { return fetch(page.address); } else { return fetchFromDisk(); }

; cost Effective access time between cache / memory:

0.95 * 20ns + 0.05 * (20ns + 500ns)
    = 45ns

To fetch page table: 45ns If hit, to fetch data: 45ns If fault, to fetch data: 0.01ms

; pseudocode ; under the assumption that we check the cache first data = fetchFromCache(address);

if data { return data; } else { pageTable = fetchFromMemory(); page = pageTable.get();

if page {
    return fetchFromMemory(page.address);
} else {
    return fetchFromDisk(page.address);
}

}

; cost Final EAT: 20ns + 0.05 * ( 500ns + 0.99 * 500ns + 0.01 * 0.01ms )