Skip to main content
Be Bitwise

Clock Generation & Distribution

Clock Distribution & Power Management · Hardware Foundations track

11 min read

In this module

The Heartbeat of a Processor

Every synchronous digital circuit hangs on a clock signal: a periodic waveform that orchestrates when data moves between registers. Without a stable, well-distributed clock, a processor doesn't run. The clock tells every flip-flop in the chip exactly when to sample its input and update its output. Getting that signal to billions of transistors at the same instant, with minimal variation in arrival time, is one of the hardest engineering problems in chip design.

Crystal Oscillators

The clock system starts with a crystal oscillator sitting on the motherboard. A precisely cut sliver of quartz, mounted between two electrodes, vibrates at its natural resonant frequency when you put an electric field across it. The piezoelectric effect that produces is your stable frequency reference.

A typical motherboard crystal oscillates at 100 MHz (the Base Clock, or BCLK, on Intel platforms). The choice has nothing to do with CPU frequency. It just gives you a clean, stable reference that downstream circuits can multiply up to whatever they actually need.

Crystals earn their place because of frequency stability, usually within a few parts per million (ppm) across temperature and voltage. A 25 ppm crystal at 100 MHz drifts by at most 2,500 Hz, which digital logic doesn't care about. No on-chip oscillator gets close to that, because quartz has a far higher quality factor (Q) than any silicon-based resonator.

Why Not Generate the Clock On-Chip?

On-chip ring oscillators and LC oscillators are smaller and cheaper than external crystals, but they're hopeless on stability. Process variation, voltage fluctuation, and temperature swings can drift their frequency by several percent. Some microcontrollers happily use internal oscillators in cost-sensitive applications. Anything that demands precise timing (high-speed serial links, memory interfaces, multi-chip synchronisation) needs a crystal reference.

Phase-Locked Loops (PLLs)

The crystal's 100 MHz is glacial compared to a modern CPU core running at 4-5 GHz. A Phase-Locked Loop (PLL) bridges that gap by multiplying the reference frequency.

A PLL is a feedback control system with four key components:

  1. Phase Detector: Compares the phase and frequency of the reference clock against the feedback clock. Lagging feedback gets an "up" signal; leading feedback gets a "down" signal.

  2. Charge Pump and Loop Filter: Turns the up/down signals into a smooth analogue voltage. The loop filter, typically a low-pass RC network, sets the PLL's bandwidth, stability, and lock time.

  3. Voltage-Controlled Oscillator (VCO): Outputs a frequency proportional to its control voltage. Higher voltage, higher frequency. The VCO is the beating heart of the PLL.

  4. Frequency Divider: Divides the VCO output by a programmable integer N. The divided-down signal feeds back into the phase detector.

Once locked, the PLL drives the VCO to whatever frequency makes the divided-down output match the reference. With N = 50 and a 100 MHz reference, you get 100 MHz x 50 = 5 GHz out the other end. Change N and the output frequency changes with it. That's exactly the lever the CPU pulls during Dynamic Voltage and Frequency Scaling (DVFS).

Key Concept
PLL Lock Time

When the divider ratio changes (e.g., during a frequency transition), the PLL must re-lock to the new frequency. This takes microseconds, during which the clock is unstable. The processor must either stall or run from a backup clock during this transition. Fast PLL lock times are critical for responsive DVFS.

Fractional-N PLLs

Integer-N PLLs only produce frequencies that are exact integer multiples of the reference. Fractional-N PLLs cheat by toggling the divider between two integer values (between N and N+1, say) to achieve an effective fractional ratio. The result is finer frequency control, handy for generating precise clocks for serial interfaces like PCIe, USB, and SATA, whose required frequencies rarely line up with a clean integer multiple.

Clock Domains

A modern processor doesn't run on a single frequency. Different functional blocks have different performance demands and power budgets. Each block lives in its own clock domain, fed by its own PLL or clock divider:

  • Core clock: The highest frequency, driving the execution pipeline. Often 3-5 GHz.
  • Uncore/ring clock: The shared L3 cache and interconnect. Often slightly lower than the core clock.
  • Memory controller clock: Tied to the DRAM interface by a fixed ratio. DDR5-5600 has a 2800 MHz I/O clock, but controllers commonly run at half or a quarter of that (the "Gear 2" and "Gear 4" modes on recent Intel parts, for example) and widen their internal datapath to keep up.
  • PCIe clock: 100 MHz reference for the PCIe serialisers/deserialisers.
  • USB, SATA, display clocks: Each interface has its own frequency requirements.

Running everything at the top speed would burn obscene amounts of power for nothing. A memory controller gains nothing from sprinting at 5 GHz when the DRAM interface tops out at a 2800 MHz I/O clock. Separate clock domains let each block run at the frequency and voltage that suits it, saving power where speed is wasted.

The seam between clock domains brings its own headache: clock domain crossing (CDC). Data hopping from one domain to another has to be carefully synchronised, or metastability will eat you. CDC is meaty enough to deserve its own lesson (Lesson 2).

Clock Trees

Once the PLL generates the right frequency, the clock signal still has to reach every flip-flop in the domain. A modern CPU core packs millions of flip-flops scattered across several square millimetres of silicon. The clock tree is the network of wires and buffers that fans the clock out from the PLL to every sequential element.

The Skew Problem

If flip-flop A feeds flip-flop B and the clock reaches B 100 picoseconds before it reaches A, the combinational logic between them has 100 ps less time to produce a valid result. That gap in arrival time is clock skew. Too much of it and you get timing violations and functional failures.

The aim of clock tree design is to minimise skew by ensuring every path from clock source to flip-flop has equal delay.

H-Tree Distribution

The H-tree is a classic balanced distribution topology. Starting from the clock source at the centre, the signal splits into two equal branches, each of which splits again, forming a pattern that resembles the letter H at each level of branching:

Because every path from root to leaf walks through the same number of branches and the same total wire length, every flip-flop sees the clock edge at roughly the same instant. In practice, manufacturing variation, temperature gradients, and voltage gradients sneak in some residual skew, but the H-tree is the best starting shape.

Skew doesn't only eat into the cycle. Call the launching flop's clock arrival t_launch and the capturing flop's t_capture, so skew is t_capture - t_launch. When the capture clock is late (positive skew), the data gets extra time to arrive, which helps the setup time check, but the capture flop is also still looking at its input when the next value races through the fastest logic path, which hurts the hold time check. Running the clock slower fixes a setup failure. A hold failure stays broken at any frequency.

Below, put +50 ps on buffer 1b and watch one path fail hold while another fails setup. Then drag the clock period up and notice that only the setup failure goes away.

Clock skew in an H-tree

Every path from the root to a flip-flop passes the same wires and buffers, so a balanced tree has zero skew. Slow one buffer down and every flip-flop beneath it sees the edge late. All delays are illustrative.

FF0130 psFF1130 psFF2130 psFF3130 psPLL
Pick a buffer to detune
Worst skew
0 ps
Setup failures
0 of 4
Hold failures
0 of 4

Every path meets setup and hold. Setup passes on every path down to T_clk = 490 ps.

Timing for each launch to capture path
PathLogic min/maxt_launch → t_captureSkewSetup slackHold slack
FF0→FF140/380130 → 1300 ps+50 ps pass+60 ps pass
FF1→FF215/200130 → 1300 ps+230 ps pass+35 ps pass
FF2→FF310/300130 → 1300 ps+130 ps pass+30 ps pass
FF3→FF060/420130 → 1300 ps+10 ps pass+80 ps pass
skew = t_capture − t_launch
setup slack = T_clk − (t_launch + t_cq + t_logic_max + t_setup − t_capture)
hold slack = (t_launch + t_cq + t_logic_min) − (t_capture + t_hold)

Positive skew means the capture clock arrives late. That gives the data longer to get there, so setup slack grows by the skew, but the capture flop also keeps watching its input for longer after the launch edge, so hold slack shrinks by the same amount. Negative skew does the reverse. A slower clock rescues setup and does nothing for hold, because T_clk isn't in the hold equation.

Illustrative values: buffer 40 ps, wire 30/20/10 ps into levels 1/2/3, clock-to-output delay t_cq 40 ps, setup time t_setup 30 ps, hold time t_hold 20 ps. Arrival times are in ps after the root edge.

Modern clock tree synthesis (CTS) tools build more elaborate structures than pure H-trees, dropping buffers at optimal points, tweaking wire widths, and inserting deliberate delay elements to cancel out local variations. High-performance CPUs go further: a top-level tree or set of spines drives a clock mesh, a grid of wires shorted together that averages out skew between regions, and local trees hang off the mesh to reach the flip-flops. Some designs add active deskew circuits that measure the arrival time in different regions and tune delays at run time. Meshes cost a lot of power, which is why lower-power chips stick with trees.

Clock Buffers and Repeaters

A clock signal feeding millions of flip-flops fights against an enormous capacitive load. The wire capacitance alone would soften the signal's edges, turning sharp transitions into mushy slopes that no longer trigger flip-flops cleanly. Clock buffers are specialised amplifier circuits dropped along the tree to restore signal integrity.

Key properties of clock buffers:

  • Low skew: Matched rise and fall times, so the buffer does not shift the clock edge in one direction
  • High drive strength: Capable of charging the capacitance of the next tree segment quickly
  • Low jitter: Minimal noise-induced variation in the output edges
  • Balanced loading: Each buffer output drives roughly equal loads to maintain symmetry

A large processor may carry thousands of clock buffers stacked into 10-15 levels of hierarchy. The total power burned by the clock tree (buffers plus wire charging) can hit 25-40% of the chip's total dynamic power. That eye-watering figure is exactly why techniques like clock gating exist.

Clock Gating

Clock gating kills the clock to idle parts of the circuit, taking their switching power with it. A gating cell (typically an AND or OR gate with a latch) blocks the clock from reaching flip-flops that don't need to update this cycle. Modern processors gate clocks at fine granularity. Individual execution units, register file banks, even cache ways can have their clocks stopped when idle. Clock gating is the heaviest hitter for cutting dynamic power.

Clock Jitter

Where skew is spatial variation (different arrival times at different locations), clock jitter is temporal variation at a single point. The clock edge doesn't arrive at perfectly periodic intervals; it wobbles slightly from cycle to cycle.

Where jitter comes from:

  • Power supply noise: Voltage wobble in the PLL's supply nudges the VCO frequency
  • Thermal noise: Random thermal fluctuations in the VCO transistors
  • Substrate coupling: Switching activity in nearby digital logic injects noise into the PLL through the shared silicon substrate
  • Reference clock jitter: Any jitter on the crystal oscillator is passed straight through (and sometimes amplified) at the PLL output

Jitter matters because it eats your useful clock period. If the period is 200 ps but jitter adds 10 ps of uncertainty, only 190 ps is left for actual logic computation. For high-speed serial links, jitter goes from annoying to existential: it sets the bit error rate.

Putting It Together

The complete clock generation and distribution path from crystal to flip-flop:

  1. Crystal oscillator produces a stable 100 MHz reference
  2. PLL multiplies this to the target frequency (e.g., 5 GHz for the core domain)
  3. Clock tree distributes the signal through a balanced hierarchy of buffers
  4. Clock gating cells selectively block the clock to idle regions
  5. Flip-flops sample their inputs on the clock edge

Every component in this chain has to be designed to minimise skew and jitter without blowing the power budget. The clock system is often the first thing designed and the last thing verified in a new processor, because absolutely everything else assumes it works.