CLKCLKT = 0.33 ns ≈ 333 pssetupCLKD at FF2✓ stored · 50 ps to sparesetupCLKD at FF2✗ missed · 117 ps latesetupCLKD at FF2✓ stored · 0 ps to sparesetupCLK FF2CLK FF1D at FF2✗ missed · 10 ps lateDQDQINOUTCLK1010101FF1XTALANDORANDFF20101
Lit wire with moving dashes: it carries a 1 (the clock wires blink with the beat)Glowing token: the new value 1 racing from flip-flop 1 to flip-flop 2Timeline screen: the clock and the value at D against time; shaded strip = setup windowGlow on a flip-flop's clock pin: a rising edge arrivingA crystal oscillator drives one clock for both flip-flops. A new value leaves flip-flop 1 on a rising edge and must cross three gates and settle before the next edge reaches flip-flop 2. Period and frequency are each other's inverse: T = 1 / f. 3 GHz is 3 × 10⁹ cycles per second, so T = 1 / (3 × 10⁹) s ≈ 3.33 × 10⁻¹⁰ s ≈ 0.33 ns (NIST SI prefixes: giga 10⁹, nano 10⁻⁹, pico 10⁻¹²). The setup-time rule for a path between two flip-flops is Tc ≥ tpcq + tpd + tsetup: clock-to-Q delay, plus the propagation delay of the logic, plus the setup time. The slowest such path is the critical path and sets the shortest period, so the highest clock frequency (Harris and Harris, Digital Design and Computer Architecture, section 3.5). Clock skew is the difference in arrival time of the clock edge at different flip-flops. In the worst case it is added to the path: Tc ≥ tpcq + tpd + tsetup + tskew (Harris and Harris, section 3.5.3). Skew can also cause hold-time errors, which this lesson leaves out.

The clock

  1. A tiny slice of quartz crystal vibrates at a very steady rate when powered. An oscillator circuit turns that vibration into a clock signal: a wire that flips between 0 and 1, again and again, at a fixed pace.

The race

Top speed

The timing budget

;; step 1/11 · crystal
;; about: Crystal, Clock
crystal oscillator
  quartz vibrates at a fixed rate
  → a steady 0, 1, 0, 1 … signal

In a processor, a circuit called a
phase-locked loop (PLL) multiplies the
crystal's slower beat up to the
GHz core clock.

The delays in the race (100 ps clock-to-Q, 100 ps per gate stage, 50 ps setup) are round example numbers so the sums stay easy. Real gates list their delays in their datasheets; older chips such as the 74HC00 take nanoseconds, gates inside a modern processor only picoseconds. In Python, 1e-12 is 10⁻¹² (one picosecond in seconds) and 3e9 is 3 × 10⁹, so 1 / 3e9 gives the period of a 3 GHz clock in seconds.