Consider two different implementations of the same instruction set architecture. The instructions can be divided into four classes according to their CPI (class A, B, C, and D). P1 with a clock rate of 2.5 GHz and CPIs of 1, 2, 3, and 3, and P2 with a clock rate of 3 GHz and CPIs of 2, 2, 2, and 2. Given a program with a dynamic instruction count of 1.0E6 instructions divided into classes as follows: 10% class A, 20% class B, 50% class C, and 20% class D, which implementation is faster? a. What is the global CPI for each implementation? b. Find the clock cycles required in both cases.

Respuesta :

Answer:

Processor P_2 is faster than P_1.

Part A:

For Processor P_1:

CPI=2.6

For Processor P_2:

CPI=2

Part B:

For Processor P_1:

CPU CLOCK CYClE=[tex]2.6*10^{6}[/tex]

For Processor P_2:

CPU CLOCK CYClE=[tex]2*10^{6}[/tex]

Explanation:

We will find the instructions executed of each class:

For Class A=1*10^{6} *10%=1*10^{5}

For Class B=1*10^{6} *20%=2*10^{5}

For Class C=1*10^{6} *50%=5*10^{5}

For Class D=1*10^{6} *20%=2*10^{5}

CPU CLOCK CYClE=[tex]\sum_{n=1}^{i}*CPI_i*C_i[/tex]

Where:

C_i is the instructions of each class (Calculated above)

For Processor P_1:

CPU CLOCK CYClE=[tex](1*1*10^{5})+ (2*2*10^{5})+ (3*5*10^{5})+ (3*2*10^{5})[/tex]

CPU CLOCK CYClE=[tex]2.6*10^{6}[/tex]

For Processor P_2:

CPU CLOCK CYClE=[tex](2*1*10^{5})+ (2*2*10^{5})+ (2*5*10^{5})+ (2*2*10^{5})[/tex]

CPU CLOCK CYClE=[tex]2*10^{6}[/tex]

Now:

CPU TIME=CPU CLOCK CYClE/CYCLE RATE

For Processor P_1:

CPU TIME=[tex]\frac{2.6*10^{6} }{2.5*GHz} =1.04ms[/tex]

For Processor P_2:

CPU TIME=[tex]\frac{2*10^{6} }{3*GHz} =666.67ms[/tex]

Processor P_2 is faster than P_1.

Part A:

CPI=CPU CLOCK CYClE/Number of instructions

For Processor P_1:

CPI=[tex]\frac{2.6*10^{6}}{1*10^{6}}=2.6[/tex]

For Processor P_2:

CPI=[tex]\frac{2*10^{6}}{1*10^{6}}=2[/tex]

Part B:

For Processor P_1:

CPU CLOCK CYClE=[tex](1*1*10^{5})+ (2*2*10^{5})+ (3*5*10^{5})+ (3*2*10^{5})[/tex]

CPU CLOCK CYClE=[tex]2.6*10^{6}[/tex]

For Processor P_2:

CPU CLOCK CYClE=[tex](2*1*10^{5})+ (2*2*10^{5})+ (2*5*10^{5})+ (2*2*10^{5})[/tex]

CPU CLOCK CYClE=[tex]2*10^{6}[/tex]

ACCESS MORE