E21 Digital Logic Design Lecture #6
Review
-
clocked SR flip-flop
-
clocked D flip-flop
Student examples
-
Clocked JK flip-flop
-
Clocked T flip-flop
-
Master-slave flip-flop
-
Edge-triggered D flip-flop
What can we do with flip-flops? Build state machines.
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.
Task: Security system
- State 0: Idle state. All inputs except the enable input are ignored.
- State 1: Wait state. All inputs except the "timer done" input are ignored.
- State 2: Enabled. If any of the alarm-causing inputs go off, sound the alarm.
Inputs:
-
Enable - 1 turns on the system, 0 indicates the system should be disabled.
-
Door - 1 when the door is open.
-
Timer done - 1 when the time reaches 30 seconds.
Outputs:
-
Alarm - 1 when an alarm should be sounded.
-
Reset counter - 1 when in the idle or enabled states, 0 otherwise.
Designing state machines
-
Develop state diagrams.
-
Generate next-state and output tables.
-
Minimize states.
-
Choose a set of variables and encode inputs, states, outputs.
-
Derive next-state and output tables using the encoded values.
-
Choose a flip-flop type and create the excitation tables.
-
Derive the excitation and output equations from the tables.
-
Design the logic diagram.
Analyzing clocked synchronous state machines
-
Determine the excitation equations for the flip-flop control inputs.
-
Substitute the excitation equations into the flip-clop characteristic equations to get the transition equations.
-
Use the transition equations to get the transition table.
-
Determine the output equations.
-
Add output values to create the transition table for each state or state/output combination.
-
Name the states and substitute state names for state-variables.
-
Draw a state diagram corresponding to the state-output table.
Examples
-
State machine that recognizes 001 in a bit stream sequence (Tuesday).
-
4-bit counter using JK flip-flops (Tuesday).
-
Modulo 9 (BCD) 4-bit counter using D flip-flops (Thursday).
-
4-bit Bidirectional shift register with parallel load (Thursday).