Question

I need help with the following Computer Architecture question: Consider two different implementations, M1 and M2,...

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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a)

Average CPI for machine M1 = 2* 60/100 +3*30/100+1*10/10 = 3.1

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

Add a comment
Know the answer?
Add Answer to:
I need help with the following Computer Architecture question: Consider two different implementations, M1 and M2,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT