看板 Grad-ProbAsk 關於我們 聯絡資訊
※ 引述《suscym (DoDreamEr)》之銘言: : ※ 引述《SiriusCloud (古月小楓)》之銘言: : : Assume that a single cycle datapath with the critical path : : of 10 ns can be partitioned into arbitary number of balanced : : stages for pipelining , and there is no dependency between : : instructions . : : If the pipeling will introduce an addtional 1 ns delay to : : each stage. What is the speed up for the 4-stage pipelined : : datapath when compared with the single-cycle one? : : ----------------------------------------------- : : answer : : : The instruction time for a single-cycle machine = 10 ns : : The instruction time for pipeline = (10 / 4) + 1 = 3.5 ns : : ^^^^^^^^^^^^why? : : speedup = 10 / 3.5 = 2.86 : 這部分我也有點困惑 看原文推文還是有所不解 : single-cycle的instruction time 是10ns沒錯 (一條指令而言) : pipeline 的instruction time就不大懂是3.5ns了 3.5不是才一個stage的cycle time嗎 : 若是不想這麼多 單純代SpeedUp公式 = S * N * T / [(S-1)+N ] * T : = 10 ns * N / [ 3 + N ] * 3.5ns : 我假設N=1(一條指令) : 那SpeedUp也是 10/ "4" * 3.5 不是嗎? : 一時迷失在這裡 請各位指教~ 因為single cycle的critical path取決於最長的指令lw 切成4個stage 然後每個stage有額外的1 ns delay 所以沒delay時 balance的切4 stage 每stage要10/4 = 2.5ns 再加上額外的1ns delay 所以要3.5ns single cycle的CPI為1, cycle time=10ns, Extime=10ns pipeline這邊沒給CPI, 先假設是1, cycle time=3.5ns, Extime=3.5ns speedup = 10/3.5 這是我的想法 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.118.110.186 ※ 編輯: mqazz1 來自: 140.118.110.186 (12/11 21:22)
suscym:想請問就是為何pipeline CPI可以假設為1 如果是第一道指令 12/11 21:32
suscym:來看,single instr time 是10ns;則piepline應該是用4個stag 12/11 21:32
suscym:(cpi=4) 來完成這道指令不是嗎? 12/11 21:33
CPI = (S-1+N)/N 當指令數趨近無限大 CPI=1 我想speedup應該有點像是演算法時間複雜度的概念(這部分可能要請高手..) O(n^n)跟O(n) 當n=1 應該也不能說這兩個algo一樣快吧.. ※ 編輯: mqazz1 來自: 140.118.110.186 (12/11 21:56)
RebeccaHall:把它想成 執行極多的指令再算他 speedup就可以了 12/13 21:08