Question

1. (10 points) Suppose you have a load-store computer with the following instruction mix Operation Frequency Number of clock cycles ALU ops Loads Stores Branches 40 % 20 % 18% 22 % 4 4 The ALU ops (arithmetic logic unit ops) typically use operands in CPU registers and hence they take fewer clock cycles to execute. However, if you want to add a memory operand to a CPU register, then you would have to explicitly load it into a CPU register. For such ALU operations, you would say that they are paired with a load instruction since the value moved from memory would be used only for the particular ALU operation and not used anywhere else. We observe that 30% of the ALU ops are paired with a load (ie., they occur together), and we propose to replace these ALU ops and their loads with a new instruction. Assume that this new instruction takes 4 clock cycles. However, with the new instruction added, branches will take 8 clock cycles rather than 6. Assuming that the clock rate is unchanged, would this change improve performance? Justify your answer quantitatively by comparing expressions for CPU Execution time, Show all vour work

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

First let's find out the CPU execution time for the given scenario let's call it CPU1:-

average number of cycles per instruction = total number of cycles / total number of instruction

= (0.4 * 2 + 0.2 * 4 + 0.18 * 4 + 0.22 * 6 )/1

=0.8 + 0.8 +0.72 + 1.32

=3.64 cycles/instruction

CPU1 execution time = number of instructions * average number of cycles/instruction * cycle time

= 1*3.64 * t (cycle time = t)

= 3.64t

now,let the case of CPU2:-

here,30% of the ALU ops are being replaced by new kind of instruction which takes 4 clock cycles.let's call these new instruction as ALU2 ops.

now overall percentage of this new instruction in instruction set = 30% of 40

= (30 * 40) /100 = 1200/100 = 12% in overall

so,remaining 28% is ALU ops instruction which still takes 2 cycles.

now average number of cycles per instruction = (0.28 * 2 + 0.12 * 4 + 0.2 * 4 + 0.18 * 4 + 0.22 * 8)/1

=3.1072 cycles/instructions
CPU2 execution time = number of instructions * average number of cycles/instruction * cycle time

= 1* 3.1072 * t

=3.1072 t    (cycle time doesn't change)

clearly we can see that CPU2 takes less time than CPU1 so,second approach is more faster than first approach.

Add a comment
Know the answer?
Add Answer to:
1. (10 points) Suppose you have a load-store computer with the following instruction mix Operation Frequency...
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