Quiz: FSM Design and Applications
Test your understanding of FSM design methodology, sequence detectors, and practical controller examples.
1. What is a next-state equation in FSM design?
- An equation that calculates the output value
- A Boolean expression that computes the next state based on current state and inputs
- A formula for determining the number of flip-flops needed
- An equation for minimizing the number of states
Show Answer
The correct answer is B. The next-state equation is a Boolean expression that computes what state the FSM will enter on the next clock edge, based on the current state and inputs. These equations become the D inputs to the state register flip-flops.
Concept Tested: Next State Equation
2. How do Moore and Mealy machines differ in their output equations?
- Moore outputs are faster than Mealy outputs
- Moore outputs depend only on state; Mealy outputs depend on state AND inputs
- Moore machines have no outputs
- Mealy outputs are always registered
Show Answer
The correct answer is B. In a Moore machine, outputs depend ONLY on the current state (Output = g(S)). In a Mealy machine, outputs depend on both current state AND current inputs (Output = h(S, I)), which allows faster response but can introduce glitches.
Concept Tested: Output Equation
3. What is the first step in the systematic FSM design process?
- Draw the state diagram
- Choose state encoding
- Understand the specification and identify inputs/outputs
- Derive next-state equations
Show Answer
The correct answer is C. The FSM design process begins with understanding the specification—identifying inputs, outputs, required behavior, and whether Moore or Mealy is appropriate. This understanding guides all subsequent steps.
Concept Tested: FSM Design Process
4. Why is FSM verification important?
- To make the FSM run faster
- To confirm the implementation correctly matches the specification
- To reduce the number of states
- To eliminate the need for simulation
Show Answer
The correct answer is B. FSM verification confirms that the implementation correctly matches its specification. This includes testing every transition, checking reset behavior, and verifying outputs—catching errors before they become bugs in hardware.
Concept Tested: FSM Verification
5. What does a sequence detector FSM do?
- Counts the total number of 1s in an input stream
- Monitors an input stream and outputs a signal when a specific pattern is detected
- Generates random bit sequences
- Sorts input values in order
Show Answer
The correct answer is B. A sequence detector monitors an input bit stream and asserts an output signal when a specific target pattern (like "101") is detected. States represent partial progress toward matching the complete pattern.
Concept Tested: Sequence Detector
6. What is the difference between overlapping and non-overlapping pattern detection?
- Overlapping uses more flip-flops
- In overlapping detection, the suffix of one pattern can be the prefix of the next
- Non-overlapping detection is always faster
- Overlapping detection only works with Mealy machines
Show Answer
The correct answer is B. In overlapping detection, after finding a pattern, part of it can count toward the next match. For pattern "101" in stream "10101", overlapping finds TWO matches (positions 0-2 and 2-4) because the final "1" of the first match starts the next pattern.
Concept Tested: Overlapping Detection
7. In a traffic light controller FSM, what is the critical safety property?
- Lights change as fast as possible
- Both directions are never green simultaneously
- Yellow lights last exactly 3 seconds
- The controller uses minimal flip-flops
Show Answer
The correct answer is B. The critical safety property is that conflicting green lights never occur simultaneously. This is verified by examining each state and confirming that at least one direction always has red (or yellow) when the other has any non-red light.
Concept Tested: Traffic Light Controller
8. In a vending machine FSM, what do the states typically represent?
- Different products available
- The accumulated money amount
- The time since last transaction
- The number of items dispensed
Show Answer
The correct answer is B. Vending machine FSM states represent the accumulated money amount (0¢, 5¢, 10¢, 15¢, 20¢, etc.). Transitions occur as coins are inserted, and the FSM dispenses the product and returns change when the threshold is reached.
Concept Tested: Vending Machine FSM
9. What is a pattern recognition FSM capable of beyond simple sequence detection?
- Only detecting single-bit patterns
- Detecting patterns with multiple inputs, wildcards, or alternative paths
- Generating pseudo-random numbers
- Compressing data automatically
Show Answer
The correct answer is B. Pattern recognition FSMs extend sequence detection to handle multiple input bits, don't-care positions (wildcards like "1X1"), alternative patterns (detect "101" OR "110"), counted repetitions, and complex protocol sequences.
Concept Tested: Pattern Recognition FSM
10. What is the most common FSM design error when creating state tables?
- Using too many states
- Leaving undefined behavior for some state × input combinations
- Making the FSM too fast
- Using one-hot encoding
Show Answer
The correct answer is B. The most common error is leaving holes in the state table—undefined behavior for some state × input combinations. When implemented, these cases will have some behavior (often incorrect), leading to hard-to-debug problems.
Concept Tested: FSM Design Process