Professional Documents
Culture Documents
BIM203 - 08 - Storage Elements and Sequential Circuit Analysis
BIM203 - 08 - Storage Elements and Sequential Circuit Analysis
Storage Elements
and
Sequential Circuit Analysis
Overview
Inputs Outputs
Combina-
▪ A Sequential tional
circuit contains: Storage
Logic
Elements
• Storage elements:
Latches or Flip-Flops Next
State State
• Combinational Logic:
▪ Implements a multiple-output
switching function
▪ Inputs are signals from the outside.
▪ Outputs are signals to the outside.
▪ Other inputs, State or Present State, are
signals from storage elements.
▪ The remaining outputs, Next State are
inputs to storage elements.
BIM203 Logic Design Storage Elements and Sequential Circuit Analysis 3
Introduction to Sequential Circuits
Inputs Outputs
Combina-
tional
Storage
Logic
Elements
▪ Combinatorial Logic Next
• Next state function State State
Next State = f(Inputs, State)
• Output function (Mealy)
Outputs = g(Inputs, State)
• Output function (Moore)
Outputs = h(State)
▪ Output function type depends on specification and affects
the design significantly
A
B
S
S
Y
▪ “Glitch” is due to delay of inverter
BIM203 Logic Design Storage Elements and Sequential Circuit Analysis 9
Storing State
▪ What if A con-
nected to Y? 0.4
▪ Circuit becomes: 0.2
▪ With function: 0.5
• Y = B for S = 1, and
S Y
Y(t) dependent on B 0.4
Y(t – 0.9) for S = 0
B
S
S
Y
▪ The simple combinational circuit has now become a
sequential circuit because its output is a function of a time
sequence of input signals!
Y is stored value in shaded area 10
BIM203 Logic Design Storage Elements and Sequential Circuit Analysis
Storing State (Continued)
0.2
“feedback path.”
0.2
0.5
S Y
B 0.4
▪ The following behavior results:
▪ The circuit is said B S Y Comment
to be unstable. 0 1 0 Y = B when S = 1
1 1 1
▪ For S = 0, the
1 0 1 Now Y “remembers” A
circuit has become 1 0 0 Y, 1.1 ns later
what is called an 1 0 1 Y, 1.1 ns later
oscillator. Can be 1 0 0 Y, 1.1 ns later
used as crude clock.
BIM203 Logic Design Storage Elements and Sequential Circuit Analysis 12
Basic (NAND) S – R Latch
▪ “Cross-Coupling” S (set)
Q
two NAND gates gives
the S -R Latch:
▪ Which has the time R (reset) Q
sequence behavior:
Time R S Q Q Comment
1 1 ? ? Stored state unknown
1 0 1 0 “Set” Q to 1
1 1 1 0 Now Q “remembers” 1
▪ S = 0, R = 0 is 0 1 0 1 “Reset” Q to 0
forbidden as 1 1 0 1 Now Q “remembers” 0
input pattern 0 0 1 1 Both go high
1 1 ? ? Unstable!
▪ Adding an inverter D
to the S-R Latch, Q
Clock C Q
▪ Suppose that initially Y = 0.
Clock
Y
▪ As long as C = 1, the value of Y continues to change!
▪ The changes are based on the delay present on the loop
through the connection from Y back to Y.
▪ This behavior is clearly unacceptable.
▪ Desired behavior: Y changes only once per clock pulse
BIM203 Logic Design Storage Elements and Sequential Circuit Analysis 20
The Latch Timing Problem (continued)
R R C C
▪ Master-Slave:
(a) Latches
Postponed output S S D D
indicators C C
R R C C
Dynamic D D
indicator
C C
Triggered D Triggered D
(c) Edge-Triggered Flip-Flops
BIM203 Logic Design Storage Elements and Sequential Circuit Analysis 27
Direct Inputs
it begins operation
▪ This initialization is often done C Q
R
outside of the clocked behavior
of the circuit, i.e., asynchronously.
▪ Direct R and/or S inputs that control the state of the
latches within the flip-flops are used for this
initialization.
▪ For the example flip-flop shown
• 0 applied to R resets the flip-flop to the 0 state
• 0 applied to S sets the flip-flop to the 1 state
BIM203 Logic Design Storage Elements and Sequential Circuit Analysis 28
Sequential Circuit Analysis
▪ General Model
Inputs Outputs
• Current State Combina-
at time (t) is tional
stored in an Storage Logic
array of Elements
Next
flip-flops. State State
• Next State at time (t+1)
is a Boolean function of CLK
State and Inputs.
• Outputs at time (t) are a Boolean function of
State (t) and (sometimes) Inputs (t).
▪ Input: x(t) x D Q A
▪ Output: y(t) A
C Q
▪ State: (A(t), B(t))
▪ What is the Output
D Q B
Function?
CP C Q
• B(t+1) = A(t)x(t)
• y(t) = x(t)(B(t) + A(t)) D Q B
CP C Q'
Output
1
0
1
0 0
0 1
0
▪ Label form:
• On circle with output included:
▪ state/output
▪ Moore type output depends only on state
• On directed arc with the output
included:
▪ input/output
▪ Mealy type output depends on state and
input
1/0
BIM203 Logic Design Storage Elements and Sequential Circuit Analysis 41
Moore and Mealy Models
x=1 x=1
x=0
1/0 2/1
x=1
BIM203 Logic Design Storage Elements and Sequential Circuit Analysis 43
Moore and Mealy Example Tables
specification
1/0
10 11
1/0
C RQ
D Q
B
C RQ
D Q
C
Clock CR Q
Reset
▪ Variables
• Inputs: None
• Outputs: Z
• State Variables: A, B, C
▪ Initialization: Reset to (0,0,0)
▪ Equations
• A(t+1) = Z=
• B(t+1) =
• C(t+1) =
BIM203 Logic Design Storage Elements and Sequential Circuit Analysis 47
Example 2: State Table
ABC
Reset 000