Course: Computer Architectures
Worked example: Lab 02 - Neural Computation and Amdahl Law
Improving one part of a program helps only to the extent that it reduces the program’s elapsed execution time.
The fixed remainder model
Let baseline execution time be T, the improved part’s fraction be f, and its speedup be s. If the remaining time is unchanged:
Define the fraction against the same baseline cost used for the speedup. Do not use an instruction-count fraction when the formula needs a time fraction.
EX work and elapsed cycles are different costs
The Lab 02 manual exercise sums instruction EX latencies. That is a useful additive model, but pipelined instructions can overlap, and stages outside EX also affect completion. Therefore, a functional unit’s share of the EX sum is not automatically its share of elapsed time.
For the final program:
Multiplication contributes 180/546 of that sum. Changing its latency from 6 to 4 gives:
Measured forwarding-on cycles instead change from 574 to 514:
Both calculations are internally consistent; they model different costs. In this observed case, a fixed 60-cycle elapsed saving also fits the measurements.
Why a faster unit can give a slower pipeline run
Lab 02 changed FP ALU latency from 4 to 3. The EX sum fell from 546 to 513, but measured elapsed cycles increased from 574 to 575 in two runs.
The exports show the initial FP move reaching M one cycle earlier, where the second load otherwise used the stage. That load then waits, delaying the multiply dependent on it. Changes to stage alignment and other waits can absorb an arithmetic latency reduction or expose a new conflict.
This is a resource scheduling effect, not evidence against Amdahl’s law. The fixed unaffected-time assumption is not satisfied by this change to the whole pipeline schedule.
How to compare configurations
- Keep program and input fixed; isolate diagnostic inputs.
- Restore all unchanged settings before each independent case.
- Record elapsed cycles, executed instructions and numerical correctness.
- Compute speedup as baseline elapsed cycles divided by new elapsed cycles when frequency is unchanged.
- State whether a manual fraction describes EX work or elapsed time.
- Inspect dependencies and resource conflicts when a predicted improvement is absent or reverses.
At a fixed frequency, CPU time is cycles/frequency; the cycle ratio and execution-time ratio are the same. CPI and IPC must use matching instruction and cycle scopes.
Sources
Amdahl formula: Lab 02 assignment. Numerical examples and stage observations: the final 12 October 2026 experiments documented in Lab 02 - Neural Computation and Amdahl Law. The distinction between additive EX work and elapsed time is added study explanation.
Related: Pipeline CPI and Stall Costs, Latency and Initiation Interval, Instruction Dependencies, Pipelining.