Jump to content

Edge Detection: Difference between revisions

From Logic World Wiki
DjSapsan (talk | contribs)
improved formatting and did todo
mNo edit summary
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''Edge detection''' is the process of sending a signal at the moment a signal transitions.
Edge detection is the process of detecting when a signal changes state. There are three types of edge detection:


A '''rising edge''' refers to the instant when a signal changes from ''off'' to ''on''.
'''Rising Edge''': when a signal goes from OFF to ON.


A '''falling edge''' refers to the instant when a signal changes from ''on'' to ''off''.
'''Falling Edge''': when a signal goes from ON to OFF.


== Circuit Implementation ==
'''Either Edge''': when a signal goes from either OFF or ON.
 
== Construction ==
[[File:Raising-edge-detector.png|thumb|right|alt=Raising edge detector|Raising edge detector]]
[[File:Raising-edge-detector.png|thumb|right|alt=Raising edge detector|Raising edge detector]]
You can detect a rising edge by checking whether the input signal was ''off'' some number of [[Tick|ticks]] ago but is now ''on''.
[[File:edge-oscillator.png|alt=oscilloscope|Raising Edge on oscilloscope |thumb]]You can detect a rising edge by checking whether the input signal was ''off'' some number of [[Tick|ticks]] ago but is now ''on''.


This can be done using 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.
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.   
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.   
Line 17: Line 18:
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'' 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.   
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]].
You can extend the pulse to 2 ticks using a [[Buffer]], or make it 2 ticks or longer with a [[Delayer]].


== Example Signal Diagram ==
== Example Signal Diagram ==
Below is an example timing diagram showing how a rising edge detector behaves:
Below is an example timing diagram showing how a rising edge detector behaves:{{Binary signal
* '''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
| signals=Input, Output
| signal1=000011110000111
| signal1=000011110000111
| signal2=000010000000100
| signal2=000010000000100
}}
}}{{Note|NOTE: This diagram is simplified for educational purposes. While this diagram suggests that the output turns on immediately when the input turns on, in reality, logic gates create a delay, and the output signal will lag behind the input signal by at least one tick.}}
 
How it looks in the Logic World:
[[File:edge-oscillator.png|frame|center|alt=oscilloscope|Raising Edge on oscilloscope ]]

Latest revision as of 22:09, 14 March 2026

Edge detection is the process of detecting when a signal changes state. There are three types of edge detection:

Rising Edge: when a signal goes from OFF to ON.

Falling Edge: when a signal goes from ON to OFF.

Either Edge: when a signal goes from either OFF or ON.

Construction

Raising edge detector
Raising edge detector
oscilloscope
Raising Edge on oscilloscope

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:

0123456789101112131415
Input
Output
NOTE: This diagram is simplified for educational purposes. While this diagram suggests that the output turns on immediately when the input turns on, in reality, logic gates create a delay, and the output signal will lag behind the input signal by at least one tick.