看板 Grad-ProbAsk 關於我們 聯絡資訊
※ 引述《privatewind (傷神客)》之銘言: : ※ 引述《christianSK (AG)》之銘言: : : 給定三個指令 A B C : : 他們的CPI分別是 a b c : : 如果今天clock rate 增加到150% : : A 的CPI變成1.5倍的a 而 B C 的CPI不變 : : 如果說A指令佔 40 % : : 問 ( performance_new / performance_original ) - 1 = ? : : solution: : : ans = 1 / [ (0.4*1.5+0.6)* 1 / 1.5 ] = 1.25 - 1 = 0.25 : : 不太能理解解答的做法 為什麼可以直接說 B C 新的CPI = 0.6呢?? : : 先謝謝大家了~ : By Amadal law, : 1/ ((0.4*1.5)/1.5+0.6/1.5) -1 =1/0.8 -1 =1.25 = 0.25. : When clock rate of CPU increases to 1.5 times than the origin, : the instructions of B and C types can also benefit from the improving. : For B and C: : CPU time = Cycle per instuction * Instuction count / Cycle rate. : ^^^^^^^^^^ : much higher : The reason is cycle rate, not the CPI, and the "0.6" is the percent of B and C : instructions. 關於CPI的部分我想再問一下 P大前面那條Amadal的式子中 還沒簡化前應該是 IC * avg_CPI / clock rate ------------------------- IC * avg_CPI' / clock rate' -----(*) 吧!? 而 avg_CPI' 應該是 ( 0.4 * 1.5 * CPI_A ) + (0.6 * avg_CPI) 吧?? 這樣一來帶回原先的式子(*) 並沒有辦法把 CPI_A 跟 avg_CPI 消去 要滿足的話應該會是 avg_CPI' = ( 0.4 * 1.5 * avg_CPI ) + (0.6 * avg_CPI) 才對 (可是為什麼會等於呢?) 請問我這樣的說法是對的嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.114.32.193 ※ 編輯: christianSK 來自: 140.114.32.193 (09/24 10:46)
privatewind:其實它是要你從IC的地方去下手XD 09/24 17:08
privatewind:還有你的avg_CPI不能代表B和C的avg_CPI 09/24 17:09
privatewind:當然了 題目是有遐疵的XD 09/24 17:10
privatewind:因為avg_cpi *1.5 並不能代表改變後的A 09/24 17:12
privatewind:不過題目是希望你把每一種指令的cycle都當作avg_cpi 09/24 17:12
christianSK:原來是如此 因為我一直想說CPI的變動很奇怪@@ 09/24 21:36
christianSK:謝謝了!! 09/24 21:36