作者nptek (KyoMiKe)
看板Grad-ProbAsk
標題[理工] [計組]-Access time問題
時間Wed Feb 17 20:43:07 2010
例如 97年中興資科 計算機系統 第六題
題目大意如下:
it takes 10ns to access a word in the cache.
If a word is in main memory but not in the cache,
30ns are needed to load it into the cache,
and then the reference to it is started again.
If the word is not in main memory,
12ms are required to fetch the word from disk,
followed by 30ns to copy it to the cache,
and then the reference is started again.
cache hit ratio 0.9 ; main memory hit ratio 0.6
求平均access time
我看解答是寫
0.9*10ns + 0.1*0.6*(10ns+30ns+10ns)
+ 0.1*0.4*(10ns+30ns+12ms+30ns+10ns)
不過我看高銘後面的例題,95年中山電機的題目,題目一樣只是數據不一樣
高銘的解法是
0.9*10ns + 0.1*0.6*(10ns+30ns)
+ 0.1*0.4*(10ns+30ns+12ms)
請問這兩者哪一個才是正確的呢?
謝謝~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.40.205.130
→ BenLinus:我覺得是第一個對耶 02/17 21:12
推 crazyjoe:第一個 02/17 21:14
推 orinsinal:兩者其實都可,因為存取disk時間太長,相對多出一次的mem 02/17 21:50
→ orinsinal:acess顯得太小,可忽略不計. os恐龍本的算法是這樣 02/17 21:50
→ nptek:中興這題規定答案要用ns表示,那應該都要加進去了 02/17 22:21
→ nptek:所以是第一個對嗎? 02/17 22:21
→ crazyjoe:不計的話那10ns+30ns+12ms 前面兩個也不用寫了... 02/17 22:23
推 windysoul:如果分的出來是os還是計組的話 那計組用1 os用2 02/18 09:20