Edge detection

Falling edge

Rising edge