Re: [問題]100台聯大

作者: ccpz (OoOoOo)   2017-05-10 21:57:04
※ 引述《SODAred043 (魔力洪)》之銘言:
: 100年計概 第八題
: Assume a computer uses pipelining of 9 stages.
: Each stage demands 3 clock cycles to finish its task.
: How many clock cycles are need to execute 11 independent instructions?
: A.33
: B.297
: C.57
: D.19
: E.none of the above
: 小弟覺得是11個指令排一排進去所以選A
: 可是老師說會先做完9個指令,再做剩下兩個所以選C
: 聽完還是不太懂為什麼中間會空這麼長的一段 想請教板上的大家
: 謝謝><
你應該想成一個 instruction 只要 3 clock 吧?
這裡通常都是說一個 instruction 要經過 9步驟才執行完畢
https://goo.gl/Joa3mE
像這張圖,一到指令要經過讀取,解碼,執行,寫回
而且每個 stage 同個時間只能執行一個 instruction
所以第一個 instruction 做第二個 stage 時,第一個 stage 空著,
他就可以先做第二個 instruction
圖示就是這樣:
1,1,1,1,1,1,1,1,1 (instruction 1 經過 9 個 stage, 每個 3 clock, 27 clock 完成)
2,2,2,2,2,2,2,2,2 (instruction 2 在 clock=4 時就可以開始做. 31 clock 完成)
所以最後就是 27+(11-1)*3=57
作者: SODAred043 (魔力洪)   2017-05-10 23:59:00
懂了懂了 謝謝大大的詳細解說

Links booklink

Contact Us: admin [ a t ] ucptt.com