Falling Edge Detector
Falling edge detector that generates single-cycle pulses when input signals transition from high to low. Creates configurable-width pulses for each detected falling edge on multi-bit input vectors. Supports independent edge detection on each bit with programmable pulse width. Essential for event detection, trigger generation, and signal deactivation monitoring.
Introduction
This block implements a falling edge detector that generates output pulses whenever an input signal transitions from ‘1’ to ‘0’ (high-to-low).
The edge detector operates as follows:
- Monitors input signal(s) for 1→0 transitions
- Generates a pulse on OUT for each detected falling edge
- Pulse width is configurable (default: 1 clock cycle)
- Each bit in multi-bit inputs has an independent edge detector
Key characteristics:
- Edge-triggered: Responds only to 1→0 transitions
- Multi-bit: Processes up to 128 independent signals
- Pulse generation: Creates clean, synchronous pulses
- Configurable width: Pulse duration from 1 to N clock cycles
- Latency: 2 clock cycles
Pin Description
Clock Enable input (active high).
- CE = ‘1’: Edge detection enabled
- CE = ‘0’: Edge detection disabled (input changes ignored) Default: ‘1’ if left unconnected.
Pulse width in clock cycles (integer). Determines how many cycles the output pulse remains high after edge detection.
- PULSE_WIDTH = 1: Single-cycle pulse
- PULSE_WIDTH = N: N-cycle pulse Default: 1 if left unconnected.
Properties
Set the number of bits of the input signal. For each bit will be created an indipendent edge detector
Number of independent edge detectors (width of IN and OUT). Range: 1-128 bits. Each bit has its own edge detector operating in parallel.Default: 1
Range: 1 – 128
Functional description
A falling edge detector identifies high-to-low transitions on input signals and generates synchronized output pulses. Each bit of the input has its own independent edge detection circuit.
Operation principle
For each input bit $i$:
$$ \mathrm{Edge}[i] = \overline{\mathrm{IN}i} \land \mathrm{IN}i $$
Where:
- $\mathrm{IN}i$ = current value of bit $i$
- $\mathrm{IN}i$ = previous value of bit $i$ (1 clock ago)
- $\land$ = logical AND
- $\overline{x}$ = logical NOT
A falling edge is detected when:
- Previous cycle: IN[i] = ‘1’
- Current cycle: IN[i] = ‘0’
Pulse generation
When a falling edge is detected:
- Output bit goes HIGH for PULSE_WIDTH clock cycles
- After PULSE_WIDTH cycles, output returns to LOW
- New edges can be detected after the pulse completes
Multi-bit operation
The component processes each input bit independently:
- Input Size = 8 → 8 independent edge detectors
- Each detector operates on its corresponding bit
- Edges on different bits are detected simultaneously
- OUT[i] reflects edge detection for IN[i]
Pulse width control
The PULSE_WIDTH input (integer) determines pulse duration:
- PULSE_WIDTH = 1: Single-cycle pulse (default)
- PULSE_WIDTH = N: N-cycle pulse
- Useful for generating enable signals of specific durations
Clock enable
The CE input enables/disables edge detection:
- CE = ‘1’: Edge detection active
- CE = ‘0’: Edges are not detected (input changes ignored)
Timing
| Property | Latency (clock cycles) |
|---|---|
| Falling Edge Detector | 2 |
The output pulse appears 2 clock cycles after the falling edge occurs on the input.
Timing diagram
Cycle: 0 1 2 3 4 5 6
CLK: ↑ ↑ ↑ ↑ ↑ ↑ ↑
IN: 1 0 0 1 0 0 0
OUT: 0 0 1 0 0 1 0
(edge) (pulse) (edge) (pulse)
Note: 2-cycle latency from edge to pulse.
Rising vs Falling Edge Detectors
Falling Edge Detector (this component):
- Detects 1→0 transitions
- Use for deactivation events
- Monitor signal release
Rising Edge Detector:
- Detects 0→1 transitions
- Use for activation events
- Monitor signal assertion
Both Edge Detector:
- Detects both 0→1 and 1→0
- Use for toggle detection
- Monitor any signal change
Typical use cases
- Release detection: Detect button releases or signal deactivation
- Done signals: Detect completion of operations (busy falling edge)
- Acknowledge monitoring: Detect handshake signal negation
- Timeout events: Detect when timers expire (timer signal falls)
- Interrupt clearing: Generate pulses when interrupt clears
- State machine transitions: Detect exit from active states
- Protocol monitoring: Detect end-of-transmission markers
- Error recovery: Detect when error conditions clear
Design best practices
- Signal polarity: Ensure input has correct polarity (active high)
- Stability: Input should be stable and glitch-free
- Metastability: For async inputs, synchronize before edge detection
- Pulse width: Match PULSE_WIDTH to downstream requirements
- Combined detection: Use both rising and falling detectors for full monitoring
Waveform example
Example with Input Size = 2, PULSE_WIDTH = 1 (single-cycle pulses):
Note: Each falling edge generates a 1-cycle pulse after 2-cycle latency.