我做这个问题对吗?我的答案是 P2 (0.667 ms) 比 P1 (1.04 ms) 快。全球 CPI 是哪个数字?
1.6 [20] & lt;§ 1.6 & gt;考虑同一指令集架构的两种不同实现。指令可根据其 CPI 分为四类 (A 、 B 、 C 和 D 类)。P1 时钟速率为 2.5 GHz,CPI 为 1 (10%) 、 2 (20%) 、 3 (50%) 和 3 (20%)。P2 时钟速率为 3 GHz,CPI 为 2 (10%) 、 2 (20) 、
给定一个动态指令计数为 1.0 E6 (1.0 * 10 ^ 6) 的程序,指令分为如下几类:10% 的 A 类、 20% 的 B 类、 50% 的 C 类和 20% 的 D 类,哪种实现更快?
a. What is the global CPI for each implementation? Which is faster: P1 or P2?
CPU Time = CPU clock cycle/clock rate
CPU Clock Cycles = Sum of CPI * instruction count
Sum of each row, (A, B, C, D multiplied by IC and CPI)
P1 Clock Cycles = 1.0 * 10^6 dynamic instruction count * 1 CPI * 10% cl A
+1.0 * 10^6 dynamic instruction count * 2 CPI * 20% cl B
+1.0 * 10^6 dynamic instruction count * 3 CPI * 50% cl C
+1.0 * 10^6 dynamic instruction count * 3 CPI * 20% cl D
P1 Clock Cycles = (0.1 CPI * 106 instruction count) + (0.4 CPI * 106 instruction count) + (1.5 CPI * 106 instruction count) + (0.6 CPI * 106 instruction count) = 2.6 * 10^6 Clock Cycles
P2 Clock Cycles = 1.0 * 10^6 dynamic instruction count * 2 CPI * 10% cl A
+1.0 * 10^6 dynamic instruction count * 2 CPI * 20% cl B
+1.0 * 10^6 dynamic instruction count * 2 CPI * 50% cl C
+1.0 * 10^6 dynamic instruction count * 2 CPI * 20% cl D
P2 Clock Cycles = (0.2 CPI * 10^6 instruction count) + (0.4 CPI * 10^6 instruction count) + (1.0 CPI * 10^6 instruction count) + (0.4 CPI * 10^6 instruction count) = 2 * 10^6 Clock Cycles
P1 CPU Time = (2.6 * 10^6 Clock Cycles) / 2.5 GHz = 1.04 (10^6/10^9) = 1.04 * 10^-3 = 1.04ms
P2 CPU Time = (2 * 10^6 Clock Cycles) / 3 GHz = 1.04 (10^6/10^9) = 0.667 * 10^-3 = 0.667ms
P2 is faster than P1.
答案是正确的,我最初在网上找到了一些不正确的解决方案,并开始关注我自己的答案。这个答案包括澄清每台计算机的全球 CPI 是什么,以及更完整的单位:
P1 CPU Time = (2.6 * 106 Clock Cycles) / 2.5 GHz = 1.04 (106/109) = 1.04 * 10-3 = 1.04ms, Global CPI is 2.6 cycles per instruction
P2 CPU Time = (2 * 106 Clock Cycles) / 3 GHz = 0.667 (106/109) = 0.667 * 10-3 = 0.667ms, Global CPI is 2 cycles per instruction
P2 is faster than P1.
本站系公益性非盈利分享网址,本文来自用户投稿,不代表边看边学立场,如若转载,请注明出处
评论列表(42条)