Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • RTL Foundations36
  • Combinational Design25
  • Sequential Design27
    • Flip-Flops and Registers
      • Edge-Triggered State Elements
      • D Flip-Flop with Asynchronous Reset
      • Synchronous Reset and Register Enable
      • Clock Enable vs Gated Clock
      • A Hold Violation, Worked
    • Counters and Timers
    • Shift Registers and LFSRs
    • Pipelining
    • Stalls, Bubbles and Hazards
    • Retiming
  • FSM & Control27
  • Timing & Clocking39
  • Reset & CDC34
  • Memory & Buses57
  • Advanced RTL28
  • Senior & Interview76
  • Glossary and Notation
Loading lesson

←Flip-Flops and Registers
  1. Topics
  2. RTL Design
  3. Sequential Design
  4. Flip-Flops and Registers
  5. Clock Enable vs Gated Clock
On this page

    Part 3 of 9, lesson 4 of 27Part 3 of 9/Sequential/Lesson 4 of 27Intermediate

    Clock Enable vs Gated Clock

    Clock enable and gated clocks both hold registers, with different power and risk costs.

    A bare AND gate on a clock turns an enable that changes while the clock is high into a runt pulse, and a flop on that clock captures at the wrong moment. A latch-based gate removes the hazard.

    After this lesson you can: choose between a clock enable and clock gating, and explain why a gating enable must be latched while the clock is high.

    Two ways to hold a value

    Clock enable

    Fine-grain gating (tool-inserted ICG)

    Coarse gating (architectural)

    How

    Feedback mux: d_in = en ? d : q

    Synthesis maps an if (en) register bank onto an ICG cell instead of a mux

    A designer stops the clock of a whole block while it is idle

    Clock tree

    Unchanged: every flop still sees every clock edge

    The gated leaf branch toggles only when the bank is enabled

    The whole gated subtree stops while the block idles

    Power

    Clock pins still switch every cycle; the mux burns power

    Saves flop clock-pin power and the enable muxes on each gated bank

    Also saves the clock-tree buffers that feed the block

    Timing/CTS complexity

    No added clock CTS work; data and enable still need setup and hold, and dedicated enable pins depend on the library

    ICG cell on the clock path; the tool times the enable to the ICG

    Gating cell high in the clock tree, skew balancing, enable timing planned by hand

    Verification risk

    Low

    Low: the RTL still says if (en); the tool inserts the cell

    Higher: clock-domain-like behaviour, enable timing

    Typical use

    FPGA designs; ASIC registers the tool leaves ungated

    ASIC register banks that share an enable, from a few bits up (the tool has a minimum bank-width setting)

    Large idle blocks (hundreds of flops or more)

    Both styles hold the register when idle. A clock enable reloads Q on every edge, so the clock tree keeps toggling, while a gated clock stops the edges.

    The gated version below uses a plain latch plus AND for illustration. A production design uses the library's integrated clock-gating (ICG) cell, which is timed and tested as part of the clock tree. See the intentional latches lesson.

    The picture has four slots per clock period: two while clk is high and two while it is low. A pulse cut short shows up as one high slot instead of two. The same en drives both gates, and it changes twice while clk is high.

    • Bare AND gate: in g_naive, en falls one slot into the first high phase, so the gated clock is a runt pulse. Later en rises one slot into the second high phase, so a late short pulse appears. A flop clocked by either pulse can capture at the wrong moment.

    • Latch-based gate: in g_icg, the latch holds en_lat steady while clk is high. The first pulse stays full width, the late enable does nothing, and en only takes effect after clk falls.

    The ICG cell lesson runs the same two gates over six clock pulses and walks through each one.

    When gating is worth it

    Choosing between a clock enable, tool-inserted fine-grain gating and hand-placed coarse gating.

    Follow the questions from the top; every path starts from the same RTL, a register written with if (en).

    • Default: the two cheap answers, a clock enable or tool-inserted ICG cells, need no change to the RTL style.

    • Hand gating: only the bottom-right box adds clock-tree work, and it needs a measured power reason to get there.

    • Fine grain, by the tool: in ASIC flows with clock gating turned on, synthesis turns if (en) register banks into ICG cells, down to banks of a few bits. The RTL stays a plain enable, and the tool makes the enable-or-gate choice per bank.

    • Coarse grain, by hand: gating the clock of a whole idle block (for example 500 flops) also stops the clock-tree buffers feeding it. It is a candidate for a measured power comparison; confirm with power analysis.

    • Power-sensitive designs where dynamic power in the clock tree is significant.

    • FPGAs: use clock enables. The fabric has enable pins on its flops, and gating clocks in the fabric is avoided.

    Common mistakes

    • Glitches: if the enable can change while the clock is high, the gated clock can glitch. A latch (or ICG) prevents this.

    • Skew: the gating cell sits on the clock path, so the clock tree must balance gated and ungated branches.

    • Test: scan chains need the gate forced open in test mode.

    • Verification: the enable timing relative to the clock is a real design constraint, not just logic.

    “Clock enable or clock gating?” A good answer separates two kinds of gating. Write register enables as if (en); in an ASIC flow, synthesis inserts fine-grain ICG gating on banks that share an enable, down to a few bits. Hand-designed, coarse gating is reserved for large idle blocks where power matters, with attention to glitches, skew and DFT. On FPGAs, use clock enables.

    Check yourself Why must the enable of a gated clock be sampled while the clock is low?

    A change of the enable while the clock is high would cut the high pulse short (or create an extra one), producing a runt clock edge. A latch that is transparent only while the clock is low holds the enable steady during the high phase.

    Testbench

    Both registers are checked against an independent expected-Q model, with directed load, hold and asynchronous reset cases followed by 40 random operations. Enable and data are driven 1 ns into the low phase and held through the next rising edge; reset is also asserted while the gate is closed.

    reg_enable.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    // 1) Clock enable: the usual, safe style
    module reg_enable (input logic clk, rst_n, en, input logic [7:0] d, output logic [7:0] q);
      always_ff @(posedge clk or negedge rst_n)
        if (!rst_n)  q <= '0;
        else if (en) q <= d;
    endmodule
    
    // 2) Gated clock: a latch-based gate stops the clock edges
    module reg_gated (input logic clk, rst_n, en, input logic [7:0] d, output logic [7:0] q);
      logic en_l, gclk;
      always_latch if (!clk) en_l = en;            // enable captured while the clock is low
      assign gclk = clk & en_l;                    // no edge reaches the flops when disabled
      always_ff @(posedge gclk or negedge rst_n)
        if (!rst_n) q <= '0;
        else        q <= d;
    endmodule
    
    • A clock enable reloads Q every edge and the clock tree keeps toggling; a gated clock stops the edges.

    • Write plain enables; in an ASIC flow, synthesis inserts ICG cells on banks that share an enable. On FPGAs use clock enables.

    • Gating adds glitch, skew and scan-test constraints on the clock path.

    Rule of thumb: never gate a clock with a bare AND; use a latch or an ICG cell.

    How this was checked

    The testbench compares both registers with an independent expected-Q model over directed cases and 40 random operations, using legal stimulus and settled values. It does not establish arbitrary waveform equivalence, glitch immunity under timing violations, or mapped power savings.

    Production ICG timing, clock-tree synthesis and power analysis remain separate checks.

    • Practice: Safe clock gating cell with a latch-based enable

    • Practice: Low-power RTL design with clock gating

    • Interview: run a mock interview on this topic

    Related topics

    • Clock gating in the timing section

    Previous

    65 / 350

    Next: A Hold Violation, Worked

    Up next

    Up nextA Hold Violation, Worked

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Edge-Triggered State Elements
    • D Flip-Flop with Asynchronous Reset
    clkeng_naiveen_latg_icg
    A bare AND gate against a latch-based gate on the same enable