Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Convert a synchronous level into a one-cycle rising pulse

Hardware interview practice

Convert a synchronous level into a one-cycle rising pulse

EasyRTL DesignSystemVerilog

The input level is already synchronous to clk and may remain high for any number of cycles. Implement the rising-edge pulse detector.

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

module rise_pulse(
  input logic clk,rst_n,level,
  output logic pulse
);
Reviewed example

Work through one case

Input
Case 1: Sample levels 0,1,1,1
Case 2: After an initial synchronized low, sample levels 1,0,1
Case 3: Reset, then sample level=0
Expected output
Case 1: pulse is 0,1,0,0
Case 2: pulse is 1,0,1
Case 3: pulse and the delayed level remain 0

The shown result follows by applying this rule: Register the previous level and compute pulse from current level AND NOT previous level on each edge. The cases also demonstrate this requirement: A falling edge produces no pulse; a later low-to-high transition may produce a new pulse.

What to cover

Requirements

  1. An active-low synchronous reset clears the delayed level and pulse.
  2. Pulse for exactly one cycle when level is one and its previous sampled value was zero.
  3. A level held high for multiple cycles produces no pulse after the first high cycle.
  4. A falling edge produces no pulse; a later low-to-high transition may produce a new pulse.
asic.fyi · Learn silicon end to end.info@asic.fyi