Lesson 24 Flashcards — Finite State Machines I#
Click a question to reveal the answer.
1. What distinguishes sequential from combinational logic?
Combinational output depends only on current inputs. Sequential output depends on inputs and on history, so it requires memory.
2. Give an everyday example of sequential behavior.
A garage door button: pressing it opens or closes the door depending on where the door already is. The same input produces different outputs.
3. What are the five elements of a finite state machine?
States (the situations the system can be in), inputs, transitions (rules taking state + input to a next state), outputs, and the initial state — where the machine starts, usually forced by a reset.
4. In what sense is the state the memory?
The state captures everything the machine needs to know about the past. Given the current state and the current input, nothing else about the history matters.
5. What is the difference between a Moore and a Mealy machine?
Moore output depends only on the state, and is written inside the state bubble. Mealy output depends on state and current input, and is written on the transition arrow.
6. Project 2 has one output of each kind. Which is which?
The telemetry voltage on DAC1 is Moore — 0.8 / 1.6 / 2.4 V, one per state, and nothing else changes it. FIRE is Mealy — it needs all four of these on the same tick: the machine in LOCK, the operator's pickle \(P\), the target inside the envelope \(E\), and the master arm plug \(M\). So it belongs on the arrow, not in the bubble.
7. Which type generally needs fewer states?
Mealy, because the output can vary with the input without requiring a separate state. Moore is simpler to reason about and verify.
8. What must be true of every state in a transition diagram?
It must have a defined transition for every possible input. An undefined transition is a bug.
9. How many rows does a transition table have?
One per (state, input) pair. Three states with a two-valued input gives 6 rows; four states with a two-valued input gives 8. Count them before you start. (That count is over the machine's states. Once the states are encoded in bits — Lesson 25 — you count over all \(2^{\text{state bits} + \text{input bits}}\) codes instead, including the unused ones: the three-state machine then has 8 rows, not 6.)
10. Give three engineering examples of FSMs.
Traffic lights, vending machines, elevator controllers, communication protocols, and weapon system modes (safe/searching/locked/engaged) — where the transitions are safety-critical.