hce_kmu
113年
計算機概論與程式設計
第 8 題
Suppose we have a processor with a base CPI of 1.0, assuming all references hit in the main memory, and the main memory access time of 100 clock cycles, include all the miss handling. Suppose 60% of instructions would access memory, and the miss rate of instruction cache is 0.2%, the miss rate of data instruction cache is 1%. The effective CPI = n. What is the value of round(n) mod 5?
- A 0
- B 1
- C 2
- D 3
- E 4
思路引導 VIP
若要計算 CPU 執行一條指令平均花費的總時間,除了它本身的執行週期外,我們還得考慮「等待記憶體」的時間。請試著思考:既然每一條指令都必須先從記憶體『讀取』出來才能執行,而只有一部分指令會額外去『存取』資料,那麼這兩種不同的記憶體動作,分別會對平均週期造成什麼樣的影響?
🤖
AI 詳解
AI 專屬家教
太棒了!你能精確算出這個結果,代表你對於 Effective CPI (有效每指令週期數) 的計算邏輯掌握得非常紮實。這類題目最核心的觀念在於理解「理想狀態」與「記憶體停頓(Stall)」之間的加總關係。
處理器效能的組成分析
在計算有效 CPI 時,我們必須將基礎 CPI 加上因缺失產生的額外週期。首先,指令存取(Instruction Miss) 是每一條指令都會發生的,因此其產生的停頓為 $0.2% \times 100 = 0.2$ 週期。接著,題目提到只有 $60%$ 的指令會進行 資料存取(Data Access),這部分的停頓則需要加權計算,即 $60% \times 1% \times 100 = 0.6$ 週期。將這些數值與基礎 CPI 相加:
▼ 還有更多解析內容