Disc 6 Sol
Disc 6 Sol
2. Use the basic machine table from question 1, but assume that the frequency column indicates the
percentage of execution time spent in the corresponding instruction type. Use Amdahl’s Law to
answer the following: if you could decrease the cycle time of one of the instruction types by 1 cycle,
which instruction type would you optimize? How would the new execution time compare to the
original one?
1
CS232 Section 6: Performance - Solutions
4. Assume the following delays for the main functional units of the single-cycle datapath shown below:
(a) lw (in that order): access memory (to read instruction), read operands from register
file, ALU (effective address calculation), access memory (to read data) and write
back to register file (the data read from memory).
(b) sw (in that order): access memory (to read instruction), read operands from register
file, ALU (effective address calculation), access memory (to write data).
(c) add (in that order): access memory (to read instruction), read operands from register
file, ALU (ALU computation based on func value) and write back to register file
(value computed in ALU).
Assuming the instructions are executed on a single-cycle machine with 10ns cycle time, compute:
6. Assume that the code above is executed on a 5-stage pipelined machine discussed in lecture. You
might first draw the pipeline diagram in the space below.
If a pipeline stage takes 2ns, calculate:
(a) cycle time - 2ns
(b) instruction latency - 5 ∗ 2ns = 10ns, just like single-cycle
5instructions
(c) instruction throughput - 18ns - much better than single-cycle