8.4 Instruction Timing and Performance
Section 8.3 arranged work into control time slots. Real hardware must also allow signals enough time to propagate before the next clock edge. Timing analysis connects the physical delay of one slot to the execution time of a complete workload.
The critical path sets the shortest safe clock period
After a source register launches a value, the value passes through combinational logic before a destination register captures it. The destination input must become stable early enough to satisfy the register's setup time.
In a simplified timing budget:
The critical path is the longest path that must finish within one clock cycle. It determines the minimum safe clock period and therefore the maximum safe clock frequency:
Suppose a register-add path needs 1+4+1+1=7 ns, while a memory-load path needs 1+5+1+1=8 ns. With one shared clock, the memory-load path is critical, so 8 ns is the shortest safe period. Its theoretical ceiling is:
Timing slack measures the unused part of the period:
Positive slack is safe in this model, zero slack exactly meets the budget, and negative slack is a timing violation. At a 7 ns period, the register-add path has zero slack but the memory-load path has −1 ns. The clock cannot be chosen from an average path delay; every required path must meet timing.
Program time combines instruction count, CPI, and clock rate
Clock frequency alone does not determine processor performance. For a particular workload:
Equivalently:
CPI means cycles per instruction. Instructions can have different CPIs, so a workload uses a weighted average:
Wait states, branch behavior, memory traffic, and prefetch success can change the effective CPI. On the 8086, the BIU can prefetch instruction bytes while the EU executes, but a control transfer or a busy bus can reduce that overlap. The equation still applies; these effects appear in the measured or modeled average CPI.
For 100,000 instructions, a 5 MHz reference CPU with CPI=4 takes:
A candidate at 8 MHz has base CPI=3. If 50% of its instructions each add two memory wait cycles, its average CPI is 3+0.50×2=4, and it takes 50 ms. The speedup is:
This example also separates latency from throughput. Latency is the time for one task or instruction to finish; throughput is the amount of work completed per unit time. Overlap can improve throughput without shortening every individual instruction's latency.
Chapter 8 has connected instruction phases, datapath routes, control signals, and timing. Chapter 9 will move outward to the bus cycles that carry processor requests to memory and I/O devices.