Consider two different implementations of the same instruction




- Slides: 4
Consider two different implementations of the same instruction set architecture. There are four classes of instructions, A, B, C, and D. The clock rate and CPI of each implementation are given in the following table. Processor Clock Rate CPI (class A) CPI (class B) CPI (class C) CPI (class D) P 1 2. 5 GHz 1 2 3 3 P 2 3 GHz 2 2 1. 4. 1 [10] <1. 4> Given a program with 106 instructions divided into classes as follows: 10% class A, 20% class B, 50% class C, and 20% class D, which implementation is faster? 1. 4. 2 [5] <1. 4> What is the global CPI for each implementation? 1. 4. 3 [5] <1. 4> Find the clock cycles required in both cases. BK TP. HCM
Solution 1. 4. 1 Class A (10% of 106 instr. ): 105 instr. Class B (20% of 106 instr. ): 2 × 105 instr. Class C(50% of 106 instr. ): 5 × 105 instr. Class D(20% of 106 instr. ): 2 × 105 instr. CPU-Time = AƩD(ICi x CPIi) x Clock Cycle Time = (IC x CPI)/Clock Rate Used for: 1. CPU-Time(P 1) = (105 + 2 × 105 × 2 + 5 × 105 × 3 + 2 × 105 × 3)/(2. 5 × 109) = 10. 4 × 10− 4 s 2. CPU-Time(P 2) = (105 × 2 + 2 × 105 × 2 + 5 × 105 × 2 + 2 × 105 × 2)/(3 × 109) = 6. 66 × 10− 4 s BK TP. HCM Return
Solution 1. 4. 2 Global CPI = (CPU-Time x Clock Rate)/IC Therefore: CPI (P 1) = 10. 4 × 10− 4 × 2. 5 × 109/106 = 2. 6 CPI (P 2) = 6. 66 × 10− 4 × 3 × 109/106 = 2. 0 BK TP. HCM Return
Solution 1. 4. 3 Class A (10% of 106 instr. ): 105 instr. Class B (20% of 106 instr. ): 2 × 105 instr. Class C(50% of 106 instr. ): 5 × 105 instr. Class D(20% of 106 instr. ): 2 × 105 instr. CPU-Time = AƩD(ICi x CPIi) x Clock Cycle Time Clock Cycles = (AƩD(ICi x CPIi) Therefore: clock cycles (P 1) = 105 × 1 + 2 × 105 × 2 + 5 × 105 × 3 + 2 × 105 × 3 = 26 × 105 clock cycles (P 2) = 105 × 2 + 2 × 105 × 2 + 5 × 105 × 2 + 2 × 105 × 2 = 20 × 105 BK TP. HCM Return




