| Finite state machines: implementing | ||||||||||||||
| Step 4: Implement a circuit to generate the control signals | ||||||||||||||
| One way to do this: use a ROM (read-only memory) | ||||||||||||||
| Input to ROM: k-bit address | ||||||||||||||
| Output from ROM: contents of location at given address | ||||||||||||||
| Number of bits needed for address: inputs to truth table | ||||||||||||||
| 2 bits for state + 1 bit for input in this case | ||||||||||||||
| Number of bits at each location: number of output bits + number of flip-flops | ||||||||||||||
| 4 bits in this case | ||||||||||||||
| q1 | q0 | x | q1+ | q0+ | z1 | z0 | D1 | T0 | ||||||
| 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | ||||||
| 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | ||||||
| 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | ||||||
| 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | ||||||
| 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | ||||||
| 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | ||||||
| 1 | 1 | 0 | d | d | d | d | d | d | ||||||
| 1 | 1 | 1 | d | d | d | d | d | d | ||||||