Guest
#4917893
I am programming an FPGA that uses push buttons as input signals. I am programming a finite state machine with 11 states that transition from state to state using specific button presses. For example, in my design, state 0 goes to state 1 using button1. This is the same transition case from state 1 to 2 and from state 2 to 3. This state transition system is implemented in my vhdl code using case statements much like the "switch" statement in c++. I am lighting up certain LEDs in each state to keep track of which state the board is currently in. My issue is that when I press button1 while in sate 0, the board shows that it has moved to state 3. What i think is happening is that it is indeed going to state 1 and 2 but the same button press in state 0 is also being read in state 1 and 2. This happens so fast that the boards doesnt have enough time to show the LED indications for state 1 and 2. It stops at state 3 because state 3 moves to state 4 using a different button. So my question is, how do I make the button press signal have a rising edge and a falling edge such that a single button press is read only in one state and not the ones that follow it? The press button signals are debounced but this only makes the signal a uniform wave. Any help is appreciated, thanks. I attached my vhdl code. The "btnC, btnL, btnR,..." are the push buttons.