E21 Lecture #7

Designing State Machines

  1. Develop problem description
  2. Design state machine
  3. Create state transition table
  4. Reduce states
  5. Encode states and inputs
  6. Redo state transition table using state encodings
  7. Determine how many flip-flops to use
  8. Determine what kinds of flip-flops to use
  9. Redo state transition table using the flip-flop excitation tables
  10. Use minimization methods to calculate combinational logic
  11. Draw diagrams
  12. Implement circuit

Example

Problem Statement: We want to design a security system that has a wait state for 30 seconds after the system has been enabled. The system's inputs are the enable switch and the door switch. In addition, we have a timer circuit that has a reset input (1 is reset, 0 means count) and an output that is 1 when the timer reaches 30 seconds.

  1. Design state machine
  2. Encode states: disabled == 00, waiting == 01, enable == 11, bad (or alarm) == 10
  3. Create state transition table
  4. Choose D flip-flops (2) for this case
  5. Use minimization to calculate the combinational logic
  6. Draw diagrams

How do we fix the problem of the alarm turning off?

State reduction

Example: pp. 230 of Mano

Excitation Tables

Example: pp. 234 of Mano

Analysis of Sequential Circuits

  1. Determine the excitation equations for the flip-flop control inputs.
  2. Substitute the excitation equations into the flip-flop characteristic equations to get the transition equations.
  3. Use the transition equations to get the transition table.
  4. Determine the output equations.
  5. Add output values to create the transition table for each state/output combination
  6. Name the states, inputs, and outputs, and substitute state names for state variables.
  7. Draw a state diagram corresponding to the state-output table.

Example

Qa(t + 1) = Qa(t) Qb(t) Xt + Qz(t) Qb(t)

Qb(t + 1) = Xt

  1. Create state transition table
  2. Name states
  3. What does it do? (recognizes 001 in a bit stream)

Designing counters

4-bit counter using JK flip-flops

Modulo 9 (BCD) counter using D flip-flops