Re: [理工] [計組]95東華資工
※ 引述《seacottobaby (海綿寶寶)》之銘言:
: We make an enhancement to a computer that improves some mode of execution
: by a factor of 10. Enhanced mode is used 80% of the time,measured as a
: percentage of the execution time when the enhanced mode is in use.
: (1) What is the speedup we have obtained from fast mode?
: Ans : Speedup = Time(unenhanced) / Time(enhanced)
: The unenhanced time is the sum of the time that does not benefit from
: the 10 times faster speedup,plus the time that does benefit , but before
: its reduction by the factor of 10. Thus
: Time(unenhanced) = 0.2 X Time(enhanced) + 10 X 0.8 X Time(enhanced)
: = 8.2 Time(enhanced)
: 我不太了解解答的意思... 為什麼不是 speed = 1 / ( (0.8/10) + 0.2 ) 這樣?
因為題目有陷阱,
它給的80%是在enhanced mode底下的execution time之80%為加速的部分。
若令enhanced mode之execution time為x,
則0.2x為在enhanced mode下沒有被加速的部分,
這個部分會跟unenhanced mode所需花的時間一樣。
所以unenhanced mode總共的execution time為0.2x + 0.8x * 10
0.8x * 10 是為了把加速完的部分還原回來。
畫個圖就很清楚了
▇▇▇▇▇▇ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇ unenhanced execution time
^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
無法被加速 可被加速
(此區塊不變)
▇▇▇▇▇▇ ▇▇▇▇▇▇▇▇▇ enhanced execution time = x
^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
無法被加速 被加速完
0.2x 0.8x
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.30.136
推
11/28 23:08, , 1F
11/28 23:08, 1F
→
11/28 23:13, , 2F
11/28 23:13, 2F
推
11/29 00:12, , 3F
11/29 00:12, 3F
→
11/29 00:14, , 4F
11/29 00:14, 4F
→
11/29 00:19, , 5F
11/29 00:19, 5F
推
11/29 04:18, , 6F
11/29 04:18, 6F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):