Question

In: Computer Science

Consider two different implementations, P1 and P2, of the same instruction set. There are five classes...

Consider two different implementations, P1 and P2, of the same instruction set. There are five classes of instructions (A, B, C, D, and E) in the instruction set. The clock rate and CPI of each class is given below.

CLK Rate

CPI for A

CPI for B

CPI for C

CPI for D

CPI for E

P1

2 GHz

1

1

3

3

2

P2

3 GHz

1

2

3

4

3

The total number of instructions for Program X1 are A1, B1, C1, D1 and E1 while the total number of instruction s for X2 are A2, B2, C2, D2, and E2. Compute which program runs faster on each computers P1 and P2.values are A1=230,B1=370,C1=300,D1=140,E1=95 AND A2=330,B2=250,C2=400,D2=180,E2=185

Solutions

Expert Solution

For program X1:-

processor P1,

Total number of cycles = (Number of Instruction of type)*CPI of type

=A1*CPI of A + B1*CPI B + C1*CPI C + D1*CPI D + E1*CPI E

= 230*1+370*1+300*3+140*3+95*2

= 230+370+900+420+190

2110 cycles

Execution Time = Number of cycles /Clock Frequency

= 2110/2*10^9 Hz = 1.055*10^-6 sec

.

.

processor P2,

Total number of cycles = (Number of Instruction of type)*CPI of type

=A1*CPI of A + B1*CPI B + C1*CPI C + D1*CPI D + E1*CPI E

= 230*1+370*2+300*3+140*4+95*3

= 230+740+900+640+285

2795 cycles

Execution Time = Number of cycles /Clock Frequency

= 2795/3*10^9 Hz = 0.93167*10^-6 sec

For X1,

Execution time on P2 i.e 0.9316*10^-6 is less than that on P1 i.e 1.055*10^-6

.

.

.

For program X2:-

processor P1,

Total number of cycles = (Number of Instruction of type)*CPI of type

=A2*CPI of A + B2*CPI B + C2*CPI C + D2*CPI D + E2*CPI E

= 330*1+250*1+400*3+180*3+185*2

= 330+250+1200+540+370

2690 cycles

Execution Time = Number of cycles /Clock Frequency

= 2690/2*10^9 Hz = 1.345*10^-6 sec

.

.

processor P2,

Total number of cycles = (Number of Instruction of type)*CPI of type

=A2*CPI of A + B2*CPI B + C2*CPI C + D2*CPI D + E2*CPI E

= 330*1+250*2+400*3+180*4+185*3

= 330+500+1200+720+555

3305 cycles

Execution Time = Number of cycles /Clock Frequency

= 3305/3*10^9 Hz = 1.10167*10^-6 sec

For X2,

Execution time on P2 i.e 1.10167*10^-6 is less than that on P1 i.e 1.345*10^-6

.

Both X1,X2 runs faster on P2.

.

.

.

If any doubt ask in the comments.


Related Solutions

Consider three different processors P1, P2, and P3 executing the same instruction set. P1 has a...
Consider three different processors P1, P2, and P3 executing the same instruction set. P1 has a 3 GHz clock rate and a CPI of 1.5. P2 has a 2.5 GHz clock rate and a CPI of 1.0. P3 has a 4.0 GHz clock rate and has a CPI of 2.2. a. Find execution time for each processor for a program with 2 x 10 9 instructions. Which one is the fastest? b. If the processors each execute a program in...
Consider three different processors P1, P2, and P3, executing the same instruction set. P1 has a...
Consider three different processors P1, P2, and P3, executing the same instruction set. P1 has a clock cycle time of 300 picosecond and a CPI (clock cycles per instruction) of 1.5. P2 has a clock cycle time of 400 picosecond and a CPI of 1.0. P3 has a clock cycle time of 250 picosecond and a CPI of 2.0. P1 is running a program with 10 instructions. P2 is running a different program with 20 instructions. P3 is running a...
Consider three different processors P1, P2, and P3 executing the same instruction set. P1 has a...
Consider three different processors P1, P2, and P3 executing the same instruction set. P1 has a 3 GHz clock rate and a CPI of 1.5. P2 has a 2.5 GHz clock rate and a CPI of 1.0. P3 has a 4.0 GHz clock rate and has a CPI of 2.2. a. Which processor has the highest performance expressed in instructions per second? b. If the processors each execute a program in 10 seconds, find the number of cycles and the...
Consider two different implementations of the same instruction set architecture. The instructions can be divided into...
Consider two different implementations of the same instruction set architecture. The instructions can be divided into four classes according to their CPI (classes 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,...
Consider three different processors P1, P2 and P3 executing the same instruction set with clock rates...
Consider three different processors P1, P2 and P3 executing the same instruction set with clock rates and CPI given in the following table: Processor Clock Rate CPI P1 2 GHz 1.5 P2 1.5 GHz 1.0 P3 3 GHz 2.5 c) We are trying to reduce the execution time by 30% but this leads an increase of 20% in the CPI. What clock rate should we have to get this time reduction? b) If the processors each execute a program in...
Consider two different implementations of the same ISA. There are four classes of instructions, Arithmetic, Store,...
Consider two different implementations of the same ISA. There are four classes of instructions, Arithmetic, Store, Load, and Branch. The clock rate and CPI of each implementation are given in the following table.              Clock Rate                  CPI-Arithmetic CPI-Store             CPI-Load    CPI-Branch P1           2.0 GHz                        1                                     2 3                                4 P2           2.5 GHz                        2    2 2                             2 Given a program with 10^6 instructions divided into classes as follows: 10% Arithmetic, 20% Store, 50% Load, and 20% Branch, which implementation is faster?
. Consider this hypothesis test: H0: p1 - p2 = < 0 Ha: p1 - p2...
. Consider this hypothesis test: H0: p1 - p2 = < 0 Ha: p1 - p2 > 0 Here p1 is the population proportion of “happy” of Population 1 and p2 is the population proportion of “happy” of Population 2. Use the statistics data from a simple random sample of each of the two populations to complete the following:​​​​​​ Population 1 Population 2 Sample Size (n) 1000 1000 Number of “yes” 600 280 a. Compute the test statistic z. b....
1. Consider this hypothesis test: H0: p1 - p2 = < 0 Ha: p1 - p2...
1. Consider this hypothesis test: H0: p1 - p2 = < 0 Ha: p1 - p2 > 0 Here p1 is the population proportion of “happy” of Population 1 and p2 is the population proportion of “happy” of Population 2. Use the statistics data from a simple random sample of each of the two populations to complete the following:​​​​​​ Population 1 Population 2 Sample Size (n) 1000 1000 Number of “yes” 600 280 a. Compute the test statistic z. b....
Consider this hypothesis test: H0: p1 - p2 = 0 Ha: p1 - p2 > 0...
Consider this hypothesis test: H0: p1 - p2 = 0 Ha: p1 - p2 > 0 Here p1 is the population proportion of “yes” of Population 1 and p2 is the population proportion of “yes” of Population 2. Use the statistics data from a simple random sample of each of the two populations to complete the following: (8 points) Population 1 Population 2 Sample Size (n) 500 700 Number of “yes” 400 560   Compute the test statistic z. What is...
Assume you have two processes, P1 and P2. P1 has a high priority, P2 has a...
Assume you have two processes, P1 and P2. P1 has a high priority, P2 has a low priority. P1 and P2 have one shared semaphore (i.e., they both carry out waits and posts on the same semaphore). The processes can be interleaved in any arbitrary order (e.g. P2 could be started before P1).             i.             Explain the problem with priority inversion Briefly explain whether the processes could deadlock when:            ii. both processes run on a Linux system as...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT