meljun cortes sequential logic
TRANSCRIPT
-
8/8/2019 MELJUN CORTES Sequential Logic
1/63
F0064
physically implemented by the sequentialcircuit
SequentialLogic
Sequential Circuit
a type of circuit whose output depends not onlyon its inputs’ present state, but also its previousinputs
made up of not only of the basic combinational
circuits but also of storage elements
classified according to the timing of its signals
Block Diagram of the Sequential Circuit
Sequential Logic * Property of STI Page 1 of 63
Source: Mano, “Digital Design”
-
8/8/2019 MELJUN CORTES Sequential Logic
2/63
F0064
observes its inputs and internal states only atcertain, discrete points in time
SynchronousSequential Logic
Asynchronous Sequential Circuit
observes the behavior of its inputs at anyinstance of time, as well as the order in whichthese inputs change in continuous time
Block diagrams of Synchronous SequentialCircuit
Sequential Logic * Property of STI Page 2 of 63
Source: M. Mano, ”Logic and Computer Design Fundamentals”, 2nd ed updated
-
8/8/2019 MELJUN CORTES Sequential Logic
3/63
F0064
has to be synchronized by making it follow atiming device called the clock generator or
SynchronousSequential Logic
simply, the clock
Clock
produces a periodic train of clock pulses fromwhich the required changes in the storagedevices are timed
Clock Pulses
are timed pulses of high and low-logic levelelectric signals
Sequential Logic * Property of STI Page 3 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
4/63
F0064
the basic storage element from which flip-flopsare usually constructed
Latches
as long as there is electricity powering thiscircuit, it holds and maintains the binary state
fed to it
asynchronous in nature
they do not need to be clocked to functionproperly
digital circuit that has two outputs that shouldalways be at opposite states
digital circuits that have two outputs (commonlynamed as Q’ and Q ) that should always be ato osite states
Sequential Logic * Property of STI Page 4 of 63
Types of Latches:
the SR (and S’R’ )
D latches
-
8/8/2019 MELJUN CORTES Sequential Logic
5/63
F0064
also called an RS latch
Crossed-NORSR Latch
The SR Latch from Two Cross-Coupled NORGates
short for SET-RESET
Sequential Logic * Property of STI Page 5 of 63
its present state triggering of its SET or RESET input line
the two NOR gates used in implementing thelatch are defined by the following equations:
NOR gate A
NOR gate B
-
8/8/2019 MELJUN CORTES Sequential Logic
6/63
F0064
Crossed-NORSR Latch
S = 1 and R =0:
NOR gate A the set state
by Boolean simplification, this becomes:
Sequential Logic * Property of STI Page 6 of 63
NOR gate B an unchanged state
-
8/8/2019 MELJUN CORTES Sequential Logic
7/63
F0064
Crossed-NORSR Latch
resetting the output Q to 0
Sequential Logic * Property of STI Page 7 of 63
an unused or undefined state
-
8/8/2019 MELJUN CORTES Sequential Logic
8/63
F0064
Crossed-NORSR Latch
another unchanged state of the SR latch
Function Table for SR Latch:
Sequential Logic * Property of STI Page 8 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
9/63
F0064
the S’R’ or SET’ RESET’ latch
ver much like the SR latch exce t that this is
Cross-NANDS’R’ Latch
active low the SET’ input must be at logic 0 to set the output
Q to logic 1
The S’R’ Latch and its implementation using
NAND Gates
Sequential Logic * Property of STI Page 9 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
10/63
F0064
Cross-NANDS’R’ Latch
setting the Q output for the cross-NAND S’R’ latch
Sequential Logic * Property of STI Page 10 of 63
resetting
-
8/8/2019 MELJUN CORTES Sequential Logic
11/63
F0064
Cross-NANDS’R’ Latch
unchanged statewhen outputs are set
unchanged state whenoutputs are reset
Sequential Logic * Property of STI Page 11 of 63
unused state whenboth inputs are logic 0
-
8/8/2019 MELJUN CORTES Sequential Logic
12/63
F0064
Function Table for SR Latch:
Cross-NANDS’R’ Latch
Comparison of theSR and S’R’ Latches
Sequential Logic * Property of STI Page 12 of 63
their inputs are complements of each other inproducing the same output
different in the values of the outputs during anunused state
crossed-NAND inputs: active low
cross-NOR inputs: active high
-
8/8/2019 MELJUN CORTES Sequential Logic
13/63
F0064
The GatedSR Latches
symbol of the Gated SR Latch
Sequential Logic * Property of STI Page 13 of 63
circuit construction of the Gated SR Latch
-
8/8/2019 MELJUN CORTES Sequential Logic
14/63
F0064
The GatedSR Latches
setting the output Qwith CLK enabled
output Q is not reseteven with S=0 and R =1because CLK is inhibited
Function Table for Gated SR Latch:
Sequential Logic * Property of STI Page 14 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
15/63
F0064
an improvement over the clocked-SR (or gated-SR) latch in the sense that it prevents the
TransparentD Latch
problem when both the inputs are logic 1 has only two inputs: the input D and the CLK
enable
The D latch symbol and construction using NANDGates
Sequential Logic * Property of STI Page 15 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
16/63
F0064
TransparentD Latch
CLK is enabled and the input D sets the output Q tologic 1
Sequential Logic * Property of STI Page 16 of 63
CLK is enabled and the input D sets the output Q tologic 0s
-
8/8/2019 MELJUN CORTES Sequential Logic
17/63
F0064
TransparentD Latch
Sequential Logic * Property of STI Page 17 of 63
CLK is inhibited and the output Q is not changed
-
8/8/2019 MELJUN CORTES Sequential Logic
18/63
F0064
Function Table for the D Latch with 1Control:
TransparentD Latch
derives its name form its ability to hold data it is called transparent because the information
at the data line is transparent and can be seen
directly from the output as long as the CLK isenabled
Sequential Logic * Property of STI Page 18 of 63
D latch with 0 control symbol and construction
using NOR gates
-
8/8/2019 MELJUN CORTES Sequential Logic
19/63
F0064
Function Table for the D Latch with 0Control:
TransparentD Latch
Sequential Logic * Property of STI Page 19 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
20/63
F0064
Examples
Sequential Logic * Property of STI Page 20 of 63
the timing diagram of a D latch
-
8/8/2019 MELJUN CORTES Sequential Logic
21/63
F0064
Examples
How the Timing Diagram of a D Latch works:
Part 1:
Since the CLK is at logic 1 (HIGH), the value ofD is LOW; D should just be transferred to theout ut Q . The out ut of Q’ should ust be the
Sequential Logic * Property of STI Page 21 of 63
opposite of the Q value for all cases.
Part 2:
There is a transition of logic level of the D inputfrom LOW to HIGH. However, the CLK is still atHIGH. This means that there should also be atransition of the Q output from LOW to HIGH.
-
8/8/2019 MELJUN CORTES Sequential Logic
22/63
F0064
How the Timing Diagram of a D Latch works (cont.):
Examples
Part 3:
There is a transition of the CLK input to LOW.This means that any other change in the input D will not affect the output. The output Q and Q are therefore maintained at their respectivevalues.
Part 4:
Although D goes down to LOW, the output isstill latched to HIGH since CLK is still LOW.
Sequential Logic * Property of STI Page 22 of 63
Part 5: The value of D goes up to HIGH but the CLK is
still LOW. The outputs are not affected by theinput’s transition and they remain the same.
-
8/8/2019 MELJUN CORTES Sequential Logic
23/63
F0064
Given the timing diagram below, determine theoutput waveform for an SR latch.
Example 1
Solution:
Sequential Logic * Property of STI Page 23 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
24/63
F0064
Solution (cont.):
Example 1
Sequential Logic * Property of STI Page 24 of 63
the timing diagram corresponds to the high and lowlogic levels of the SR latch’s function table
-
8/8/2019 MELJUN CORTES Sequential Logic
25/63
F0064
Draw the waveform of the outputs for a gatedSR latch given the inputs below.
Example 2
Solution:
Sequential Logic * Property of STI Page 25 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
26/63
F0064
Solution (cont.):
Example 2
Sequential Logic * Property of STI Page 26 of 63
The gated SR latch can only function if the CLKinput is HIGH. When the CLK is LOW, theoutputs will not change whatever the value of
the S and R inputs are (hence the don’t caresymbol in then function table). Therefore, weneed only consider the instances when the CLK
is at logic 1.
-
8/8/2019 MELJUN CORTES Sequential Logic
27/63
F0064
the basic element for storing binary informationin synchronous sequential circuits
Flip-Flop
made up of latch circuitry
D latch is triggered as long as the clock is enabled
Block diagram of the sequential circuit using a latchas stora e
Sequential Logic * Property of STI Page 27 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
28/63
F0064
eliminates the problem associated with thepropagation of the state of the input of simple
Master-SlaveFlip-Flops
latches for storing information two SR latches may be combined to form a
master-slave configuration
Master-Slave SR Flip-Flops
Sequential Logic * Property of STI Page 28 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
29/63
F0064
Second Latch
ives the final out ut of the fli -flo
Master-SlaveFlip-Flops
1. When the CLK is triggered, the master stage isactivated and is immediately affected by theinputs S and R . The values of the S and R arestored in the master SR latch.
2. When the CLK is driven to logic 0, the output of
the inverter is logic 1 and the slave stage istriggered.
3. Since the slave and master are connected whilethe slave is triggered, the outputs Q and Q’ aresim l the values of the A and A’ master
Sequential Logic * Property of STI Page 29 of 63
outputs.
4. When CLK is again triggered, the master isenabled while the slave is inhibited.
-
8/8/2019 MELJUN CORTES Sequential Logic
30/63
F0064
Timing Diagram of the SR Master-Slave
Fli -Flo s with Time Dela s
Master-SlaveFlip-Flops
Sequential Logic * Property of STI Page 30 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
31/63
F0064
made to avoid the unreliable operation that ispossible for ordinary SR master-slave flip-flops
The JK Flip-Flop
when the J and K inputs of the flip-flop are bothlogic 1, the outputs are simply complemented
The JK flip-flop symbol and master-slaveimplementation
Sequential Logic * Property of STI Page 31 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
32/63
F0064
When both inputs of JK and the SR master- slave flip-flops are 1, three things happen:
The JK Flip-Flop
1. When the flip-flop is presently operatingnormally, the outputs are complemented. Forexample, Q = 1 while Q’ = 0.
Sequential Logic * Property of STI Page 32 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
33/63
F0064
2. When the CLK is triggered, the master SR latchis either SET or RESET since its inputs are
The JK Flip-Flop
guaranteed to be complementary and the exactopposite the flip-flop’s output values.
Sequential Logic * Property of STI Page 33 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
34/63
F0064
3. After the CLK pulse stops triggering, the slavewill now get the value from the master’s outputs.
The JK Flip-Flop
Sequential Logic * Property of STI Page 34 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
35/63
F0064
Function Table for the JK Flip-Flop:
The JK Flip-Flop
Master-slave flip-flops are sometimes called pulse- triggered flip-flops :
the master latch continues to get the inputs until
Sequential Logic * Property of STI Page 35 of 63
t e s n te
-
8/8/2019 MELJUN CORTES Sequential Logic
36/63
F0064
Consider the following illustration of a JK flip-flop’s
slave SR latch:
The JK Flip-Flop
1. When the present state of Q n is logic 0 (and Q n ’ logic 1), and given the following instance fromits timing diagram:
Sequential Logic * Property of STI Page 36 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
37/63
F0064
2. Consider the case when the input to the S lineis delayed internally in the latch. An immediate
The JK Flip-Flop
observation is that the output n +1 is in error.
Sequential Logic * Property of STI Page 37 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
38/63
F0064
The pulse-triggered flip-flop is susceptible to two
problems:
The JK Flip-Flop
1. as long as the CLK is triggered HIGH(intentional or not), the inputs are processedand recognized by the outputs
2. long delays will cause the S and R lines of thelatches inside the flip-flop to change during a
clock pulse
Sequential Logic * Property of STI Page 38 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
39/63
F0064
are employed when time delays and unreliableoscillations are present in a sequential circuit
Edge-TriggeredFlip-Flops
triggers only during the transition of the CLKsignal and ignores the pulse when it is at aconstant level (whether it is HIGH or LOW)
Two Types:
1. Positive edge or leadingedge or rising edge
triggering occurs during theLOW-to-HIGH transition
Sequential Logic * Property of STI Page 39 of 63
2. Negative edge or trailingedge or falling edge triggering occurs during the
HIGH-to-LOW transition
-
8/8/2019 MELJUN CORTES Sequential Logic
40/63
F0064
D-type trailing edge-triggered flip-flop
an exam le of a ne ative ed e-tri ered fli -
Edge-TriggeredFlip-Flops
flop implementation constructed by using a D latch, a gated SR
latch, and connected using an inverter
Trailing Edge D-Type Flip-Flop Implementation
Sequential Logic * Property of STI Page 40 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
41/63
F0064
1. When the clock is at logic 1, the master D latchis turned on and the output at A will follow the
Edge-TriggeredFlip-Flops
value of the input D .
Sequential Logic * Property of STI Page 41 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
42/63
F0064
2. When the negative transition from logic 1 tologic 0 takes place, the master D latch is turned
Edge-TriggeredFlip-Flops
off but the slave transfers the value from itsinputs to the output.
Sequential Logic * Property of STI Page 42 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
43/63
F0064
Function table for the trailing edge D-typeflip-flop:
Edge-TriggeredFlip-Flops
Sequential Logic * Property of STI Page 43 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
44/63
F0064
Leading Edge D-Type Flip-Flop Implementation
Edge-TriggeredFlip-Flops
Function Table for the Leading Edge D-Type
Flip-Flop:
Sequential Logic * Property of STI Page 44 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
45/63
F0064
Symbols for Latches and Flip-Flops
A Summary of the
Different Flip-Flops
Sequential Logic * Property of STI Page 45 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
46/63
F0064
Symbols for Latches and Flip-Flops
A Summary of the
Different Flip-Flops
Sequential Logic * Property of STI Page 46 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
47/63
F0064
Symbols for Latches and Flip-Flops
A Summary of the
Different Flip-Flops
Sequential Logic * Property of STI Page 47 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
48/63
F0064
T flip-flop
it to les the out ut when it is activated
A Summary of the
Different Flip-Flops
whenever its input becomes logic 0, the outputis toggled or complemented
T Flip-Flop from a JK Flip-Flop
Sequential Logic * Property of STI Page 48 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
49/63
F0064
Function Table for the SR Flip-Flop:
Flip-FlopFunction Tables
Function Table for the JK Flip-Flop:
Sequential Logic * Property of STI Page 49 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
50/63
F0064
Function Table for the D Flip-Flop:
Flip-FlopFunction Tables
Function Table for the T Flip-Flop:
Sequential Logic * Property of STI Page 50 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
51/63
F0064
A Sequential Circuit
CircuitAnalysis
Input Equations
Y = (BC)’
D x = (AB )’+ (BC )’ + X’
Sequential Logic * Property of STI Page 51 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
52/63
F0064
State Table
Sequential Logic * Property of STI Page 52 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
53/63
F0064
4 steps to come up with the state table:
State Table
1. List all possible combinations of the presentstates and inputs in order. The present state isthe output of the flip-flops.
2. If there are outputs coming directly from logicgates present, write down their outputequations. Continue with step 2, making
another column for each flip-flop used.3. If there are outputs coming directly from logic
gates present, write down their outputequations.
4. Get the res ective values of the next state from
Sequential Logic * Property of STI Page 53 of 63
the input and present state combinations. We
will use the flip-flop characteristics we havediscussed to evaluate the next state of the flip-flop.
-
8/8/2019 MELJUN CORTES Sequential Logic
54/63
F0064
Derive the state table given the logic diagrambelow:
Example 3
Sequential Logic * Property of STI Page 54 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
55/63
F0064
Solution:
In ut E uations
Example 3
JK flip-flop: J x = AX + (AB)’
K x = (BZ)’
D flip-flop: D y = (BZ)’
NAND-gate: Z = (AB)’
State Table for Example 3:
Sequential Logic * Property of STI Page 55 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
56/63
F0064
an alternative way to represent the states in asequential circuit
State Diagram
more intuitive for human interpretation represented by circles - the more flip-flops there
are for a certain circuit, the more circles areneeded
State Diagram from the State Table for Example 3
Sequential Logic * Property of STI Page 56 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
57/63
F0064
Derive the state table given the logic diagrambelow:
Example 4
Solution:
Sequential Logic * Property of STI Page 57 of 63
D flip-flop: D x = (AY + AX’)’ NAND-gate: Y = AX’
-
8/8/2019 MELJUN CORTES Sequential Logic
58/63
F0064
Write down the state table by enumerating thepresent state and input
Example 4
Evaluate the value of the output Y from theAND-gate equation
Sequential Logic * Property of STI Page 58 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
59/63
F0064
The next state Xn+1 results from following theinput equation for the D-type flip-flop
Example 4
The state diagram is directly derived from theabove state table
Sequential Logic * Property of STI Page 59 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
60/63
F0064
State Equation
ma be directl derived from the state table of a
Design and Synthesis
of Sequential Circuits
sequential circuit consists of simple Boolean expressions for the
output combinational circuit using the sum ofminterms, with the left-hand side of the equationcontaining the output variable
State Table for Example 4:
Sequential Logic * Property of STI Page 60 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
61/63
F0064
State Equations:
Z A X Y = S 1 2 4 6
Design and Synthesis
of Sequential Circuits
D X (A,X,Y ) = S(2,5,6)
D Y (A,X,Y ) = S(0,2,3,4,6)
K-Map Simplification for the State Equations
Sequential Logic * Property of STI Page 61 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
62/63
F0064
K-Map Simplification for the State Equations
Design and Synthesis
of Sequential Circuits
Sequential Logic * Property of STI Page 62 of 63
-
8/8/2019 MELJUN CORTES Sequential Logic
63/63
F0064
The simplified state equations are therefore:
Z = A’ •X’ •Y + XY’ + A•Y’ = A’X’Y + A+X Y’
Design and Synthesis
of Sequential Circuits
D X = AY + A’XY’
D Y = Y’ + A’X
Logic Diagram of the Sequential Circuit