When buttons or switches are pressed by humans for arbitrary periods of time, we need to convert a signal level to a pulse. In the following FSM, whenever the input L goes from low to high, the level-to-pulse converter produces a single pulse P, which is one clock period wide. Thus, it is a synchronous rising-edge detector. Write a Verilog HDL for the following FSM.
L = 1
L = 1
L = 0
00 Low input
11
L = 1
01
High input, Edge Detected! Waiting for fall
P = 1
P = 0
L = 0
Level to pulse converter
Waiting for rise
P = 0
CLK