看板 Grad-ProbAsk 關於我們 聯絡資訊
問題一:(張凡老師課本下冊p35練習) Assume that of all instructions executed in a processor,the following fraction of these instructions has a particular type of RAW data dependence. The type of RAW data dependence is identified by the stage that produces the result (EX or MEM) and instruction that consumes the result(1st instruction that follows the one that produces the result, 2nd instruction that follows, or both). We assume that the register write is done in the first half of the clock cycle and that register reads are done in the second half of the cycle. Also, assume that the CPI of the processor is 1 if there are no data hazards. -------------------------------------------------------------------- | | st | st nd | nd | st | | | EX to 1 only | EX to 1 and 2 | EX to 2 only | MEM to 1 | |------------------------------------------------------------------- |a.| 10% | 10% | 5% | 25% | |------------------------------------------------------------------- |b.| 15% | 5% | 10% | 20% | -------------------------------------------------------------------- (1)If we use no forwarding,what fraction of cycles are we stalling due to data hazards? (2)If we use full forwarding(forward all results that can be forwarded),what fraction of cycles are we stalling due to data hazards? 解答: (1) ---------------------------------------------- | | CPI | Stall cycle | ---------------------------------------------- |a.| 1+0.45*2+0.05*1=1.95 | 0.95/1.95=49% | ---------------------------------------------- |b.| 1+0.40*2+0.10*1=1.9 | 0.9/1.9=47% | ---------------------------------------------- (2) ---------------------------------------------- | | CPI | Stall cycle | ---------------------------------------------- |a.| 1+0.25=1.25 | 0.25/1.25=20% | ---------------------------------------------- |b.| 1+0.20=1.20 | 0.20/1.20=17% | ---------------------------------------------- 題目裡的表格看不懂他表達的是什麼意思,不曉得有沒有人可以幫忙解說, 方便的話,順便舉例一下題目的(1-a)來說明它的算式是在做什麼,謝謝。 感謝各位耐心看完題目,謝謝。 ※ 編輯: numin 來自: 123.193.221.223 (09/15 21:21)
dikai:請問是第幾版的下冊我2版下冊沒這題 09/16 02:22
cola1230:管線二版在上策 09/16 13:41
numin:是在第一版上面的喔。 09/16 17:19