Worked Examples

All 11 examples from the slides, fully solved. Try each before revealing — that's where the real learning happens.

Clock & Cycles

WE-1smallClock frequency = 200 MHz. Find the cycle time.
WE-2bigA program runs in 10 s on computer A (4 GHz). Computer B should run it in 6 s, but needs 1.2× as many clock cycles. What clock rate should B target?

CPI & Comparing Machines

WE-3bigSame ISA. A: cycle 250 ps, CPI 2.0. B: cycle 500 ps, CPI 1.2. Which is faster, by how much?
WE-4small30 ADD (CPI 2) and 10 MUL (CPI 4). Find total cycles and average CPI.
WE-5bigClasses A,B,C have CPI 1,2,3. Seq 1 = (A=2,B=1,C=2); Seq 2 = (A=4,B=1,C=1). Which is faster, by how much, and the CPI of each?
WE-6smallA Java app runs 15 s. A new compiler needs 0.6× as many instructions but raises CPI by 1.1×. New run time?

The MIPS Pitfall

WE-7big4 GHz. CPI A/B/C = 1/2/3. Compiler 1 → (A=5,B=1,C=1) billions; Compiler 2 → (A=10,B=1,C=1). Faster by MIPS? By execution time?

Amdahl's Law

WE-8smallFraction f of time enhanced by factor r. Prove Speedup = 1/(1 − f + f/r).
WE-9bigProgram runs 100 s; multiply takes 80 s. How much must multiply speed up to make the program (a) 4× faster, (b) 5× faster?
WE-10bigAll FP instructions made 5× faster. Benchmark was 10 s, half spent on FP. Find the overall speedup.
WE-11bigAll FP instructions made 5× faster. Program runs 100 s; new hardware gives overall speedup 3. How much of the original time was FP?