Finite State Machines: Counter
Finite State Machines: Counter
Usage
Keeping track of number of bits sent
Program counter (PC)
Increments each clock cycle to point to next instruction
Finite state machines: counter
q1 q0 x
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
q1 q0 x q 1+ q 0+
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 1 0
1 0 1 1 1
1 1 0 1 1
1 1 1 0 0
q1 q0 x q 1+ q 0+ z1 z0
0 0 0 0 0 0 0
0 0 1 0 1 0 0
0 1 0 0 1 0 1
0 1 1 1 0 0 1
1 0 0 1 0 1 0
1 0 1 1 1 1 0
1 1 0 1 1 1 1
1 1 1 0 0 1 1
q1 q0 x q 1+ q 0+ z1 z0 D1 D0
0 0 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 1
0 1 0 0 1 0 1 0 1
0 1 1 1 0 0 1 1 0
1 0 0 1 0 1 0 1 0
1 0 1 1 1 1 0 1 1
1 1 0 1 1 1 1 1 1
1 1 1 0 0 1 1 0 0
Note that it is not necessary to use all possible states for the counter
3-state counter: reset to 00 after 10
Changes:
Replace entries for state 11 in state transition table with "d"
Next state after state 10 is 00 with input 1
Finite state machines: 3-state counter