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:
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:
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
Discussion & Comments