作者future1234 (Low)
看板TransCSI
标题Re: [问题] 程式执行时间算术题一问
时间Sun May 17 18:41:43 2009
※ 引述《fzrmitsul (我的妹妹很可爱)》之铭言:
: 10.A program runs in 10 seconds on computer X, which has a 5 GHZ clock. You
: are trying by increasing the clock rate to build a computer Y, that will run
: the program in 6 seconds. However, the increase will cause the computer Y to
: require 1.2 times as many clock cycles as computer X. What clock rate should
: you design?
: (A) 10 GHZ (B) 9 GHZ (C) 8 GHZ (D) 7 GHZ
: 答案是A
: 请问该怎麽算呢??谢谢
cpu execution time = cpu clock cycles x cycle time
= cpu clock cycles / clock rate
令 Y 的clock rate为 C x 10^9
computer X: 10 = cpu clock cycles / 5 x 10^9
computer Y: 6 = cpu clock cycles / C x 10^9
又 Performance Y / Performance X = 1.2
=> ( 1 / cpu execution time Y ) / (1 / cpu execution time X) = 1.2
=> cpu execution time Y / cpu execution time X = 1.2
所以...
6 x C x 10^9 = 1.2 x (10 x 5 x 10^9)
=> 6 x C = 60
=> C = 10 (GHZ)
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.119.162.51
1F:推 fzrmitsul:谢谢f大 05/18 07:32
2F:推 dreamroyc:有情帮推 05/25 16:37