Output a single-cycle pulse each time din rises. pulse must be
high in exactly the first cycle where din is sampled 1 after being
sampled 0, and low otherwise. Synchronous reset clears the internal state.
| Port | Dir | Width | Meaning |
|---|---|---|---|
| clk, rst | in | 1 | clock, sync reset |
| din | in | 1 | input signal (already synchronous) |
| pulse | out | 1 | 1-cycle pulse per rising edge of din |
Hint: remember last cycle's din in a register.
Refresher: latches & flip-flops.