Title: EEL 3705 / 3705L Digital Logic Design
1EEL 3705 / 3705LDigital Logic Design
- Fall 2006Instructor Dr. Michael FrankModule
8 Introduction to Sequential Logic(Thanks to
Dr. Perry for the slides)
2Wednesday, October 25, 2006
- Administrivia
- This weeks lab
- Midterm practical exams
- Homework assignment 4
- Due tonight
- Midterm Exam 2
- Nov. 6 (a week from Monday) Review on Nov. 1
- Plan for todays lecture
- Start coverage of sequential logic
3Introduction to Sequential Design
4Types of Logic Circuits
- Logic circuits can be
- Combinational Logic Circuits-outputs depend only
on current inputs - Sequential Logic Circuits-outputs depends not
only on current inputs but also on the past
sequence of inputs
5Sequential Circuit Models
6Combinational Logic Delay
Longest delay
Shortest delay
Longest timing delay 5ns5ns5ns5ns
20ns Shortest timing delay 5ns
We will use the longest delay to represent the
combinational logic (CL) delay, tcl
7Combinational Logic (CL) Cloud Model
Tcl20ns
Tcl20ns
8Memory
9Memory
- We will add memory (or registers) to our logic
circuits. This will allow us to design
sequential circuits.
10Registers
- We will represent registers with the following
block diagram
Clock and reset are control signals Ns and ps are
data signals
11Sequential Systems
12Sequential Systems General Block Diagram
Next State
Present State
Output Vector
Input Vector
Clock
Feedback Path
Reset
CL Combinational Logic Cloud
Reg D Registers
13Sequential SystemsGeneral Block Diagram
Next State
Present State
Output Vector
Input Vector
Clock
Feedback Path
Reset
X is the input data vector Y is the output data
vector
14Sequential SystemsBlock Diagram
Next State
Present State
Output Vector
Input Vector
Clock
Feedback Path
Reset
Ns is the next state data vector Ps is the
present state data vector
15Sequential SystemsBlock Diagram
Next State
Present State
Output Vector
Input Vector
Clock
Feedback Path
Reset
Notice we have a feedback path which combines the
ps data vector with the input vector to generate
a new ns data vector.
16Sequential SystemsBlock Diagram
Next State
Present State
Output Vector
Input Vector
Clock
Feedback Path
Reset
Mathematically, we say
Or, ns is a function F of X and ps and Y is a
function H of ps.
17Example
F Logic
Register
Circuit Schematic
ns
ps
X input
H Logic (buffer)
Block Diagram
18Example
F Logic
Register
Circuit Schematic
ns
ps
X input
H Logic (buffer)
State Equations
19Finite State Machine (FSM)
20Moore FSM General Block Diagram
Next State
Present State
Output Vector
Input Vector
Clock
Feedback Path
Reset
CL Combinational Logic Cloud
Reg D Registers
21Moore FSM State Equations
Next State
Present State
Output Vector
Input Vector
Clock
Feedback Path
Reset
State Equations
22Mealy FSM Block Diagram and State Equations
Next State
Present State
Input Vector
Output Vector
Feedback Path
Output Y is also a function of input X
23Mealy-Moore FSM Block Diagram and State Equations
Present State
Next State
Input Vector
Mealy Outputs
Moore Outputs
24State Diagrams
25State Bubble
26State Bubble Example
Conditional Transition
Unconditional Transition
State name S0 State value 00 Y 0 for this
state
We leave this state if upn1, We remain in this
state if upn0
27Memory Devices
28Memory Devices
- Data Latch (D-latch)
- Flip-flops (edge triggered)
- D-FF, D Register
- JK-FF
- T-FF
29D-FF Positive Edge TriggeredBlock Diagram
Symbol
4 inputs D,Clk,Pre,Rst One output Q
D Data Input Clk Clock Input Pre Preset
Input Rst Reset Input
30D-FF Truth Table
Symbol
Truth Table
D Clk
d d 1 0 0
d d 0 1 1
d 0 1 1
d 1 1 1
0 1 1 0
1 1 1 1
Equation (rising clock)
31D-FF Truth Table
Symbol
Truth Table
D Clk
d d 1 0 0
d d 0 1 1
d 0 1 1
d 1 1 1
0 1 1 0
1 1 1 1
Equation (rising clock)
Pre Preset Input (active low) Rst Reset Input
(active low) Highest priority
32D-FF Truth Table
Symbol
Truth Table
D Clk
d d 1 0 0
d d 0 1 1
d 0 1 1
d 1 1 1
0 1 1 0
1 1 1 1
Equation (rising clock)
D Data Input Clk Clock input Qn Register
Output
33FSM Examples
34Example 2-bit Up Counter
Clock is implied
35Example 2-bit Up Counter
State Value Assignment
S0 00
S1 01
S2 10
S3 11
Let
ps ns y
S0 S1 0
S1 S2 1
S2 S3 2
S3 S0 3
Output Vector
Let S0 reset state
36Example 2-bit Up Counter
ps1 ps0 ns1 ns0 y1 y0
0 0 0 1 0 0
0 1 1 0 0 1
1 0 1 1 1 0
1 1 0 0 1 1
37Example 2-bit Up Counter
38Moore FSM
Next State
Present State
Output Vector
Input Vector
Clock
Feedback Path
Reset
State Equations
39Logic Diagram
No X Vector in this Example No H Logic needed
40Logic Diagram
41Flash Animation
42Example 3 2-bit Down Counter
Clock is implied
43Example 2-bit Down Counter
S0 00
S1 01
S2 10
S3 11
Let
ps ns y
S0 S3 0
S3 S2 3
S2 S1 2
S1 S0 1
Let S0 reset state
44Example 2-bit Down Counter
ps1 ps0 ns1 ns0 y1 y0
0 0 1 1 0 0
0 1 0 0 0 1
1 0 0 1 1 0
1 1 1 0 1 1
45Example 2-bit Down Counter
46Recall Moore FSM
Next State
Present State
Output Vector
Input Vector
Clock
Feedback Path
Reset
State Equations
47Logic Diagram
Reg Block
F Logic
Y Vector
H Logic
No X Vector in this Example
48Logic Diagram
49Example 4 2-bit Up/Down Counter
50Example 2-bit Up/Down Counter
Shorthand Notation
51Example 2-bit Up/Down Counter
ps ns upn ns upn y
S0 S1 S3 0
S1 S2 S0 1
S2 S3 S1 2
S3 S0 S2 3
S0 00
S1 01
S2 10
S3 11
Let
Let S0 reset state
52Example 2-bit Up/Down Counter
upn ps1 ps0 ns1 ns0 y1 y0
0 0 0 0 1 0 0
0 0 1 1 0 0 1
0 1 0 1 1 1 0
0 1 1 0 0 1 1
1 0 0 1 1 0 0
1 0 1 0 0 0 1
1 1 0 0 1 1 0
1 1 1 1 0 1 1
53Example 2-bit Up/Down Counter
54Recall Moore FSM
Next State
Present State
Output Vector
Input Vector
Clock
Feedback Path
Reset
State Equations
55Logic Diagram
Reg Block
X Vector
F Logic
Y Vector
H Logic
56Logic Diagram
57Example 5 3-bit Arbitrary Counter
- Design a 3-bit arbitrary counter that will count
in the following sequence - 3,2,3,1,2,3
- If a state is not used reset it to state zero.
- How may states do we have?
- How many registers do we need?
- How many bits do we need for Y?
58Example 5 3-bit Arbitrary Counter
59Example Arbitrary 3-bit Counter
Assign State Values
Let
S0 000
S1 001
S2 010
S3 011 S4 100 S5 101 S6 110 S7 111
ps ns y
S0 S1 3
S1 S2 2
S2 S3 3
S3 S4 1
S4 S0 2
S5 S0 0
S6 S0 0
S7 S0 0
Let S0 reset state
60Develop Truth Table
61Example 2-bit Arbitrary Counter
- Develop Excitation Equations -- F Logic
62Develop Excitation Equations for Y
Y1
Y0
63Example 2-bit Arbitrary Counter
- Excitation Equations -- H Logic
64Recall Moore FSM
Next State
Present State
Output Vector
Input Vector
Clock
Feedback Path
Reset
State Equations
65Logic Circuit
H
REG
F
66Logic Circuit
67Simulation
68Monday, October 30, 2006
- Administrivia
- This weeks lab
- Comparators and arithmetic
- Homework assignment 5
- Will be posted soon (if not already)
- Midterm Exam 2
- Nov. 6 (a week from today) Review this Thursday
- Plan for todays lecture
- Continue coverage of sequential logic
69Wednesday, November 1, 2006
- Administrivia
- This weeks lab
- Comparators and arithmetic
- Homework assignment 5
- Will be posted soon (if not already)
- Midterm exam 2
- Postponing to Nov. 13th review next Wednesday
- Plan for todays lecture
- Continue coverage of sequential logic
70Example 5 2-bit Up/Down Counter with Active Low
Enable and Synchronous RESET (SRESET)
Clock is implied
71Example 2-bit Up/Down Counter with Enable and
SRESET
srn en upn Function
0 d d Synchronous Reset (sreset)
1 1 d Hold
1 0 0 Count Up
1 0 1 Count Down
Highest Level of Priority
Lowest Level of Priority
72State Table
Srn En upn ns
0 d d S0
1 1 d ps
1 0 0 ps1
1 0 1 ps -1
73Truth Table (5 variables!!)
Although, we could design this circuit directly
from the truth table we will use design
partitioning.
74Moore FSM Architecture
Next State
Present State
Output Vector
Input Vector
Feedback Path
75Partitioned Design
We have
srn
Srn En ns
0 d S0
1 1 PS
1 0 Count
en
Note, with the partitioned design we can reuse
already designed submodules to create the new
design.
76Top Level Block Diagram
77UP/Down Logic
Logic Circuit
Symbol
78Register Block
Symbol
Logic Circuit
792 Bit 4x1 Mux
Circuit
Symbol
801-bit 4x1 Mux
Logic Circuit
Symbol
811-bit 2x1 Mux
Logic Circuit
Symbol
82Top Level Block Diagram
83Simulation
84Example 6 FSM Controller
State Diagram
85Truth Table for NS
Truth Table
86Kmaps for NS1 and NS0
NS1
NS0
87Truth Table and Equations for Y
Truth Table
Recall, Moore FSM, so Y will Not be a function of
T
By Inspection
88Logic Circuit
H
REG
F
89Simulation
90Memory Devices
91Flip-Flops
92D-FF Truth TableQn follows D on Rising Edge of
CLK
Symbol
Truth Table
D Clk
d d 1 0 0
d d 0 1 1
d 0 1 1
d 1 1 1
0 1 1 0
1 1 1 1
Equation (rising clock)
D Data Input Clk Clock input Qn Register
Output
93T-FF (Toggle)Changes state on every tick of CLK
Symbol
T Clk
D d 1 0 0
D d 0 1 1
d 0 1 1
d 1 1 1
0 1 1
1 1 1
Equation (rising clock)
Truth Table
94SR-FFSet gtQn1ResetgtQn0
Symbol
S R Clk
d d d 1 0 0
d d d 0 1 1
d d 0 1 1
d d 1 1 1
0 0 1 1
0 1 1 1 0
1 0 1 1 1
1 1 1 1 ???
Equation (rising clock)
Truth Table
95JK-FF
Symbol
J K Clk
d d d 1 0 0
d d d 0 1 1
d d 0 1 1
d d 1 1 1
0 0 1 1
0 1 1 1 0
1 0 1 1 1
1 1 1 1
Equation (rising clock)
Truth Table
96Example Design a JK-FF usingonly Logic and a
D-FF
Symbol
J K Clk
d d d 1 0 0
d d d 0 1 1
d d 0 1 1
d d 1 1 1
0 0 1 1
0 1 1 1 0
1 0 1 1 1
1 1 1 1
Truth Table
97Example
State Table
State Diagram
Let s00 and s11
98JK-FF
Truth Table
Logic Equations
99Recall Moore FSM State Equations
Next State
Present State
Output Vector
Input Vector
Clock
Feedback Path
Reset
State Equations
100JK Example
F Logic
D-Register
Circuit Schematic
ns
ps
X input
H Logic (buffer)
Block Diagram
101JK Example
Circuit Schematic
Simulation
102Latches
103D-Latch Block Diagram
Symbol
4 inputs D,E,Pre,Rst One output Q
D Data Input E Enable Input Pre Preset
Input Rst Reset Input
104D-Latch Truth Table
Symbol
Truth Table
D E
d d 1 0 0
d d 0 1 1
d 0 1 1
0 1 1 1 0
1 1 1 1 1
105D-LatchState Equations
Symbol
Truth Table
D E
d d 1 0 0
d d 0 1 1
d 0 1 1
0 1 1 1 0
1 1 1 1 1
Equation (level clock)
106SR-LatchState Equations
Symbol
Truth Table
S R
d d 1 0 0
d d 0 1 1
0 0 1 1
0 1 1 1 0
1 0 1 1 1
1 1 1 1 ???
Equation (level clock)
107Example
T-FF
D-FF
D-Latch
108Simulation
109Modular Sequential Logic
110Shift Registers
- Logic Design which manipulates the bit position
of binary data by shifting it to the left or
right. - Major application
- Serial Data to Parallel Data converters
111Example
- Design a three-bit shift register with the
following functions
S1 S0 Function
0 0 Synchronous Reset (sreset)
0 1 Shift Right
1 0 Shift Left
1 1 No Shift
112Partitioned Design
113No Shift Equations and Circuit
114Shift Left Equations and Circuit
115Shift Right Equations and Circuit
116Synchronous Reset Module
117Registers
118Total Design