Home › Practice › RTL Design › Make a tap visible
Make a tap visible
EasyRTLsequential
A button tap lasts one clock cycle. That is far too short to see on an LED, so the LED must stay on for 3 cycles after a tap.
Concept first. The circuit needs to remember how long ago something happened. A flip-flop remembers one cycle. Two common ways to remember longer: a small down-counter that you load with the wanted time and count down to zero, or a short shift register that carries the tap along one cycle at a time. With both, the LED is on while the memory is not empty. Think about what a second tap should do while the first is still being counted.
What to build.
- Inputs
clk,rst,tap. Outputled. rstis synchronous and switches the LED off.ledis 1 in the 3 cycles after any cycle in whichtapwas 1. Iftapwas 1 in cycle 0,ledis 1 in cycles 1, 2 and 3.- A new tap while the LED is lit restarts the 3 cycles.
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.