Jump to content

Edge Detection: Difference between revisions

From Logic World Wiki
Added Edge Detection page
 
DjSapsan (talk | contribs)
improved formatting and did todo
Line 1: Line 1:
Edge detection is the action of sending a signal at the edge of a signals transition.
'''Edge detection''' is the process of sending a signal at the moment a signal transitions.


Rising edge refers to the instance in time when a signal ''rises'' from off to on.
A '''rising edge''' refers to the instant when a signal changes from ''off'' to ''on''.


Falling edge refers to the instance in time when a signal ''falls'' from on to off.
A '''falling edge''' refers to the instant when a signal changes from ''on'' to ''off''.


== Circuit Implementation ==
== Circuit Implementation ==
{{Todo|Add pictures}}
[[File:Raising-edge-detector.png|thumb|right|alt=Raising edge detector|Raising edge detector]]
You can detect a rising edge by looking for an instance in time when the input signal was off some number of [[Tick|ticks]] ago, but is now on.
You can detect a rising edge by checking whether the input signal was ''off'' some number of [[Tick|ticks]] ago but is now ''on''.


You can do this with an [[AND Gate]] and an [[Inverter]].  
This can be done using an [[AND Gate]] and an [[Inverter]]
Connect one input of the AND gate directly to your signal, and connect the other input through the inverter.


Connecting one input of the AND gate to your input signal, and another input to your input signal through an inverter.
When the input signal turns on, the direct input to the AND gate is immediately on. The inverter output, however, is delayed by 1 tick, so it remains ''on'' for one more tick. 
Since both inputs of the AND gate are ''on'', it becomes marked for activation in the next tick.


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'' while the inverter output turns ''off''. At this point, not all AND gate inputs are ''on'', so it will be marked to turn ''off'' on the following 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 pulse length is determined by the delay between the direct and inverted inputs of the AND gate
You can extend the pulse to 2 ticks using a [[Buffer]], or make it 2 ticks or longer with a [[Delayer]].


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]].
== Example Signal Diagram ==
{{Todo|Add timing diagram}}
Below is an example timing diagram showing how a rising edge detector behaves:
* '''Input''' shows the original signal toggling between off and on.
* '''Output''' is the short pulse generated on each rising edge of the input signal.
 
{{Binary signal
| signals=Input, Output
| signal1=000011110000111
| signal2=000010000000100
}}
 
How it looks in the Logic World:
[[File:edge-oscillator.png|frame|center|alt=oscilloscope|Raising Edge on oscilloscope ]]

Revision as of 18:02, 7 October 2025

Edge detection is the process of sending a signal at the moment a signal transitions.

A rising edge refers to the instant when a signal changes from off to on.

A falling edge refers to the instant when a signal changes from on to off.

Circuit Implementation

Raising edge detector
Raising edge detector

You can detect a rising edge by checking whether the input signal was off some number of ticks ago but is now on.

This can be done using an AND Gate and an Inverter. Connect one input of the AND gate directly to your signal, and connect the other input through the inverter.

When the input signal turns on, the direct input to the AND gate is immediately on. The inverter output, however, is delayed by 1 tick, so it remains on for one more tick. Since both inputs of the AND gate are on, it becomes marked for activation in the next tick.

On the next tick, the AND gate turns on while the inverter output turns off. At this point, not all AND gate inputs are on, so it will be marked to turn off on the following tick.

The pulse length is determined by the delay between the direct and inverted inputs of the AND gate. You can extend the pulse to 2 ticks using a Buffer, or make it 2 ticks or longer with a Delayer.

Example Signal Diagram

Below is an example timing diagram showing how a rising edge detector behaves:

  • Input shows the original signal toggling between off and on.
  • Output is the short pulse generated on each rising edge of the input signal.
0123456789101112131415
Input
Output


How it looks in the Logic World:

oscilloscope
Raising Edge on oscilloscope