Description:
- Output is shown within the state itself
As a circuit:
- As output doesnt depend on input but the state the input arrive, output combinational logic doesnt need to include input, only the state
- Using logic gates
As a table:
| Next - | - state | |
---|
Current state (S) | In = 0 | In = 1 | Out |
Init | Init | Got1 | 0 |
Got1 | Init | Got11 | 0 |
Got11 | Init | Got111 | 0 |
Got111 | Init | Got111 | 1 |
- Convert the state names from table above into binary
- Where Q1 and Q0 are binary for the states
- Let D1 and D0 be the Flip-flop for the state
| Q1Q0 | Q1Q0 | |
---|
Q1Q0 | In = 0 | In = 1 | Out |
00 | 00 | 01 | 0 |
01 | 00 | 10 | 0 |
10 | 00 | 11 | 0 |
11 | 00 | 11 | 1 |
- We can use the the state bits to encode state, let left bit of each state be D0 and the next left be D1
- Then we have the truth table for each state bit
- ex: for D0, we take the red bits
- D0=In.Q1 + In.Q0’ using Karnaughmap
In\Q1Q0 | 00 | 01 | 11 | 10 |
---|
0 | 0 | 0 | 0 | 0 |
1 | 1 | 0 | 1 | 1 |
- For D1, we take the green bits
- D1=In.Q1 + In.Q0 using Karnaughmap
In\Q1Q0 | 00 | 01 | 11 | 10 |
---|
0 | 0 | 0 | 0 | 0 |
1 | 0 | 1 | 1 | 1 |
- Out = Q1.Q0 as output only depends on state
One-hot encoding:
- Each state is represented by 1 flip flop
- The reset input (switch) will turn the states to 0001, meaning D0=1 because it has preset