I need help with the following Computer Architecture question:
Consider two different implementations, M1 and M2, of the same instruction set. There are three classes of instructions (A, B, and C) in the instruction set. M1 has a clock rate of 90 MHz and M2 has a clock rate of 80 MHz. The average number of cycles for each instruction class and their frequencies (for a typical program) are as follows:
Instruction Class |
Machine M1 – Cycles/Instruction Class |
Machine M2 – Cycles/Instruction Class |
Frequency |
A |
2 |
1 |
60% |
B |
3 |
2 |
30% |
C |
1 |
3 |
10% |
a) Calculate the average CPI for each machine, M1 and M2.
b) Which machine has the better performance? Show your reasoning.
// SIMILAR PROBLEM BELOW:
Two compilers are used for a 1GHz machine. There are three classes of instructions: Class A, Class B, and Class C, which requires 2, 4 and 5 cycles (respectively). Both compilers are used to produce code.
Compiler 1 generates code with 1 million Class A instructions, 3 million Class B instructions, and 2 million Class C instructions.
Compiler 2 generates code with 5 million Class A instructions, 1 million Class B instructions, and 1 million Class C instructions.
Which sequence will be faster (higher performance)? Explain.
Solution:
CLOCK CYCLES compiler1:
CC1 = (1,000,000 * 2) + (3,000,000 * 4) + (2,000,000 * 5)
CC1 = 24,000,000 clock cycles
CLOCK CYCLES compiler2:
CC2 = (5,000,000 * 2) + (1,000,000 * 4) + (1,000,000 + 5)
CC2 = 19,000,000
Compiler 2 will clearly be faster. Compiler 1 requires 24e6 instructions while compiler 2 only requires 19e6 instructions to execute the same set of instructions.
Execution Time 1 = 24,000,000 / 1 GHz
= 24 x 10-3 seconds
Execution Time 2 = 19,000,000 / 1GHz
= 19 x 10-3 seconds
Compiler 2 utilizes class A, which has the highest CPI of the three classes, to the do bulk of the computational work. The result is an efficiency advantage versus compiler1.
a)
Average CPI for machine M1 =
Average CPI for machine M2 = 1* 60/100 +2*30/100+3*10/10 = 4.2
b)
Average time per instruction for M1= 3.1/(1000000*90) seconds=3.4444e-08 seconds
Average time per instruction for M2= 4.2/(1000000*80) seconds=5.2500e-08 seconds
So the M1 is better
I need help with the following Computer Architecture question: Consider two different implementations, M1 and M2,...
Question 1: Consider two different implementations, M1 and M2, of the same instruction set. There are four classes of instructions (A, B, C, and D) in the instruction set. M1 has a clock rate of 500 MHz while M2’s clock rate is 750 MHz. The average number of cycles for each instruction class of M1 and M2 are shown in the following table: Class CPI for this class on M1 CPI for this class on M2 A 1 2 B...
Consider two different implementations, M1 and M2, of the same
instruction set. There are three classes of instructions (A, B, and
C) in the instruction set. M1 has a clock rate of 80 MHz and M2 has
a clock rate of 100 MHz. The average number of cycles for each
instruction class and their frequencies (for a typical program) are
as follows:
(a) Calculate the average CPI for each machine, M1, and M2.
(b) Calculate the average MIPS ratings for...
Consider two different implementations of the same instruction set architecture. There are 5 classes of instructions, A, B, C, D, and E. The clock rate and CPI of each class is given in the following table. Machine Clock Rate CPI class A CPI class B CPI class C CPI class D CPI class E P1 1.0 GHz 1 1 2 3 2 P2 1.5 GHz 1 2 3 4 3 What are the performances of P1 and P2 expressed in...
We are comparing the performance of two different microprocessors, M1 and M2. Assume a program P will be compiled into M2 instructions counting 20% more than M1 instructions. M1 has a 2 GHz clock rate while M2 has a 3 GHz clock rate. Instructions on these two machines can be classified into 3 classes as shown in the following table. Which machine has better MIPS? Which machine has better performance? By how much? Justify your answers. Instruction Class Cycles needed...
(e) Suppose we measure the code for the same program from two different compilers and obtain the following data. Assume clock rate is 3GHz, which code sequence will execute faster according to execution time? or According to MIPS? By how much? (25 pts CPI for Instructions Code from Instruction Count (billions) CPI Compiler 1 Compiler 2 9 1 3
(e) Suppose we measure the code for the same program from two different compilers and obtain the following data. Assume clock...
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 2, 4, 3, and 2 and P2 with a clock rate of 3.5 GHz and CPIs of 3, 3, 2, and 3. a. Given a program with a dynamic instruction count of 1.0E8 instructions divided into classes as follows: 30% class...
Please Solve 1(c).
itby important Q. Disc uss the features of RISC and CISC Architecture. dware implementations Mt &t M2 of the same instruction set. There are three classes F, I & N of instructions in the instruction The average CPl for the three instructi Class set. Miclock rate is 600 MHz, M2's clock cycle is 2ns. on classes on M1 & M2 are as follows: Comments Floating Point Integer Arithmetic Non-arithmetic CPI for M 5.0 2.0 2.4 CPI for...
Question 2 Performance of Compilers [25 pts.) In this question, we are given two different compilers with name Batman and Robin that are tested for 1 GHz. machine with 3 classes of instructions: Class Bane, Class Dent and Class Penguin that requires 1, 2 or 3 cycles respectively. We have a huge line of code and we will compare the performance of these compilers. Batman Robin Bane Instructions 10 million 20 million Dent Instructions 3 million 1 million Penguin Instructions...
Performance of Compilers [25 pts.] In this question, we are given two different compilers with name Batman and Robin that are tested for 1 GHz. machine with 3 classes of instructions: Class Bane, Class Dent and Class Penguin that requires 1, 2 or 3 cycles respectively. We have a huge line of code and we will compare the performance of these compilers. Batman Robin Bane Instructions 10 million 20 million Dent Instructions 3 million 1 million Penguin Instructions 2 million...
About computer architecture and organization.
Please solve those questions
Thank you
2. A certain program has the following instruction classes, CPIs, and mixtures: Instruction Type CPI ratio 1.5 .40 2.1 .35 3 a. What is the average CPI for this processor? b. You have the following options: • Option 1: Reduce the CPI of instruction type B to 1.8 • Option 2: Reduce the CPI of instruction type C to 2.5 Which option would you choose and why? 3. Consider...