Forum Discussion
Altera_Forum
Honored Contributor
14 years ago --- Quote Start --- --can i do like this? --- Quote End --- No, probably not. You need to use a proper clock and separate the logic into functional blocks; 1) Push button interface, with debounce logic * synchronize the push-button to the clock * detect an edge, and then ignore the input for a while 2) A counter 3) Synchronized push-button and match control logic Create a testbench for your logic, eg., something that contains a clock and a noisy push-button press, and use that to confirm that you only see one button press. If you don't know how 'noisy' to make your button press, create a simple design and download it into your hardware. Add a SignalTap II instance and capture a trace from a push-button press. You will see that the signal generates multiple transitions when you click on the button. Your debounce logic needs to convert the ugly push-button signal into a nice clean logic level. Cheers, Dave