[理工] 106台科資工概論 對答案

看板Grad-ProbAsk作者 (brilliant)時間8年前 (2018/01/16 12:37), 8年前編輯推噓4(401)
留言5則, 4人參與, 最新討論串1/1
各位大大好 剛寫了台科考古但手邊沒答案 在這邊po上我的答案 如果有寫錯的拜託各位多多指教 ((跪 題目: https://imgur.com/w84LKMj
https://imgur.com/ZxDTFi5
https://imgur.com/QDiOI2W
https://imgur.com/cWCRoLW
我的答案: 1.F T F F T 2.(a) O(1) < O(logn) < O(n) < O(nlogn) < O(n^2) < O(2^n) < O(n!) (b) Theta(n^2) 不是很確定 3.(a) //-de*+ab-cdf (b) de-ab+cd-*/f/ 4.(a) worse case: O(n^2) best case: O(nlogn) (b) 若是要將數列由小到大排序,worse case的情況是pivot都選到最小或最大值 best case 的情況是pivot都選到中位數 不是很確定是不是這樣寫就好 5.假設每個resource都只有一個=>RAG畫出來有circular wait的現象=>有deadlock 6.(a)log_2(16)+log_2(2048) = 4+11 = 15 bits (b)log_2(16) = 4 bits (c)log_2(4)+log_2(2048) = 2+11 = 13 bits 7.8 times 有查過前面的文章,應該是對的 8.(a)code sequence 1: 1+1+8 = 10 => code sequence 1 執行比較多的指令 code sequence 2: 2+1+1 = 4 (b)code sequence 1: 1x7 + 1x3 + 8x1 = 18 cycles => 一樣快 code sequence 2: 2x7 + 1x4 + 1x1 = 18 cycles (c)code sequence 1: 18/10 = 1.8 code sequence 2: 18/4 = 4.5 (d)code from compilier 1: 10^9 x( 3x7 + 1x3 + 1x1)/( 5x10^9 ) = 5 seconds code from compilier 2: 10^9 x( 1x7 + 3x3 + 4x1)/( 5x10^9 ) = 4 seconds => code form compilier 2 is faster (e)code from compilier 1: 10^9 x(3+1+1)/(5x10^6) = 1000 mips code from compilier 2: 10^9 x(1+3+4)/(4x10^6) = 2000 mips =>code from compilier 2 is faster 9.如圖 https://imgur.com/MjbWiXu
10.(a) 2 no-ops between 16 and 20 2 no-ops between 20 and 24 (b) 假設branch是在EX stage決定的 total cycle = 3+1+3+(5-1) = 10 ctcles 雖然台科相較台清交容易,但還是怕手殘有算錯 還請各位幫忙找錯,感激不盡! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 27.246.42.23 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1516077457.A.AB1.html

01/16 17:03, 8年前 , 1F
8.e 1600 錯了 應該除4
01/16 17:03, 1F
對欸! 感謝b大

01/16 21:39, 8年前 , 2F
想請問第九題的cache 3,是不是只有4個block?這樣我算
01/16 21:39, 2F

01/16 21:39, 8年前 , 3F
只有兩個hit而已
01/16 21:39, 3F
對!我手殘寫成8個,感謝 ※ 編輯: brilliantl (111.249.1.196), 01/17/2018 00:32:47

02/04 00:47, 8年前 , 4F
10. (b) 11
02/04 00:47, 4F

01/21 00:01, , 5F
可以借問一下第五題DAG怎麼畫嗎
01/21 00:01, 5F
文章代碼(AID): #1QNO6Hgn (Grad-ProbAsk)