Rising Edge Detector
Rising edge detector that generates single-cycle pulses when input signals transition from low to high. Creates configurable-width pulses for each detected rising edge on multi-bit input vectors. Supports independent edge detection on each bit with programmable pulse width. Essential for event detection, trigger generation, and asynchronous signal synchronization.
Introduction
This block implements a rising edge detector that generates output pulses whenever an input signal transitions from ‘0’ to ‘1’ (low-to-high).
The edge detector operates as follows:
- Monitors input signal(s) for 0→1 transitions
- Generates a pulse on OUT for each detected rising 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 0→1 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 rising edge detector identifies low-to-high 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] = \mathrm{IN}i \land \overline{\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 rising edge is detected when:
- Previous cycle: IN[i] = ‘0’
- Current cycle: IN[i] = ‘1’
Pulse generation
When a rising 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) |
|---|---|
| Rising Edge Detector | 2 |
The output pulse appears 2 clock cycles after the rising edge occurs on the input.
Timing diagram
Cycle: 0 1 2 3 4 5 6
CLK: ↑ ↑ ↑ ↑ ↑ ↑ ↑
IN: 0 1 1 0 1 1 1
OUT: 0 0 1 0 0 1 0
(edge) (pulse) (edge) (pulse)
Note: 2-cycle latency from edge to pulse.
Typical use cases
- Asynchronous input synchronization: Convert async signals to sync pulses
- Button debouncing: Detect button presses (combine with debouncer)
- Event counting: Count rising edge events
- Trigger generation: Create enable pulses from control signals
- Interrupt detection: Generate interrupts on signal transitions
- Protocol handshaking: Detect ready/acknowledge edges
- Clock domain crossing: Synchronize signals between domains
- Strobe generation: Create single-cycle strobes from level signals
Design best practices
- Metastability: For async inputs, use a synchronizer chain before edge detector
- Glitch filtering: Ensure input signal is stable (debounce if necessary)
- Pulse width: Choose PULSE_WIDTH appropriate for downstream logic
- Latency: Account for 2-cycle detection delay in timing analysis
- Reset: Initialize properly to avoid false edges on power-up
Waveform example
Example with Input Size = 2, PULSE_WIDTH = 1 (single-cycle pulses):
Note: Each rising edge generates a 1-cycle pulse after 2-cycle latency.
Example with PULSE_WIDTH = 3 (three-cycle pulses):
Pulse extends for 3 clock cycles.