Question
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
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started