Start: 15:47 Paused: 16:40 Resume: 17:40
- c
- c
- d
- a
- b
- c
- c
- a (disagreement)
- b
- d
- a
- c
- d (incorrect?)
- c
- d
- a
- b
- b
- d
- a
- b
- a (verify)
- b
- d
- a
- c
- b
- d
- a
- b
- b
- a
- c
- c
- b (off by 10
- a (wrong)
- b
- a
- b
- c
- b
- d
- a
- 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(
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(
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 )