Edge Detection: Difference between revisions
N00basaurus (talk | contribs) Added Edge Detection page |
(No difference)
|
Revision as of 05:59, 6 October 2025
Edge detection is the action of sending a signal at the edge of a signals transition.
Rising edge refers to the instance in time when a signal rises from off to on.
Falling edge refers to the instance in time when a signal falls from on to off.
Circuit Implementation
You can detect a rising edge by looking for an instance in time when the input signal was off some number of ticks ago, but is now on.
You can do this with an AND Gate and an Inverter.
Connecting one input of the AND gate to your input signal, and another input to your input signal through an inverter.
When you turn the input signal on, the AND gates input will turn on instantly. Since the inverter has a 1 tick delay before its output is updated, its output is still on, and so is the other input of the AND gate, marking the AND gate to be updated in the next tick.
On the next tick, the AND gate turns on, and the inverter turns off. The AND gates inputs are no longer all on, and the AND gate is marked to be turned off in the next tick.
The length of this pulse is determined by the delay between the input signal and the inverted input of the AND gate. You can make the pulse length 2 ticks long by introducing a Buffer, or you can make it 2 ticks or more using a Delayer.