One-Shot in HDL — Make the Circuit Fire Once per Rising Edge In a hardware description language (HDL), which technique ensures a circuit responds once to each positive transition (rising edge) on a trigger input, implementing a one-shot behavior?

Difficulty: Easy

Correct Answer: By using edge trapping

Explanation:


Introduction / Context:
A one-shot (monostable) responds once per trigger edge, generating a single pulse of defined width. In HDL, this behavior is implemented by detecting transitions and gating logic so that internal processes trigger only on the specified edge, regardless of input level duration.



Given Data / Assumptions:

  • Trigger input may remain HIGH after an edge.
  • We require exactly one response per positive edge.
  • Pulse width may be fixed (one clock) or extended via counters after detection.


Concept / Approach:
Edge trapping (edge detection) captures the moment when a signal changes from 0 to 1 by comparing the current sample with a one-cycle delayed sample. The expression rising_edge = (curr = 1) and (prev = 0) produces a single-cycle strobe that can start a monostable or increment a counter once per event.



Step-by-Step Solution:
Register the trigger: prev <= trigger at each clock.Form the edge detect: pulse <= trigger and (not prev).Use pulse as an enable/start for the one-shot timing (e.g., load a down-counter or set a state).Ensure re-arm logic so the next rising edge is seen only after pulse completes.


Verification / Alternative check:
Simulate with long HIGH levels and bouncy edges; the edge-detect strobe fires exactly once per 0→1 transition, regardless of how long the trigger stays HIGH, proving one-shot behavior.


Why Other Options Are Wrong:

  • By using a counter: A counter can shape pulse width, but without edge detection it may retrigger or miss edges.
  • By using an active clock: Clocks are required but do not by themselves create one-shot behavior.
  • By using an immediate reload: Reload is a mechanism after detection; not the detection method.


Common Pitfalls:
Neglecting to register the previous state (causing level-sensitive behavior) and forgetting to synchronize asynchronous triggers to avoid metastability.


Final Answer:
By using edge trapping

More Questions from Counters

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion