帮助了解时钟周期
我很难理解时钟周期。问题是,给我一个程序,它有两条指令 X 和 Y,我知道 X 运行 20% 的时间,需要 8 个时钟周期,另一条指令 Y 运行 80% 的时间,需要 2 个时钟周期循环。如果我的程序有 1000 万条指令,我需要找到:
A. 执行一条指令的最小时钟周期数?
B. 使用阿姆达尔定律可以通过改进指令 X 找到最大速度。
这是我的狩猎,请在我错误的地方帮助我。对于 A,执行一条指令的最小时钟周期数是 1 个时钟周期。我以为我在某处读过这篇文章,但我不确定。
为了进行 BI,我假设我要解决 X 的时钟周期为 1 时的加速问题,因为这意味着它执行速度最快。
这些假设正确吗?任何帮助将不胜感激。谢谢
I am having a hard time understanding clock cycles. Here is the problem, I am given a program that has two instructions X and Y and I know that X is run 20% of the time and requires 8 clock cycles and the other instruction Y is run 80% of the time and requires 2 clock cycles. If my program has 10 million instructions I need to find:
A. The minimum number of clock cycles to execute one instruction?
B. The maximum speed up using Amdahl's Law that can be found by improving instruction X.
This is my huntch and please help me where I am wrong. For A the minimum number of clock cycles to execute one instruction is 1 clock cycle. I thought I read this somewhere but I am not sure.
To do B I am assuming that I was to solve for the speedup when X has a clock cycle of 1 because that would mean it is executing the fastest.
Are theses assumptions correct? Any help would be appreciated. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道 1
但对于 2,程序需要
T = .2*10 000 000*8 + .8*10 000 000*2
个周期改进指令 X 可以使其只需要 n 个周期(答案来自 1)
这意味着
U = .2*10 000 000*n + .8*10 000 000*2
周期来运行程序这意味着如果进行改进,运行该程序将花费原始时间的
U/T
时间。速度提高T/U
倍I don't know about 1
But for 2 the program takes
T = .2*10 000 000*8 + .8*10 000 000*2
cyclesImproving instruction X could make it take only n cycles (answer from 1)
Which means
U = .2*10 000 000*n + .8*10 000 000*2
cycles to run the programThis means it will take
U/T
time of the original to run the program if you make the improvement. A speed increase by a factor ofT/U