The gated-clock trap

You will learn

Why gating a clock with logic makes a new domain, and what a clock enable is for.

Gating a clock with logic -- an AND gate on the clock line to save power -- cuts the clock with a signal that changes at data speed, makes glitches, and quietly creates a new clock domain of everything downstream. The rule: never gate a clock; use a clock enable, which the flop samples at the edge instead of the edge sampling it. The widget shows the discipline of proving such claims: two bitstreams that differ in three bits, and a knockout build per bit, each clearing one, so no bit can claim credit it does not earn. The spec frame opens clock_domain.t27, whose gated_clk source kind is the model of this trap.

Open the interactive lesson →