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

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • RTL Foundations36
  • Combinational Design25
  • Sequential Design27
  • FSM & Control27
  • Timing & Clocking39
  • Reset & CDC34
  • Memory & Buses57
  • Advanced RTL28
  • Senior & Interview76
    • Low-Power RTL Hub
    • DFT and Scan Hub
    • Physical Awareness Hub
    • Waveform Debug Hub
    • STA and ECO Hub
    • RTL-to-Implementation Closure
    • DFT-Ready RTL
    • Capstone: Resilient Streaming Peripheral
    • Principal Design Review
    • Senior RTL Interview Questions & Model Answers
      • Interview: Combinational and Arithmetic
        • The latch inference trap
        • Signed arithmetic and width truncation
        • Parameterized RTL and carry-chain guards
        • Glitches on enables and combinational hazards
      • Interview: Sequential and Pipelines
      • Interview: FSM and Control
      • Interview: Timing and STA
      • Interview: CDC and Reset
      • Interview: Memories and Buses
      • Interview: Low-Power Design
      • Interview: Debug and ECO
      • Interview: Coding and Whiteboard
  • Glossary and Notation
Loading lesson

‹Interview: Combinational and Arithmetic
  1. Topics
  2. RTL Design
  3. Senior & Interview
  4. Senior RTL Interview Questions & Model Answers
  5. Interview: Combinational and Arithmetic
  6. Glitches on enables and combinational hazards

Part 9 · Senior · Senior

Glitches on enables and combinational hazards

Synchronous enable timing, deliberate control delay, and safe library clock gating.

On this page

    Why this matters

    The same one-nanosecond glitch is harmless on a clock-enable sampled at the edge and fatal on a clock line, where it becomes an extra edge. Reviewers ban the shape because the failure is intermittent and corner dependent.

    After this lesson you can: explain where a mid-cycle glitch is harmless and where it is not, align an enable with its data, and say when a library ICG is required.

    The question

    The interviewer describes a combinational enable that glitches for a nanosecond mid-cycle, then asks whether the design fails and what changes if the glitch lands on a clock line.

    The question tests hazard placement. The same glitch is harmless in one place and fatal in another.

    Model answer

    On a synchronous clock-enable sampled at the edge, a mid-cycle glitch that settles before setup changes nothing. On a clock line or a latch enable, the same glitch is an extra edge or a transparent window.

    A direct synchronous CE is valid when enable and data meet setup/hold at the receiving register. If control is deliberately pipelined, pipeline its data too or require the producer to hold the associated data through the later accepting edge. Clock gating instead uses a library ICG: its low-phase latch or specified capture element holds the gating decision during the active clock phase. An extra rising-edge enable register is not universally required.

    Glitch lands on

    Effect

    Synchronous enable, settled before setup

    No effect; sampled once at the edge

    Gated clock (clk & en)

    Extra edge; state corrupts

    Latch enable

    Transparent window; data slips through

    Each slot is a quarter of a clock period, so a rising clock edge falls between slots 1 and 2 and again between slots 5 and 6.

    • Slot 1: d changes to c3 with en_comb low. Nothing should load it.

    • Slot 2: en_comb glitches high while clk is high. The rising edge just before it saw en_comb = 0, so q_ce keeps a1.

    • Slot 2, gated clock: gclk = clk & en_comb rises with the glitch. That is an extra edge, and q_g wrongly loads c3.

    • Slot 6: a real enabled edge; both flops load d5, so only the glitch separates them.

    Interview

    “Time CE and data together; align any intentional delay. Use a characterized ICG with gating checks and test override for clock gating.”

    Follow-ups

    • How is it proven? A testbench drives a mid-cycle pulse that returns low before the edge, then checks that nothing loaded. The solution below does exactly that.

    • Is a gated clock ever acceptable? Use a library ICG with its specified capture mechanism, test override and gating checks. The always-on controller must still be able to reopen a stopped domain; follow the clock-gating contract.

    • What about the enable timing? A registered enable still needs setup at its sampling flop. Registration moves the constraint to a clean single-cycle path.

    Common wrong answers

    “Glitches do not matter in synchronous design” is half true. It holds for sampled enables and fails for clocks and latches.

    “Add delay to filter the glitch” is fragile across PVT. For CE, close the sampling window; for a clock, use the approved ICG. Adding control latency without aligning data changes behavior.

    gated_clk_bad.sv
    1
    2
    3
    4
    5
    6
    7
    // bad-example
    module gated_clk_bad (
      input  logic clk, en,
      output logic gated_clk
    );
      assign gated_clk = clk & en;
    endmodule

    Common pitfall

    Any hazard on en becomes a runt edge on gated_clk. The failure is intermittent and corner-dependent, which is why reviews ban the shape outright.

    Check yourself A 1 ns enable pulse rises and falls between two clock edges. The enable feeds a synchronous clock-enable pin. Does the flop load?

    No. The flop samples the enable only at the edge, where it reads 0. The testbench below checks this case explicitly.

    Solution and testbench

    The direct CE below captures A1 on an enabled edge, holds A1 when the next edge offers C3 disabled, ignores a settled mid-cycle pulse, then captures D5. Changing the data every cycle exposes the old en_q/current-data misalignment.

    ce_reg.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    module ce_reg #(parameter int W = 8) (
      input  logic         clk,
      input  logic         en_comb,
      input  logic [W-1:0] d,
      output logic [W-1:0] q
    );
      always_ff @(posedge clk) begin
        if (en_comb) q <= d;
      end
    endmodule
    

    Remember

    • A synchronous enable only matters at the edge: a glitch that settles before setup changes nothing.

    • On a clock line or latch enable the same glitch is a runt edge or a transparent window.

    • If control is delayed, delay the data too, or hold the data through the later accepting edge.

    Rule of thumb: time the enable and its data together, and gate clocks only with a characterised ICG.

    How this was checked

    The digital enable check, run with Icarus Verilog 13.0 (2026-10-16): prints PASS. It does not measure setup/hold or ICG timing.

    Keep going

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

    • Interview: run a mock interview on this topic

    Previous

    316 / 350

    Next: Interview: Sequential and Pipelines

    Up next

    Up nextInterview: Sequential and Pipelines

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • The latch inference trap
    • Signed arithmetic and width truncation
    clken_combda1c3d5q_cea1d5gclkq_ga1c3d5
    One enable with a glitch while clk is high: the clock-enable flop ignores it, the AND-gated clock turns it into an extra edge