|
Implementation of button control using the asynchronous finite state machine.
When the button is pressed, the LED lights up. In order for it to go out, you need to press the button again.
State Transition Table
B state (Q0)(Q1)
00 01 11 10
0 00 11 11 00
1 01 01 10 10
K-map for R0
00 01 11 10 R0 = !B & !Q1 = !(B | Q1)
0 X 1
1 X X
K-map for S0
00 01 11 10 S0 = !B & Q1 = !(B | !Q1)
0 1 X
1 X X
K-map for R1
00 01 11 10 R1 = B & Q0
0 X X
1 1 X
K-map for S1
00 01 11 10 S1 = B & !Q0
0 X X
1 1 X
As homework, you can think about how to complete the circuit so that the LED lights up only after the button is released.
Actual implementation should take into account the following points.
After the power appears, the state machine must go to the initial state (00).
And real buttons have the so-called effect, bouncing contacts. Therefore, it is necessary to suppress them, for example, through RC-filter, a Schmitt trigger, etc.
|