| Finite state machines: flip-flop | |||||||||||||||||||
| Flip-flop can be modeled as a finite-state machine | |||||||||||||||||||
|
|||||||||||||||||||
| D flip-flop | q | D | q+ | z | T | ||||||||||||||
| State: 1 bit (q) | 0 | 0 | 0 | 0 | 0 | ||||||||||||||
| Input: 1 bit (D) | 0 | 1 | 1 | 0 | 1 | ||||||||||||||
| Output: current state (z) | 1 | 0 | 0 | 1 | 1 | ||||||||||||||
| 1 | 1 | 1 | 1 | 0 | |||||||||||||||
| In state 0: | In state 1: | ||||||||||||||||||
| input 0 gives new state 0 (reset) | input 0 gives new state 0 (reset) | ||||||||||||||||||
| input 1 gives new state 1 (set) | input 1 gives new state 1 (set) | ||||||||||||||||||
| Could implement this in the obvious way with a D flip-flop, or use a T flip-flop! | |||||||||||||||||||