Finite state machines: flip-flop
Flip-flop can be modeled as a finite-state machine
D flip-flop q D q+ z
State: 1 bit (q) 0 0 0 0
Input: 1 bit (D) 0 1 1 0
Output: current state (z) 1 0 0 1
1 1 1 1
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)