Lecture_10-Synchronous_Sequential_Analysis

advertisement
ANALYSIS OF SEQUENTIAL
CIRCUITS
by
Dr. Amin Danial Asham
References
Digital Design 5th Edition, Morris
Mano
 Clocked Sequential Circuits
 The behavior of a clocked sequential circuit depends
on the inputs , outputs and the internal state.
 The outputs and the next state are both function on
the applied inputs and the present state.
 The Boolean expressions that describe sequential
circuits must include the time sequence.
 A state table and state diagram are used to describe
the behavior of sequential circuits.
 The analysis of a sequential circuit consists of
obtaining a table, a diagram and Boolean expressions
that describe the behavior of a sequential circuit.
 State Equations
 A clocked sequential circuit can be described by algebraic equations called
state equations or transition equations.
 A state equation expresses the next state as a function of the present state
and inputs.
 Example: This circuit has an input 𝑥
and an output 𝑦 and two FF’s 𝐴
and 𝐵.
By noting that the D input of a
flip-flop determines the value of
the next state. The state
equations are:
𝐴 𝑡 + 1 = 𝐴 𝑡 𝑥 + 𝐵(𝑡)𝑥
𝐵(𝑡 + 1) = 𝐴’(𝑡)𝑥
Therefore, a state equation
specifies the condition for a FF
state transition.
 State Equations (continue)
 Since the left side of the state
equation presents the next state
and hence (𝑡 + 1) is used.
 The right side presents the
Boolean expression that specifies
the condition of setting the next
state as function of the present
state and inputs.
 For simplicity (t) will be omitted
from the present state. Hence the
state equation become:
𝐴 𝑡 + 1 = 𝐴𝑥 + 𝐵𝑥
𝐵(𝑡 + 1) = 𝐴’𝑥
 Consequently, the output is:
𝑦(𝑡) = 𝑥’(𝑡)(𝐴(𝑡) + 𝐵(𝑡))
 Becomes
𝑦 = 𝑥’(𝐴 + 𝐵)
 State Table:
 The time sequence of the inputs, outputs and FF states are listed in a table
called state table or transition table .
 This table can be obtained as follows:
• Listing all possible combinations of
current state and inputs, then using the
using the state equations for each
combination.
𝐴 𝑡 + 1 = 𝐴𝑥 + 𝐵𝑥
𝐵(𝑡 + 1) = 𝐴’𝑥
• The output is a obtained from the
present state and inputs from the
output equation.
𝑦 = 𝑥’(𝐴 + 𝐵)
 State Table (continue)
 From the previous example we used all the possible
combinations of 2 FF’s and a single input which is 23 = 8
combinations.
 Hence the state table has 8 rows.
 In general, for a sequential circuit with 𝑚 FF’s, 𝑛 inputs,
and 𝑜 outputs, the state table has:
• 2𝑚+𝑛 rows.
•𝑚 next state columns
•𝑜 output columns.
 State Table (continue)
 Another form of the state table where for each
present state, the next states and output are listed for
each input value.
State Diagram
 State diagram is a graphical presentation of the information available in a state
table
 The state of the FF’s is represented by a binary number inside a circle.
 The clock triggered transitions are represented by labeled directed lines
connecting the circles. The labels are two numbers separated by a slash:
 The number before the slash is the input value during the present state.
 The second number after the slash is the output during the present state with
the given input .
State Diagram (continue)
 For example, the directed line from state 00 to 01 is labeled
1/0, meaning that when the sequential circuit is in the present
state 00 and the input is 1, the output is 0.
 After the next clock cycle, the circuit goes to the next state, 01.
 If the input changes to 0, then
the output becomes 1.
 If the input remains at 1, the
output stays at 0.
 Steps are:
Circuit diagram → Equations – State table → State diagram
FF input Equations
 The excitation equations are those the Boolean expressions for the inputs of FF’s
in a sequential circuit.
Example, the excitation equations of the next
circuit are:
𝐷𝐴 = 𝑥𝐴 + 𝑥𝐵
𝐷𝐵 = 𝑥𝐴′
• Where 𝐷𝐴 and 𝐷𝐵 are the inputs for 𝐴 FF
and 𝐵 FF respectively.
• While the state equation are:
𝐴 𝑡 + 1 = 𝐴𝑥 + 𝐵𝑥
𝐵(𝑡 + 1) = 𝐴’𝑥
• And the output equation is
𝑦 = 𝑥’(𝐴 + 𝐵)
 FF input equations (continue)
 FF input equations are used to specify the logic
circuit that drive the FF’s and the type of the
FF’s represented by the symbols on the left side
of the equation.
 The sequential circuit diagram can be drawn
using the FF input equations and output
equations.
 Example of Analysis with D FF







For a simple circuit with the following input equation is :
𝐷𝐴 = 𝐴⨁𝑥⨁𝑦
Where 𝑥, 𝑦 are input variables.
𝐷𝐴 implies that we have a 𝐷 FF that has an output 𝐴
Since Characteristic equation D FF : 𝐴 𝑡 + 1 = 𝐷𝐴
Therefore, 𝐴 𝑡 + 1 = 𝐴⨁𝑥⨁𝑦
No output equations implies that the output of the circuit comes from the FF
output.
Therefore,
1
2
3
4
5
6
7
8
2 3
14
5 8
6 7
 Steps of Driving The Next State
1. Drive the flip-flop input equations in terms
of the present state and input variables.
2. Using the input equations a list of the FF’s
inputs can be obtained from all the
combinations of present state and inputs.
3. Use
the
corresponding
flip-flop
characteristic table or characteristic
equation to determine the next-state values
in the state table.
Example of Analysis with JK FF
 For the following circuit.
 The input equations are:
𝐽𝐴 = 𝐵, 𝐾𝐴 = 𝑥 ′ 𝐵
𝐽𝐵 = 𝑥′,
𝐾𝐵 = 𝑥⨁𝐴 = 𝑥 ′ 𝐴 + 𝐴′ 𝑥
 Then listing all possible
combinations of present states and input 𝐴𝐵𝑥 starting from 000 to 111.
State
Table
not
part
of the
state
table
 Get all the FF’s inputs
from the present state
and input using input
equations.
 Using the characteristic
table, get the next state
for each FF.
Example of Analysis with JK FF (continue)

Alternatively, we are going to get the state equations as follows:
o Getting the characteristic equations:
𝐴 𝑡 + 1 = 𝐽𝐴 𝐴′ + 𝐾𝐴′ 𝐴
𝐵 𝑡 + 1 = 𝐽𝐵 𝐵′ + 𝐾𝐵′ 𝐵
o Getting the input equations as done before:
𝐽𝐴 = 𝐵, 𝐾𝐴 = 𝑥 ′ 𝐵
𝐽𝐵 = 𝑥′, 𝐾𝐵 = 𝑥⨁𝐴 = 𝑥 ′ 𝐴 + 𝐴′ 𝑥
o Substituting the input equations in characteristic equation we
get the state equations.
𝐴 𝑡 + 1 = 𝐵𝐴′ + (𝑥 ′ 𝐵)′𝐴 = 𝐵𝐴′ + (𝑥 + 𝐵′)= 𝐴′ 𝐵 + 𝐴𝐵′ + 𝑥𝐴
𝐵 𝑡 + 1 = 𝑥 ′ 𝐵′ + 𝑥⨁𝐴 ′ 𝐵 = 𝑥 ′ 𝐵′ + 𝑥𝐴 + 𝑥 ′ 𝐴′ 𝐵
= 𝑥 ′ 𝐵′ + 𝑥𝐴𝐵 + 𝑥 ′ 𝐴′ 𝐵
 The next state is obtained by state equations and hence the list
of FF’s input table used before is not needed if state equations
are used
Example of Analysis with JK FF (continue)
2
8
7
1
2
3
4
3
5
1
5
6
4
7
8
6
Example of Analysis with T FF
 Characteristic equations
𝐴 𝑡 + 1 = 𝑇𝐴 ⨁𝐴 = 𝑇𝐴 𝐴′ + 𝑇𝐴 ′ 𝐴
𝐵 𝑡 + 1 = 𝑇𝐵 ⨁𝐵 = 𝑇𝐵 𝐵′ + 𝑇𝐵 ′ 𝐵
Input Equations:
𝑇𝐴 = 𝑥𝐵
𝑇𝐵 = 𝑥
Therefore State equations are:
𝐴 𝑡 + 1 = 𝑥𝐵𝐴′ + 𝑥𝐵 ′ 𝐴
= 𝑥𝐴′ 𝐵 + 𝑥 ′ + 𝐵′ 𝐴
= 𝑥𝐴′ 𝐵 + 𝑥 ′ 𝐴 + 𝐵′ 𝐴
𝐵 𝑡 + 1 = 𝑥⨁𝐵 = 𝑥 ′ 𝐵 + 𝑥𝐵′
Output equation:
𝑦 = 𝐴𝐵
Example of Analysis with T FF (continue)
 From the state and output equations we get:
The two values
inside each circle
and separated by
a slash are for the
present state and
output
Finite State Machine (FSM)
 There are two models of Moore Model and Mealy Model.
Finite State Machine (FSM) (continue)
 In Moore model the output depends only on the FF states and hence the
output is synchronized with the clock.
 In Mealy model the output depends on the FF states and the inputs.
 The output in the Mealy model may change because of the input variation
during the clock cycle and hence the output is not synchronized with the
clock.
 The outputs in Mealy model may have momentary false values because of
the delay between the inputs change and the FF outputs change.
Finite State Machine (FSM) (continue)
 In order to synchronize the output of a Mealy-type circuit and
avoid the momentary false output:
o The inputs are changed at the inactive edge of the
clock to get enough time to stabilize before the
active edge of the clock occurs.
o Thus, the valid output of the Mealy machine is
available immediately before the active edge of
the clock.
Inputs are Changed
Active
edge
Inactive
edge
Output is sampled
Examples of FSM
Moore Model
Mealy Model
Thanks
Download