1. Intuition First: States as Circuit Memory
Consider a vending machine dispensing a 0.00, 1.00, or $1.50).
That stored snapshot of past history is the machine's state:
- Each incoming coin is an input () that transitions the machine to a new state.
- Once the credit reaches Z$) to unlatch the dispenser solenoid.
- The entire operational universe of this system can be drawn on a single sheet of paper as a State Diagram consisting of circles (states) and directed arrows (transitions).
+----------+ Coin = $0.50 +----------+ Coin = $0.50 +----------+
Reset ->| $0.00 |------------------->| $0.50 |------------------->| $1.00 |
+----------+ +----------+ +----------+
^ |
| | Coin = $0.50
| Dispense Drink (Z = 1) v
+----------------------------------------------------------+----------+
| $1.50 |
+----------+
Moore vs. Mealy Architectures
Every synchronous Sequential Machine is categorized into one of two fundamental models:
-
Moore Machine: The output depends only on the current state ().
- In a vending machine, the front-panel display says "DISPENSE" purely because the system is currently residing in the $1.50 state.
- Outputs are strictly synchronized with clock edges, eliminating combinational input glitches.
- For an -bit sequence detector, a Moore machine requires states.
-
Mealy Machine: The output depends on both the current state and the current external input ().
- The drink is released on the exact moment the final coin drops into the slot while in the $1.00 state.
- Outputs respond immediately within the clock cycle when input changes, reacting one clock cycle faster than Moore machines.
- Glitch hazard: any noise or ripple on input line propagates straight through combinational logic to output .
- For an -bit sequence detector, a Mealy machine requires only states.
2. Formula & Unit Quick-Reference Strip
Next state Q^+ is a combinational boolean function of present state Q and primary input X.
Moore outputs depend purely on present state Q, changing only synchronously at clock edges.
Mealy outputs depend on both state Q and input X, responding asynchronously to input changes.
D flip-flop captures its input directly on clock edge, so D input equals desired next state.
Minimum flip-flop count to represent S unique states using compact binary codes.
Uses one flip-flop per state; state bit i is HIGH only in state i, simplifying combinational logic.
Overlapping 3-bit pattern requires 4 states in Moore architecture and 3 states in Mealy architecture.
3. Mathematical Derivation: 101 Moore Sequence Detector
4. Typical Bench Values & Timing Parameters
When implementing FSMs using discrete TTL/CMOS logic (e.g., 74HC74 dual D flip-flop) or FPGA register slices, timing parameters determine the maximum reliable clock frequency:
| Parameter / Part | Typical Value | Lab Range | Practical Notes |
|---|---|---|---|
| Logic Supply Voltage (V_CC) | 3.3V or 5.0V DC | 2.0V - 6.0V (CMOS) | Standard rail for 74HC/74HCT logic chips |
| Clock Frequency (f_max) | 25 MHz to 100 MHz | 1 MHz - 250 MHz | Depends on critical path: t_clk >= t_cq + t_comb + t_su |
| Clock-to-Q Delay (t_cq) | 14 ns | 8 ns - 30 ns | Delay from clock rising edge until Q outputs change |
| Setup Time (t_su) | 15 ns | 10 ns - 25 ns | Minimum time next-state logic D must stabilize before clock edge |
| Hold Time (t_h) | 3 ns | 0 ns - 5 ns | Time D input must remain stable after clock edge triggers |
| Mealy Glitch Duration (t_glitch) | 2 ns to 8 ns | 0.5 ns - 15 ns | Asynchronous output spikes caused by unequal input wire delays |
5. Worked Engineering Examples
Example 1: Tracing the Overlapping Moore Detector
Trace the Moore 101 sequence detector designed in Section 3 across the serial input bitstream X = [1, 0, 1, 0, 1, 1, 0, 1] starting from initial reset state S0. Identify all clock cycles where pattern detection is declared.
Example 2: Gate-Level Hardware Verification
Verify the excitation circuit at state S2 (Q1=1, Q0=0). When incoming bit X=1 arrives, evaluate D1, D0, and the resulting next state, confirming it transitions to S3.
Example 3: Mealy Implementation Comparison
Design the 3-state Mealy equivalent for the 101 overlapping detector. Contrast state count, output timing, and glitch susceptibility against the Moore machine.
6. Common Exam Traps & Where Marks Are Lost
Avoid these classic calculation errors frequently spotted on semester examination answer scripts:
- Forgetting Sequence Overlap: After pattern 101 is matched, never jump straight back to reset state S0! The trailing '1' can form the first bit of the next match. Jumping to S0 misses overlapping occurrences like 10101.
- Drawing Mealy Outputs Inside State Circles: Moore outputs belong inside state circles (State/Output, e.g., S3/1). Mealy outputs belong strictly on transition arrows alongside the input (Input/Output, e.g., X=1/Z=1). Mixing this up loses full marks on state diagrams.
- Incomplete State Tables: Every state MUST define transitions for EVERY possible input combination (e.g., both X=0 and X=1). Leaving an input condition blank leaves the hardware undefined.
- Ignoring Unused State Codes: When 3 states are encoded with 2 flip-flops (00, 01, 10), state 11 is unused. Always verify next-state logic for unused codes to ensure the circuit self-recovers and does not lock up permanently.
- Confusing Present State Q with Next State Q+: Remember that flip-flop inputs D equal next state Q+ (D = Q+), NOT present state Q. Never write excitation equations in terms of Q+.
- Assuming Mealy Outputs Are Clocked: Mealy outputs are combinational functions of both Q and X. They change immediately when X changes, even midway between clock ticks.
7. Interactive Logic Simulation & 'Try Breaking It'
Analyze serial sequence detection, clock timing, and state transitions using the logic analyzer below:
Feed the stream 10101 into the Moore detector and predict how many matches it reports. Then change the transition arrow from S3 on X=0 so it returns to S0 instead of S2, and predict again.
8. Parametrised Practice Problem
Test your sequential design mastery with custom sequence detection parameters:
Thévenin Equivalent of a Loaded Voltage Divider
A 18 V DC voltage source powers a divider with R1 = 50 Ω and R2 = 60 Ω. Calculate the open-circuit Thévenin voltage V_th (in Volts) appearing across terminals of R2.