Synchronous Sequential Logic
Synchronous Sequential Logic
O U TLI N E O F CH APTER 5
Design Procedure
4
SEQ U EN TI AL CI RCU I TS
• Every digital system is likely to have combinational circuits.
• Most systems encountered in practice also include storage
elements, which require that the system be described in terms
of sequential logic.
Inputs Outputs
Combinational
Circuit
Memory
Elements
5
SEQ U EN TI AL CI RCU I TS
• The storage elements are devices capable of storing binary
information.
• The binary information stored in these elements at any given
time defines the state of the sequential circuit at that time.
SEQ U EN TI AL CI RCU I TS
• They also determine the condition for changing the state in the
storage elements.
• A sequential circuit is specified by a time sequence of inputs,
output, and internal states.
7
SEQ U EN TI AL CI RCU I TS
• There are two main types of sequential circuits.
Synchronous Asynchronous
Sequential
Circuit
8
SEQ U EN TI AL CI RCU I TS
• Asynchronous Sequential Circuit
Inputs Outputs
Combinational
Circuit
Memory
Elements
– The behaviour of the circuit depends upon the input signals at any
instant of time and the order in which the inputs change.
9
SEQ U EN TI AL CI RCU I TS
• Asynchronous Sequential Circuit
– In gate – type asynchronous systems, the storage elements consist
of logic gates whose propagation delay provides the required
storage.
SEQ U EN TI AL CI RCU I TS
• Synchronous Sequential Circuit
Inputs Outputs
Combinational
Circuit
Flip-flops
Clock
SEQ U EN TI AL CI RCU I TS
• Synchronous Sequential Circuit
– Employs signals that affect the storage elements only at discrete
instants of time.
SEQ U EN TI AL CI RCU I TS
– Circuits that use clock pulses in the inputs of storage elements are
called clocked sequential circuits.
– The storage elements used in clocked sequential circuits are called
flip – flops.
– A flip – flop is a binary storage device capable of storing one bit of
information.
14
LATCH ES
• Latches are the basic circuits from which all flip – flops are
constructed.
• Although latches are useful for storing binary information and
for the design of asynchronous sequential circuits.
LATCH ES Ba sics
NAND gate
NOR gate
15
LATCH ES
• SR Latch
Reset (R) 1 0
Q
NOR gate
Set (S) 0 Q
1
15
LATCH ES
• SR Latch
Reset (R) 0 1
Q
NOR gate
Set (S) 1 Q
0
15
LATCH ES
• SR Latch
Reset (R) 1 0
Q
NOR gate
Set (S) 1 Q
0
Invalid State
15
LATCH ES
• SR Latch
Reset (R) 0 Q
NOR gate
Set (S) 0 Q
Previous state
16
LATCH ES
• SR Latch
SR Q
R Q 0 0 Q0 No change
0 1 0 Reset
1 0 1 Set
S Q 1 1 Q=Q’=0 Invalid
S Q
Q SR
0 0 Q=Q’=1 Invalid
0 1 1 Set
R Q 1 0 0 Reset
1 1 Q0 No change
17
LATCH ES
• SR Latch with Control Input
R R S S
Q Q
C C
R Q
S Q R
S
C S R Q
0 X X HOLD No change
1 0 0 HOLD No change
1 0 1 Q=0 Reset
1 1 0 Q=1 Set
Invalid
1 1 1 Q = Q’
18
LATCH ES
• D Latch (D = Data)
– One way to eliminate the undesirable condition of the indeterminate
state in the SR- latch is to ensure that inputs S and R are never equal
to 1 at the same time.
• C (control)
20
LATCH ES
• D Latch (D = Data)
D S
Q
C
R Q
C D Q
0 X HOLD No change
1 0 Q=0 Reset
1 1 Q=1 Set
21
LATCH ES
• D Latch (D = Data)
– The D latch has an ability to hold data in its internal storage.
FLI P – FLO PS
• Flip – flops are constructed in such a way to make D latches operate
properly when they are part of a sequential circuit that employs a
common clock.
FLI P – FLO PS
• Controlled latches are level – triggered
FLI P – FLO PS
• There are two ways that a latch can be modified to form a flip –
flop.
1. Employ two latches in a special configuration that
• isolates the output of the flip – flop from being affected while its input is
changing.
FLI P – FLO PS
• Master – Slave D flip – flops
D D Q D Q Q
D Latch D Latch
(M aster) (Slave)
C C
M aster Slave
CLK
CL
FLI P – FLO PS
• Edge-Triggered D Flip – Flop • Two latches respond to the
external D (data) and CLK (clock
inputs).
S
Q • Third latch provides the outputs
CLK for the flip – flop.
R
Q
D
28
FLI P – FLO PS
• Edge-Triggered D Flip – Flop I. When CLK = 0, S = 1 and R =
1.Output = present state.
Q 1. R changes to 0
CLK 2. Flip – flop goes to the RESET
R
Q state.
3. Q = 0.
D
29
FLI P – FLO PS
• Edge-Triggered D Flip – Flop III. If D changes when CLK = 1 then
1. R remains at 0.
2. Flip – flop is locked out
S
3. Unresponsive to further changes
Q in the input.
CLK
R IV. When CLK à 0,
Q
1. R à 1
2. Placing the output latch in the
quiescent condition.
D
3. No change in the output.
30
FLI P – FLO PS
• Edge-Triggered D Flip – Flop V. If D = 1 when CLK = 0 à 1,
1. S changes to 0.
Q 3. Q = 1.
CLK 4. Any change in D while CLK = 1
R
Q does not affect the output.
D
31
FLI P – FLO PS
• Edge-Triggered D Flip – Flop • When CLK in the positive-edge-
triggered flip – flop
– Makes positive transition
S
• The value of D is transferred
Q
to Q.
CLK
R – Makes negative transition
Q
• Does not affect the output.
– Steady CLK 1 or 0
D • Does not affect the output.
32
FLI P – FLO PS
• Edge-Triggered D Flip – Flop
– The timing of the response of a flip – flop to input data and clock
must be taken into consideration when using edge – triggered flip -
flops.
• There is a minimum time, called setup time, for which the D input must
be maintained at a constant value prior to the occurrence of the clock
transition.
• There is a minimum time, called hold time, for which the D input must
not change after the application of the positive transition of the clock.
33
FLI P – FLO PS
• Edge-Triggered D Flip – Flop
D Q
Q
Q Positive Edge
CLK Dynamic
Q input
D Q
Q
D
Negative Edge
34
FLI P – FLO PS
• The most economical and efficient flip – flop constructed is the
edge – triggered D flip – flop.
– It requires smallest number of gates.
• Other types of flip – flops can be constructed by using the D flip –
flop and external logic.
– JKflip – flops
– T flip - flops
35
FLI P – FLO PS
• There are three operations that can be performed with a flip –
flop:
– Set it to 1
– Reset it to 0
FLI P – FLO PS
• JK Flip – Flop • When J= 1, sets the flip – flop
– Performs all three operations. to 1.
• When K = 1, resets the flip –
J
D Q Q flop to 0.
K
CLK Q Q
D = JQ’ + K’Q
37
FLI P – FLO PS
• JK Flip – Flop Operation 1
• When J= 1 and K = 0,
– D = 1.Q’ + 1.Q (Post2b)
J
D Q Q – D = Q’ + Q (Post5a)
K
CLK Q Q
– D=1
– Next clock edge sets the output
to 1.
D = JQ’ + K’Q
38
FLI P – FLO PS
• JK Flip – Flop Operation 2
• When J= 0 and K = 1,
– D = 0.Q’ + 0.Q (Theo2b)
J
D Q Q – D=0+0
K
CLK Q Q
– D=0
– Next clock edge sets the output
to 0.
D = JQ’ + K’Q
39
FLI P – FLO PS
• JK Flip – Flop Operation 3
• When J= 1 and K = 1,
– D = 1.Q’ + 0.Q (Post2b)
J
– D = Q’ + 0 .Q (Theo2b)
D Q Q
K
– D = Q’ + 0 (Post2a)
CLK Q Q
– D = Q’
FLI P – FLO PS
• JK Flip – Flop • When J= 0 and K = 0,
– D = 0.Q’ + 1.Q (Theo2b)
– D = 0 + 1 .Q (Post2b)
J – D=0+Q (Post2a)
D Q Q
K
– D=Q
CLK Q Q
– Next clock edge the output is
unchanged.
D = JQ’ + K’Q
41
FLI P – FLO PS
• JK Flip – Flop
J J Q
D Q Q
K
CLK Q Q
K Q
D = JQ’ + K’Q
42
FLI P – FLO PS
• T (toggle) Flip – Flop
– Complementing flip – flop.
– Can be obtained from a JK T J Q
flip – flop. C
– When inputs Jand K are tied K Q
together.
– Useful for designing binary D = JQ’ + K’Q
counters. D = TQ’ + T’Q = T Å Q
43
FLI P – FLO PS
• T (toggle) Flip – Flop
– When T = 0 (J= K = 0)
– A clock edge does not T J Q
change the output. C
– When T = 1 (J= K = 1) K Q
– A clock edge complements
the output. D = JQ’ + K’Q
D = TQ’ + T’Q = T Å Q
44
FLI P – FLO PS
• T (toggle) Flip – Flop
– Can be constructed with a D
flip – flop and an XOR gate.
D Q
– When T = 0 then D = Q T
• No change in the output.
C Q
– When T = 1 then D = Q’
• Output complements D = TQ’ + T’Q = T Å Q
45
FLI P – FLO PS
• T (toggle) Flip – Flop
T J Q
D Q T Q
T
C
K Q C Q C Q
(a) From JKFlip – Flop (b) From D Flip – Flop (c) Graphic Symbol
46
FLI P – FLO PS
• Flip – Flop Characteristics Table
D Q D Q (t+1)
0 0 Reset
1 1 Set
Q
Q(t+1) = D
47
FLI P – FLO PS
• Flip – Flop Characteristics Table
J K Q (t+1)
J Q 0 0 Q(t) No change
0 1 0 Reset
1 0 1 Set
K Q
1 1 Q’(t) Toggle
FLI P – FLO PS
• Flip – Flop Characteristics Table
T Q T Q (t+1)
0 Q(t) No change
1 Q’(t) Toggle
Q
Q(t+1) = T Q
49
FLI P – FLO PS
• Some flip – flops have asynchronous inputs that are used to
force the flip – flop to a particular state independent of the
clock.
FLI P – FLO PS
• When power is on in a digital system, the state of the flip flop is
unknown.
• The direct inputs are useful for bringing all flip – flops in the
system to a known starting state prior to the clocked operation.
51
FLI P – FLO PS
• Asynchronous Reset
D Q R’ D CLK Q(t+1)
0 x x 0
Q
R
Reset
52
FLI P – FLO PS
• Asynchronous Reset
D Q R’ D CLK Q(t+1)
0 x x 0
Q 1 0 ↑ 0
1 1 ↑ 1
R
Reset
53
FLI P – FLO PS
• Asynchronous Preset and Clear
Preset
D Q 1 0 x x 0
Q
CLR
Reset
23 Decem ber , 2016
54
FLI P – FLO PS
• Asynchronous Preset and Clear
Preset
PR’ CLR’ D CLK Q(t+1)
PR
D Q 1 0 x x 0
0 1 x x 1
Q
CLR
Reset
55
FLI P – FLO PS
• Asynchronous Preset and Clear
Preset
PR’ CLR’ D CLK Q(t+1)
PR
D Q 1 0 x x 0
0 1 x x 1
Q 1 1 0 ↑ 0
CLR 1 1 1 ↑ 1
Reset
2
57
– The outputs
• Outputs
• Internal states
– It is also possible to write Boolean expression that describe the
behaviour of the sequential circuit.
59
State Equations
• The behaviour of a clocked sequential circuit can be described
algebraically by means of state equations (transition equations).
Q – An output y.
– It is possible to write a set of
D Q B equations for the circuit.
CLK Q
y
61
x
• B(t+1) = A’(t) . x(t)
D Q A
– Since all the variables in the
Q A’ Boolean expression are a
function of the present state
D Q B
– We can omit the designation (t)
CLK Q B’
• A(t+1) = A . x + B . x
y
• B(t+1) = A’ . x
63
Consider: • Similarly,
D Q B
CLK Q B’
y
64
Consider: • A(t+1) = A . x + B . x
• B(t+1) = A’ . x
x
D Q A
• y = (A + B) x’
Q A’
D Q B
CLK Q B’
y
65
State Table
• The time sequence of inputs, outputs and flip – flop can be enumerated
in state table (transition table).
0 1 1 0 1 0 Q A’
1 0 0 0 0 1
D Q B
1 0 1 1 0 0
CLK Q B’
1 1 0 0 0 1
y
1 1 1 1 0 0
67
11 00 10 1 0 D Q B
CLK Q B’
y
68
State Diagram
• The information available in a state table can be represented graphically
in the form of a state diagram.
State Diagram 0/ 0 1/ 0
Present Next State
Output
State (t+1) 0/ 1
(t) x=0 x=1 x=0 x=1
AB AB AB y y 00 10
00 00 01 0 0
0/ 1
01 00 11 1 0
1/ 0 0/ 1 1/ 0
10 00 10 1 0
11 00 10 1 0
01 11
AB input/output
1/ 0
77
• Sequential circuits are divided into two (they differ in the way output is
generated:
– Mealy model
– Moore model
78
• Mealy model:
– The output is a function of both the present state and input.
– The outputs may change if the inputs change during the clock pulse period.
• The outputs may have momentary false values unless the inputs are
synchronized with the clocks.
Moore Machine
0/ 0 0/ 0
• There are infinite number of b c
1/0
input sequence that may be 1/ 0
– 01010110100 a
0/ 0 0/ 0
– Starting from the initial state a. 1/ 0
0/ 0 0/ 0
– Each input of 0/1 produces an b c
– 01010110100 a
0/0 0/0
1/0
0/0
state
a a b c d e f f g f g a 0/0 b c
1/0
1/ 0
input
0 1 0 1 0 1 1 0 1 0 0 0/0
g d e
1/1 1/1
outpu
0 0 0 0 0 1 1 0 1 0 0 0/0 1/1
f
t
1/ 1
88
a
– Draw a state table 0/0 0/0
Next state Output 1/0
0/0 0/0
Present state x=0 x=1 x=0 x=1 b c
a a b 0 0 1/0
1/0
b c d 0 0
0/0
c a d 0 0 g d e
d 1/1 1/1
e f 0 1
e 0/0 1/1
a f 0 1
f
f g f 0 1
1/1
g a f 0 1
91
sequence.
94
e d
a d 0 1
1/ 1
95
– The states that are not equivalent are marked with a ‘x’ in the corresponding
square, whereas their equivalence is recorded with a ‘√’.
101
2. Enter in the remaining squares the pairs of states that are implied by the pair of states
representing the squares. We do that by starting from the top square in the left
column and going down and then proceeding with the next column to the right.
102
4.Finally, all the squares that have no crosses are recorded with check marks.
The equivalent states are: (a, b), (d, e), (d, g), (e, g).
103
– For a circuit with m states, the codes must contain n bits where 2n =
≥ m.
– Ex: with 3 bits it is possible to assign codes to 8 states denoted by
binary numbers 000 trough 111.
105
– If the state table2 is used, only five states need binary assignment.
• Remaining 3 state is unused.
• Unused states treated as don’t care conditions.
• Since don’t care conditions usually help in obtaining a simpler circuit, it is
more likely that the circuit with five states will require fewer
combinational gates than the one with seven states.
106
0 1
0
S3 / 1 S2 / 0
1
1
112
0 0 0 1 0 1 0
0 1 0 0 0 0
0 1
0 0 1 1 1 0 0
1 0 0 0 0 0
S3 / 1 S2 / 0 1 0 1 1 1 0
1
1 1 1 0 0 0 1
1 1 1 1 1 1
114
minterms. 0 1 1 1 0 0
1 0 0 0 0 0
– A(t+1) = DA(A,B,x) = ∑ (3, 5, 7)
1 0 1 1 1 0
– B(t+1) = DB(A,B,x) = ∑ (1, 5, 7) 1 1 0 0 0 1
– y(A,B,x) = ∑ (6, 7) 1 1 1 1 1 1
11
6
DA = Ax + Bx
11
7
DA = Ax + B’x
11
8
m4 m5 m7 M6
A 1
1 1
y = AB
11
9
D Q B
CLK Q
120
• For this reason, we need a table that lists the required inputs for a given
change of state. Such table is called an excitation table.
122
1 1 0 1 1
1 0 0
Q(t+1) = D
1 1 1
123
0 Q(t) 0 0 0
1 Q’(t) 0 1 1
1 0 1
Q(t+1) = T Q 1 1 0
125
0 1
S0 / 0 S1 / 0
0
0 1
0
S3 / 1 S2 / 0
1
1
126
JA = Bx
12
8
KA = x’
12
9
JB = x
13
0
KB = A’+ x’
13
1
– JB = x
x K Q y
– KB = A’ + x’
J Q B
K Q
CLK
132
110 010
101 011
100
133
A0
TA2 = A1A0
13
5
A0
TA1 = A0
13
6
A0
TA0 = 1
13
7
– TA1 = A0 Q
– TA0 = 1
T Q A1
1 T Q A0
CLK