Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Glitch-free gated test clock

Hardware interview practice

Glitch-free gated test clock

EasyRTL DesignSystemVerilog

Enable changes must not shorten a gated-clock high pulse. Asserting reset is the sole exception and may force the gated clock low immediately. Write synthesizable SystemVerilog for the simple gate model.

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Starting point

Question code

input logic clk, rst_n, enable;
output logic gclk;
Reviewed example

Work through one case

Input
Stored enable is 0; external enable rises while clk is high, then clk reaches its falling edge.
Expected output
gclk stays low during the current high phase; the next rising edge starts the first full gated-clock pulse.

The gate samples enable only on the falling edge, isolating high-phase changes so they cannot shorten or create a partial pulse.

What to cover

Requirements

  1. Capture enable only on the falling edge of clk while rst_n is 1, then form gclk from clk AND the captured enable.
  2. Asynchronously clear the captured enable when rst_n is 0 so gclk is forced low; reset assertion is the only allowed cause of a shortened high pulse.
  3. A change in enable while clk is high must not change gclk until after the next falling edge.
  4. Use synthesizable logic without delays; state that a production ASIC would normally use a characterized integrated clock-gating cell.
Continue practicing

Related questions

RTL DesignEnabled modulo-five counter→RTL DesignAccumulate a four-lane signed dot product→RTL DesignEncode the highest active request and its one-hot form→
asic.fyi · Learn silicon end to end.info@asic.fyi