Digital Logic
Chapter 5
2 / 60
Sequential Circuits
Combinational
Circuit
Memory
Elements
Inputs Outputs
• Asynchronous
• Synchronous
Combinational
Circuit
Flip-flops
Inputs Outputs
Clock
06:23 PM
3 / 60
Latches
• SR Latch
R
S
Q
Q
S R Q0 Q Q’
0 0 0
0
1
0
0
0 1 Q = Q0
Initial Value
06:23 PM
4 / 60
Latches
• SR Latch
R
S
Q
Q
S R Q0 Q Q’
0 0 0 0 1
0 0 1
1
0
0
0
1 0 Q = Q0
Q = Q0
06:23 PM
5 / 60
Latches
• SR Latch
R
S
Q
Q
S R Q0 Q Q’
0 0 0 0 1
0 0 1 1 0
0 1 0 0
0
1
1
0
1 Q = 0
Q = Q0
06:23 PM
6 / 60
Latches
• SR Latch
R
S
Q
Q
S R Q0 Q Q’
0 0 0 0 1
0 0 1 1 0
0 1 0 0 1
0 1 1
1
0
1
0
0 1
Q = 0
Q = Q0
Q = 0
06:23 PM
7 / 60
Latches
• SR Latch
R
S
Q
Q
S R Q0 Q Q’
0 0 0 0 1
0 0 1 1 0
0 1 0 0 1
0 1 1 0 1
1 0 0
0
1
0
1
1 0
Q = 0
Q = Q0
Q = 1
06:23 PM
8 / 60
Latches
• SR Latch
R
S
Q
Q
S R Q0 Q Q’
0 0 0 0 1
0 0 1 1 0
0 1 0 0 1
0 1 1 0 1
1 0 0 1 0
1 0 1
1
0
0
1
1 0
Q = 0
Q = Q0
Q = 1
Q = 1
06:23 PM
9 / 60
Latches
• SR Latch
R
S
Q
Q
S R Q0 Q Q’
0 0 0 0 1
0 0 1 1 0
0 1 0 0 1
0 1 1 0 1
1 0 0 1 0
1 0 1 1 0
1 1 0
0
1
1
1
0 0
Q = 0
Q = Q0
Q = 1
Q = Q’
0
06:23 PM
10 / 60
Latches
• SR Latch
R
S
Q
Q
S R Q0 Q Q’
0 0 0 0 1
0 0 1 1 0
0 1 0 0 1
0 1 1 0 1
1 0 0 1 0
1 0 1 1 0
1 1 0 0 0
1 1 1
1
0
1
1
0 0
Q = 0
Q = Q0
Q = 1
Q = Q’
0
Q = Q’
06:23 PM
11 / 60
Latches
• SR Latch
R
S
Q
Q
S R Q
0 0 Q0
0 1 0
1 0 1
1 1 Q=Q’=0
No change
Reset
Set
Invalid
S
R
Q
Q
S R Q
0 0 Q=Q’=1
0 1 1
1 0 0
1 1 Q0
Invalid
Set
Reset
No change
06:23 PM
12 / 60
Latches
• SR Latch
R
S
Q
Q
S R Q
0 0 Q0
0 1 0
1 0 1
1 1 Q=Q’=0
No change
Reset
Set
Invalid
S’ R’ Q
0 0 Q=Q’=1
0 1 1
1 0 0
1 1 Q0
Invalid
Set
Reset
No change
S
R
Q
Q
06:23 PM
13 / 60
Controlled Latches
• SR Latch with Control Input
C S R Q
0 x x Q0
1 0 0 Q0
1 0 1 0
1 1 0 1
1 1 1 Q=Q’
No change
No change
Reset
Set
Invalid
S
R
Q
Q
S
R
C
S
R
Q
Q
S
R
C
06:23 PM
14 / 60
Controlled Latches
• D Latch (D = Data)
C D Q
0 x Q0
1 0 0
1 1 1
No change
Reset
Set
S
R
Q
Q
D
C
C
Timing Diagram
D
Q
t
Output may
change
06:23 PM
15 / 60
Controlled Latches
• D Latch (D = Data)
C D Q
0 x Q0
1 0 0
1 1 1
No change
Reset
Set
C
Timing Diagram
D
Q
Output may
change
S
R
Q
Q
D
C
06:23 PM
16 / 60
Flip-Flops
• Controlled latches are level-triggered
• Flip-Flops are edge-triggered
C
CLK Positive Edge
CLK Negative Edge
06:23 PM
17 / 60
Flip-Flops
• Master-Slave D Flip-Flop
D Latch
(Master)
D
C
Q
D Latch
(Slave)
D
C
Q Q
D
CLK
CLK
D
QMaster
QSlave
Looks like it is negative
edge-triggered
Master Slave
06:23 PM
18 / 60
Flip-Flops
• Edge-Triggered D Flip-Flop
D
CLK
Q
Q
D Q
Q
D Q
Q
Positive Edge
Negative Edge
06:23 PM
19 / 60
Flip-Flops
• JK Flip-Flop
D Q
Q
Q
Q
CLK
J
K
J Q
Q
K
D = JQ’ + K’Q
06:23 PM
20 / 60
Flip-Flops
• T Flip-Flop
D = TQ’ + T’Q = T 
Q
J Q
Q
K
T D Q
Q
T
D = JQ’ + K’Q
T Q
Q
06:23 PM
21 / 60
Flip-Flop Characteristic Tables
D Q
Q
D Q(t+1)
0 0
1 1
Reset
Set
J K Q(t+1)
0 0 Q(t)
0 1 0
1 0 1
1 1 Q’(t)
No change
Reset
Set
Toggle
J Q
Q
K
T Q
Q
T Q(t+1)
0 Q(t)
1 Q’(t)
No change
Toggle
06:23 PM
22 / 60
Flip-Flop Characteristic Equations
D Q
Q
D Q(t+1)
0 0
1 1
Q(t+1) = D
J K Q(t+1)
0 0 Q(t)
0 1 0
1 0 1
1 1 Q’(t)
Q(t+1) = JQ’+ K’Q
J Q
Q
K
T Q
Q
T Q(t+1)
0 Q(t)
1 Q’(t)
Q(t+1) = T  Q
06:23 PM
23 / 60
Flip-Flop Characteristic Equations
• Analysis / Derivation
J Q
Q
K
J K Q(t) Q(t+1)
0 0 0 0
0 0 1 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
No change
Reset
Set
Toggle
06:23 PM
24 / 60
Flip-Flop Characteristic Equations
• Analysis / Derivation
J Q
Q
K
J K Q(t) Q(t+1)
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0
1 0 1
1 1 0
1 1 1
No change
Reset
Set
Toggle
06:23 PM
25 / 60
Flip-Flop Characteristic Equations
• Analysis / Derivation
J Q
Q
K
J K Q(t) Q(t+1)
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0
1 1 1
No change
Reset
Set
Toggle
06:23 PM
26 / 60
Flip-Flop Characteristic Equations
• Analysis / Derivation
J Q
Q
K
J K Q(t) Q(t+1)
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0
No change
Reset
Set
Toggle
06:23 PM
27 / 60
Flip-Flop Characteristic Equations
• Analysis / Derivation
J Q
Q
K
J K Q(t) Q(t+1)
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0
K
0 1 0 0
J 1 1 0 1
Q
Q(t+1) = JQ’+ K’Q
06:23 PM
28 / 60
Flip-Flops with Direct Inputs
• Asynchronous Reset
D Q
Q
R
Reset
R’ D CLK Q(t+1)
0 x x 0
06:23 PM
29 / 60
Flip-Flops with Direct Inputs
• Asynchronous Reset
D Q
Q
R
Reset
R’ D CLK Q(t+1)
0 x x 0
1 0 ↑ 0
1 1 ↑ 1
06:23 PM
30 / 60
Flip-Flops with Direct Inputs
• Asynchronous Preset and Clear
PR’ CLR’ D CLK Q(t+1)
1 0 x x 0
D Q
Q
CLR
Reset
PR
Preset
06:23 PM
31 / 60
Flip-Flops with Direct Inputs
• Asynchronous Preset and Clear
PR’ CLR’ D CLK Q(t+1)
1 0 x x 0
0 1 x x 1
D Q
Q
CLR
Reset
PR
Preset
06:23 PM
32 / 60
Flip-Flops with Direct Inputs
• Asynchronous Preset and Clear
PR’ CLR’ D CLK Q(t+1)
1 0 x x 0
0 1 x x 1
1 1 0 ↑ 0
1 1 1 ↑ 1
D Q
Q
CLR
Reset
PR
Preset
06:23 PM
33 / 60
Analysis of Clocked Sequential
Circuits
• The State
– State = Values of all Flip-Flops
Example
A B = 0 0
D Q
Q
CLK
D Q
Q
A
B
y
x
06:23 PM
34 / 60
Analysis of Clocked Sequential
Circuits
• State Equations
D Q
Q
CLK
D Q
Q
A
B
y
x
A(t+1) = DA
= A(t) x(t)+B(t) x(t)
= A x + B x
B(t+1) = DB
= A’(t) x(t)
= A’ x
y(t) = [A(t)+ B(t)] x’(t)
= (A + B) x’
06:23 PM
35 / 60
Analysis of Clocked Sequential
Circuits
• State Table (Transition Table)
D Q
Q
CLK
D Q
Q
A
B
y
x
A(t+1) = A x + B x
B(t+1) = A’ x
y(t) = (A + B) x’
Present
State
Input
Next
State
Output
A B x A B y
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
t+1 t
t
0 0 0
0 1 0
0 0 1
1 1 0
0 0 1
1 0 0
0 0 1
1 0 0
06:23 PM
36 / 60
Analysis of Clocked Sequential
Circuits
• State Table (Transition Table)
D Q
Q
CLK
D Q
Q
A
B
y
x
A(t+1) = A x + B x
B(t+1) = A’ x
y(t) = (A + B) x’
Present
State
Next State Output
x = 0 x = 1 x = 0 x = 1
A B A B A B y y
0 0 0 0 0 1 0 0
0 1 0 0 1 1 1 0
1 0 0 0 1 0 1 0
1 1 0 0 1 0 1 0
t+1 t
t
06:23 PM
Analysis of Clocked Sequential
Circuits
Present
State
Next State Output
x = 0 x = 1 x = 0 x = 1
A B A B A B y y
0 0 0 0 0 1 0 0
0 1 0 0 1 1 1 0
1 0 0 0 1 0 1 0
1 1 0 0 1 0 1 0
37 / 60
• State Diagram
D Q
Q
CLK
D Q
Q
A
B
y
x
0 0 1 0
0 1 1 1
0/0
0/1
1/0
1/0
1/0
1/0 0/1
0/1
AB input/output
06:23 PM
38 / 60
Analysis of Clocked Sequential
Circuits
• D Flip-Flops
Example: D Q
Q
x
CLK
y
A
Present
State
Input
Next
State
A x y A
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
0
1
1
0
1
0
0
1
0 1
00,11 00,11
01,10
01,10
A(t+1) = DA = A  x  y
06:23 PM
39 / 60
Analysis of Clocked Sequential
Circuits
• JK Flip-Flops
Example:
J Q
Q
K
CLK
J Q
Q
K
x
A
B
JA = B KA = B x’
JB = x’ KB = A 
x
A(t+1) = JA Q’A + K’A QA
= A’B + AB’+ Ax
B(t+1) = JB Q’B + K’B QB
= B’x’+ ABx + A’Bx’
Present
State
I/P
Next
State
Flip-Flop
Inputs
A B x A B JA KA JB KB
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
0 0 1 0
0 0 0 1
1 1 1 0
1 0 0 1
0 0 1 1
0 0 0 0
1 1 1 1
1 0 0 0
0 1
0 0
1 1
1 0
1 1
1 0
0 0
1 1
06:23 PM
40 / 60
Analysis of Clocked Sequential
Circuits
• JK Flip-Flops
Example:
J Q
Q
K
CLK
J Q
Q
K
x
A
B
Present
State
I/P
Next
State
Flip-Flop
Inputs
A B x A B JA KA JB KB
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
0 0 1 0
0 0 0 1
1 1 1 0
1 0 0 1
0 0 1 1
0 0 0 0
1 1 1 1
1 0 0 0
0 1
0 0
1 1
1 0
1 1
1 0
0 0
1 1
0 0 1 1
0 1 1 0
1 0 1
0
1
0
0
1
06:23 PM
41 / 60
Analysis of Clocked Sequential
Circuits
• T Flip-Flops
Example:
TA = B x TB = x
y = A B
A(t+1) = TA Q’A + T’A QA
= AB’+ Ax’+ A’Bx
B(t+1) = TB Q’B + T’B QB
= x  B
A
B
T Q
Q
R
T Q
Q
R
CLK Reset
x
y
Present
State
I/P
Next
State
F.F
Inputs
O/P
A B x A B TA TB y
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
0 0
0 1
0 0
1 1
0 0
0 1
0 0
1 1
0 0
0 1
0 1
1 0
1 0
1 1
1 1
0 0
0
0
0
0
0
0
1
1
06:23 PM
42 / 60
Analysis of Clocked Sequential
Circuits
• T Flip-Flops
Example:
A
B
T Q
Q
R
T Q
Q
R
CLK Reset
x
y
Present
State
I/P
Next
State
F.F
Inputs
O/P
A B x A B TA TB y
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
0 0
0 1
0 0
1 1
0 0
0 1
0 0
1 1
0 0
0 1
0 1
1 0
1 0
1 1
1 1
0 0
0
0
0
0
0
0
1
1
0 0 0 1
1 1 1 0
0/0
1/0
0/0
1/0
1/0
1/1
0/0
0/1
06:23 PM
43 / 60
Mealy and Moore Models
Present
State
I/P
Next
State
O/P
A B x A B y
0 0 0 0 0 0
0 0 1 0 1 0
0 1 0 0 0 1
0 1 1 1 1 0
1 0 0 0 0 1
1 0 1 1 0 0
1 1 0 0 0 1
1 1 1 1 0 0
Mealy
For the same state,
the output changes with the input
Present
State
I/P
Next
State
O/P
A B x A B y
0 0 0 0 0 0
0 0 1 0 1 0
0 1 0 0 1 0
0 1 1 1 0 0
1 0 0 1 0 0
1 0 1 1 1 0
1 1 0 1 1 1
1 1 1 0 0 1
Moore
For the same state,
the output does not change with the input
06:23 PM
44 / 60
Moore State Diagram
State / Output
0 0 / 0 0 1 / 0
1 1 / 1 1 0 / 0
0
1
1
1
0
0
0
1
06:23 PM
45 / 60
Timing Diagram
0 0 / 0 0 1 / 0
1 1 / 1 1 0 / 0
0 0
1
1
0 0
1
1
CLK
State
A
B
y
x
No effect
0
0
0
1
1
0
0
0
0
1
0
1
A
B
x y
06:23 PM
46 / 60
Timing Diagram
0 0 0 1
1 1 1 0
0/0 0/0
1/0
1/1
0/0 0/0
1/1
1/0
CLK
State
A
B
y
x
1
0
A
B
x y
06:23 PM
47 / 60
Design of Clocked Sequential
Circuits
• Example:
Detect 3 or more consecutive 1’s
S0 / 0 S1 / 0
S3 / 1 S2 / 0
0
1
1
0
0
1
0
1
State A B
S0 0 0
S1 0 1
S2 1 0
S3 1 1
06:23 PM
48 / 60
Design of Clocked Sequential
Circuits
• Example:
Detect 3 or more consecutive 1’s
Present
State
Input
Next
State
Output
A B x A B y
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
0 0 0
0 1 0
0 0 0
1 0 0
0 0 0
1 1 0
0 0 1
1 1 1
S0 / 0 S1 / 0
S3 / 1 S2 / 0
0
1
1
0 0
1
0
1
06:23 PM
49 / 60
Design of Clocked Sequential
Circuits
• Example:
Detect 3 or more consecutive 1’s
Present
State
Input
Next
State
Output
A B x A B y
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
0 0 0
0 1 0
0 0 0
1 0 0
0 0 0
1 1 0
0 0 1
1 1 1
A(t+1) = DA (A, B, x)
= ∑ (3, 5, 7)
B(t+1) = DB (A, B, x)
= ∑ (1, 5, 7)
y(A, B, x) = ∑ (6, 7)
Synthesis using D Flip-Flops
06:23 PM
50 / 60
Design of Clocked Sequential
Circuits with D F.F.
• Example:
Detect 3 or more consecutive 1’s
DA (A, B, x) = ∑ (3, 5, 7)
= A x + B x
DB (A, B, x) = ∑ (1, 5, 7)
= A x + B’x
y(A, B, x) = ∑ (6, 7)
= A B
Synthesis using D Flip-Flops
B
0 0 1 0
A 0 1 1 0
x
B
0 1 0 0
A 0 1 1 0
x
B
0 0 0 0
A 0 0 1 1
x
06:23 PM
51 / 60
Design of Clocked Sequential
Circuits with D F.F.
• Example:
Detect 3 or more consecutive 1’s
DA = A x + B x
DB = A x + B’x
y = A B
Synthesis using D Flip-Flops
D Q
Q
A
CLK
x
B
D Q
Q
y
06:23 PM
52 / 60
Flip-Flop Excitation Tables
Present
State
Next
State
F.F.
Input
Q(t) Q(t+1) D
0 0
0 1
1 0
1 1
Present
State
Next
State
F.F.
Input
Q(t) Q(t+1) J K
0 0
0 1
1 0
1 1
0 0 (No change)
0 1 (Reset)
0 x
1 x
x 1
x 0
0
1
0
1
1 0 (Set)
1 1 (Toggle)
0 1 (Reset)
1 1 (Toggle)
0 0 (No change)
1 0 (Set)
Q(t) Q(t+1) T
0 0
0 1
1 0
1 1
0
1
1
0
06:23 PM
53 / 60
Design of Clocked Sequential
Circuits with JK F.F.
• Example:
Detect 3 or more consecutive 1’s
Present
State
Input
Next
State
Flip-Flop
Inputs
A B x A B JA KA JB KB
0 0 0 0 0
0 0 1 0 1
0 1 0 0 0
0 1 1 1 0
1 0 0 0 0
1 0 1 1 1
1 1 0 0 0
1 1 1 1 1
0 x
0 x
0 x
1 x
x 1
x 0
x 1
x 0
JA (A, B, x) = ∑ (3)
dJA (A, B, x) = ∑ (4,5,6,7)
KA (A, B, x) = ∑ (4, 6)
dKA (A, B, x) = ∑ (0,1,2,3)
JB (A, B, x) = ∑ (1, 5)
dJB (A, B, x) = ∑ (2,3,6,7)
KB (A, B, x) = ∑ (2, 3, 6)
dKB (A, B, x) = ∑ (0,1,4,5)
Synthesis using JK F.F.
0 x
1 x
x 1
x 1
0 x
1 x
x 1
x 0
06:23 PM
54 / 60
Design of Clocked Sequential
Circuits with JK F.F.
• Example:
Detect 3 or more consecutive 1’s
JA = B x KA = x’
JB = x KB = A’ + x’
Synthesis using JK Flip-Flops
B
0 0 1 0
A x x x x
x
B
x x x x
A 1 0 0 1
x
B
0 1 x x
A 0 1 x x
x
B
x x 1 1
A x x 0 1
x
CLK
J Q
Q
K
x
A
B
J Q
Q
K y
06:23 PM
55 / 60
Design of Clocked Sequential
Circuits with T F.F.
• Example:
Detect 3 or more consecutive 1’s
Present
State
Input
Next
State
F.F.
Input
A B x A B TA TB
0 0 0 0 0
0 0 1 0 1
0 1 0 0 0
0 1 1 1 0
1 0 0 0 0
1 0 1 1 1
1 1 0 0 0
1 1 1 1 1
0
0
0
1
1
0
1
0
Synthesis using T Flip-Flops
0
1
1
1
0
1
1
0
TA (A, B, x) = ∑ (3, 4, 6)
TB (A, B, x) = ∑ (1, 2, 3, 5, 6)
06:23 PM
56 / 60
Design of Clocked Sequential
Circuits with T F.F.
• Example:
Detect 3 or more consecutive 1’s
TA = A x’ + A’B x
TB = A’B + B  x
Synthesis using T Flip-Flops
B
0 0 1 0
A 1 0 0 1
x
B
0 1 1 1
A 0 1 0 1
x
A
B
y
T Q
Q
x
CLK
T Q
Q
06:23 PM
57 / 60
Homework
• Mano
– Chapter 5
• 5-1
• 5-3
• 5-6
• 5-8
• 5-9
06:23 PM
58 / 60
Homework
5-1 The D latch is constructed with four NAND gates and an
inverter. Consider the following three other ways for
obtaining a D latch. In each case, draw the logic diagram
and verify the circuit operation.
(a) Use NOR gates for the SR latch part and AND gates
for the other two. An inverter may be needed.
(b) Use NOR gates for all four gates. Inverters may be
needed.
(c) Use four NAND gates only (without an inverter). This
can be done by connecting the output of the upper gate
that goes to the SR latch to the input of the lower gate
instead of the inverter output.
06:23 PM
59 / 60
Homework
5-3 Show that the characteristic equation for the complement
output of a JK flip-flop is
Q’(t+1) = J’Q + K Q
5-6 A sequential circuit with two D flip-flops, A and B; two
inputs, x and y; and one output, z, is specified by the
following next-state and output equations:
A(t+1) = x’ y + x A
B(t+1) = x’ B + x A
z = B
(a) Draw the logic diagram of the circuit.
(b) List the state table for the sequential circuit.
(c) Draw the corresponding state diagram.
06:23 PM
60 / 60
Homework
5-8 Derive the state table and the state diagram of the
sequential shown circuit. Explain the function that the
circuit performs.
A B
CLK
T
Q Q
T
Q Q
06:23 PM
61 / 60
Homework
5-9 A sequential circuit has two JK flip-flops A and B and one
input x. The circuit is described by the following flip-flop
input equations:
JA = x KA = B’
JB = x KB = A
(a) Derive the state equations A(t+1) and B(t+1) by
substituting the input equations for the J and K
variables.
(b) Draw the state diagram of the circuit.
06:23 PM

Chwqeweqweqweqweqweqweqweqeqweapter 5.pptx

  • 1.
  • 2.
    2 / 60 SequentialCircuits Combinational Circuit Memory Elements Inputs Outputs • Asynchronous • Synchronous Combinational Circuit Flip-flops Inputs Outputs Clock 06:23 PM
  • 3.
    3 / 60 Latches •SR Latch R S Q Q S R Q0 Q Q’ 0 0 0 0 1 0 0 0 1 Q = Q0 Initial Value 06:23 PM
  • 4.
    4 / 60 Latches •SR Latch R S Q Q S R Q0 Q Q’ 0 0 0 0 1 0 0 1 1 0 0 0 1 0 Q = Q0 Q = Q0 06:23 PM
  • 5.
    5 / 60 Latches •SR Latch R S Q Q S R Q0 Q Q’ 0 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 1 0 1 Q = 0 Q = Q0 06:23 PM
  • 6.
    6 / 60 Latches •SR Latch R S Q Q S R Q0 Q Q’ 0 0 0 0 1 0 0 1 1 0 0 1 0 0 1 0 1 1 1 0 1 0 0 1 Q = 0 Q = Q0 Q = 0 06:23 PM
  • 7.
    7 / 60 Latches •SR Latch R S Q Q S R Q0 Q Q’ 0 0 0 0 1 0 0 1 1 0 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1 0 1 1 0 Q = 0 Q = Q0 Q = 1 06:23 PM
  • 8.
    8 / 60 Latches •SR Latch R S Q Q S R Q0 Q Q’ 0 0 0 0 1 0 0 1 1 0 0 1 0 0 1 0 1 1 0 1 1 0 0 1 0 1 0 1 1 0 0 1 1 0 Q = 0 Q = Q0 Q = 1 Q = 1 06:23 PM
  • 9.
    9 / 60 Latches •SR Latch R S Q Q S R Q0 Q Q’ 0 0 0 0 1 0 0 1 1 0 0 1 0 0 1 0 1 1 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 1 1 1 0 0 Q = 0 Q = Q0 Q = 1 Q = Q’ 0 06:23 PM
  • 10.
    10 / 60 Latches •SR Latch R S Q Q S R Q0 Q Q’ 0 0 0 0 1 0 0 1 1 0 0 1 0 0 1 0 1 1 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 1 1 0 1 1 0 0 Q = 0 Q = Q0 Q = 1 Q = Q’ 0 Q = Q’ 06:23 PM
  • 11.
    11 / 60 Latches •SR Latch R S Q Q S R Q 0 0 Q0 0 1 0 1 0 1 1 1 Q=Q’=0 No change Reset Set Invalid S R Q Q S R Q 0 0 Q=Q’=1 0 1 1 1 0 0 1 1 Q0 Invalid Set Reset No change 06:23 PM
  • 12.
    12 / 60 Latches •SR Latch R S Q Q S R Q 0 0 Q0 0 1 0 1 0 1 1 1 Q=Q’=0 No change Reset Set Invalid S’ R’ Q 0 0 Q=Q’=1 0 1 1 1 0 0 1 1 Q0 Invalid Set Reset No change S R Q Q 06:23 PM
  • 13.
    13 / 60 ControlledLatches • SR Latch with Control Input C S R Q 0 x x Q0 1 0 0 Q0 1 0 1 0 1 1 0 1 1 1 1 Q=Q’ No change No change Reset Set Invalid S R Q Q S R C S R Q Q S R C 06:23 PM
  • 14.
    14 / 60 ControlledLatches • D Latch (D = Data) C D Q 0 x Q0 1 0 0 1 1 1 No change Reset Set S R Q Q D C C Timing Diagram D Q t Output may change 06:23 PM
  • 15.
    15 / 60 ControlledLatches • D Latch (D = Data) C D Q 0 x Q0 1 0 0 1 1 1 No change Reset Set C Timing Diagram D Q Output may change S R Q Q D C 06:23 PM
  • 16.
    16 / 60 Flip-Flops •Controlled latches are level-triggered • Flip-Flops are edge-triggered C CLK Positive Edge CLK Negative Edge 06:23 PM
  • 17.
    17 / 60 Flip-Flops •Master-Slave D Flip-Flop D Latch (Master) D C Q D Latch (Slave) D C Q Q D CLK CLK D QMaster QSlave Looks like it is negative edge-triggered Master Slave 06:23 PM
  • 18.
    18 / 60 Flip-Flops •Edge-Triggered D Flip-Flop D CLK Q Q D Q Q D Q Q Positive Edge Negative Edge 06:23 PM
  • 19.
    19 / 60 Flip-Flops •JK Flip-Flop D Q Q Q Q CLK J K J Q Q K D = JQ’ + K’Q 06:23 PM
  • 20.
    20 / 60 Flip-Flops •T Flip-Flop D = TQ’ + T’Q = T  Q J Q Q K T D Q Q T D = JQ’ + K’Q T Q Q 06:23 PM
  • 21.
    21 / 60 Flip-FlopCharacteristic Tables D Q Q D Q(t+1) 0 0 1 1 Reset Set J K Q(t+1) 0 0 Q(t) 0 1 0 1 0 1 1 1 Q’(t) No change Reset Set Toggle J Q Q K T Q Q T Q(t+1) 0 Q(t) 1 Q’(t) No change Toggle 06:23 PM
  • 22.
    22 / 60 Flip-FlopCharacteristic Equations D Q Q D Q(t+1) 0 0 1 1 Q(t+1) = D J K Q(t+1) 0 0 Q(t) 0 1 0 1 0 1 1 1 Q’(t) Q(t+1) = JQ’+ K’Q J Q Q K T Q Q T Q(t+1) 0 Q(t) 1 Q’(t) Q(t+1) = T  Q 06:23 PM
  • 23.
    23 / 60 Flip-FlopCharacteristic Equations • Analysis / Derivation J Q Q K J K Q(t) Q(t+1) 0 0 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 No change Reset Set Toggle 06:23 PM
  • 24.
    24 / 60 Flip-FlopCharacteristic Equations • Analysis / Derivation J Q Q K J K Q(t) Q(t+1) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 0 1 1 1 0 1 1 1 No change Reset Set Toggle 06:23 PM
  • 25.
    25 / 60 Flip-FlopCharacteristic Equations • Analysis / Derivation J Q Q K J K Q(t) Q(t+1) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 1 1 1 No change Reset Set Toggle 06:23 PM
  • 26.
    26 / 60 Flip-FlopCharacteristic Equations • Analysis / Derivation J Q Q K J K Q(t) Q(t+1) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 No change Reset Set Toggle 06:23 PM
  • 27.
    27 / 60 Flip-FlopCharacteristic Equations • Analysis / Derivation J Q Q K J K Q(t) Q(t+1) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 K 0 1 0 0 J 1 1 0 1 Q Q(t+1) = JQ’+ K’Q 06:23 PM
  • 28.
    28 / 60 Flip-Flopswith Direct Inputs • Asynchronous Reset D Q Q R Reset R’ D CLK Q(t+1) 0 x x 0 06:23 PM
  • 29.
    29 / 60 Flip-Flopswith Direct Inputs • Asynchronous Reset D Q Q R Reset R’ D CLK Q(t+1) 0 x x 0 1 0 ↑ 0 1 1 ↑ 1 06:23 PM
  • 30.
    30 / 60 Flip-Flopswith Direct Inputs • Asynchronous Preset and Clear PR’ CLR’ D CLK Q(t+1) 1 0 x x 0 D Q Q CLR Reset PR Preset 06:23 PM
  • 31.
    31 / 60 Flip-Flopswith Direct Inputs • Asynchronous Preset and Clear PR’ CLR’ D CLK Q(t+1) 1 0 x x 0 0 1 x x 1 D Q Q CLR Reset PR Preset 06:23 PM
  • 32.
    32 / 60 Flip-Flopswith Direct Inputs • Asynchronous Preset and Clear PR’ CLR’ D CLK Q(t+1) 1 0 x x 0 0 1 x x 1 1 1 0 ↑ 0 1 1 1 ↑ 1 D Q Q CLR Reset PR Preset 06:23 PM
  • 33.
    33 / 60 Analysisof Clocked Sequential Circuits • The State – State = Values of all Flip-Flops Example A B = 0 0 D Q Q CLK D Q Q A B y x 06:23 PM
  • 34.
    34 / 60 Analysisof Clocked Sequential Circuits • State Equations D Q Q CLK D Q Q A B y x A(t+1) = DA = A(t) x(t)+B(t) x(t) = A x + B x B(t+1) = DB = A’(t) x(t) = A’ x y(t) = [A(t)+ B(t)] x’(t) = (A + B) x’ 06:23 PM
  • 35.
    35 / 60 Analysisof Clocked Sequential Circuits • State Table (Transition Table) D Q Q CLK D Q Q A B y x A(t+1) = A x + B x B(t+1) = A’ x y(t) = (A + B) x’ Present State Input Next State Output A B x A B y 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 t+1 t t 0 0 0 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 0 0 1 1 0 0 06:23 PM
  • 36.
    36 / 60 Analysisof Clocked Sequential Circuits • State Table (Transition Table) D Q Q CLK D Q Q A B y x A(t+1) = A x + B x B(t+1) = A’ x y(t) = (A + B) x’ Present State Next State Output x = 0 x = 1 x = 0 x = 1 A B A B A B y y 0 0 0 0 0 1 0 0 0 1 0 0 1 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 0 1 0 t+1 t t 06:23 PM
  • 37.
    Analysis of ClockedSequential Circuits Present State Next State Output x = 0 x = 1 x = 0 x = 1 A B A B A B y y 0 0 0 0 0 1 0 0 0 1 0 0 1 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 0 1 0 37 / 60 • State Diagram D Q Q CLK D Q Q A B y x 0 0 1 0 0 1 1 1 0/0 0/1 1/0 1/0 1/0 1/0 0/1 0/1 AB input/output 06:23 PM
  • 38.
    38 / 60 Analysisof Clocked Sequential Circuits • D Flip-Flops Example: D Q Q x CLK y A Present State Input Next State A x y A 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 1 1 0 1 0 0 1 0 1 00,11 00,11 01,10 01,10 A(t+1) = DA = A  x  y 06:23 PM
  • 39.
    39 / 60 Analysisof Clocked Sequential Circuits • JK Flip-Flops Example: J Q Q K CLK J Q Q K x A B JA = B KA = B x’ JB = x’ KB = A  x A(t+1) = JA Q’A + K’A QA = A’B + AB’+ Ax B(t+1) = JB Q’B + K’B QB = B’x’+ ABx + A’Bx’ Present State I/P Next State Flip-Flop Inputs A B x A B JA KA JB KB 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 1 1 1 1 0 1 0 0 1 0 0 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 1 0 0 1 1 1 0 1 1 1 0 0 0 1 1 06:23 PM
  • 40.
    40 / 60 Analysisof Clocked Sequential Circuits • JK Flip-Flops Example: J Q Q K CLK J Q Q K x A B Present State I/P Next State Flip-Flop Inputs A B x A B JA KA JB KB 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 1 1 1 1 0 1 0 0 1 0 0 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 1 0 0 1 1 1 0 1 1 1 0 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 0 1 0 0 1 06:23 PM
  • 41.
    41 / 60 Analysisof Clocked Sequential Circuits • T Flip-Flops Example: TA = B x TB = x y = A B A(t+1) = TA Q’A + T’A QA = AB’+ Ax’+ A’Bx B(t+1) = TB Q’B + T’B QB = x  B A B T Q Q R T Q Q R CLK Reset x y Present State I/P Next State F.F Inputs O/P A B x A B TA TB y 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 0 1 0 0 1 1 0 0 0 1 0 0 1 1 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0 0 0 0 0 1 1 06:23 PM
  • 42.
    42 / 60 Analysisof Clocked Sequential Circuits • T Flip-Flops Example: A B T Q Q R T Q Q R CLK Reset x y Present State I/P Next State F.F Inputs O/P A B x A B TA TB y 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 0 1 0 0 1 1 0 0 0 1 0 0 1 1 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 1 0 0/0 1/0 0/0 1/0 1/0 1/1 0/0 0/1 06:23 PM
  • 43.
    43 / 60 Mealyand Moore Models Present State I/P Next State O/P A B x A B y 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 1 1 1 1 0 1 0 0 0 0 1 1 0 1 1 0 0 1 1 0 0 0 1 1 1 1 1 0 0 Mealy For the same state, the output changes with the input Present State I/P Next State O/P A B x A B y 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 0 1 1 1 0 0 1 0 0 1 0 0 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1 0 0 1 Moore For the same state, the output does not change with the input 06:23 PM
  • 44.
    44 / 60 MooreState Diagram State / Output 0 0 / 0 0 1 / 0 1 1 / 1 1 0 / 0 0 1 1 1 0 0 0 1 06:23 PM
  • 45.
    45 / 60 TimingDiagram 0 0 / 0 0 1 / 0 1 1 / 1 1 0 / 0 0 0 1 1 0 0 1 1 CLK State A B y x No effect 0 0 0 1 1 0 0 0 0 1 0 1 A B x y 06:23 PM
  • 46.
    46 / 60 TimingDiagram 0 0 0 1 1 1 1 0 0/0 0/0 1/0 1/1 0/0 0/0 1/1 1/0 CLK State A B y x 1 0 A B x y 06:23 PM
  • 47.
    47 / 60 Designof Clocked Sequential Circuits • Example: Detect 3 or more consecutive 1’s S0 / 0 S1 / 0 S3 / 1 S2 / 0 0 1 1 0 0 1 0 1 State A B S0 0 0 S1 0 1 S2 1 0 S3 1 1 06:23 PM
  • 48.
    48 / 60 Designof Clocked Sequential Circuits • Example: Detect 3 or more consecutive 1’s Present State Input Next State Output A B x A B y 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 1 1 1 S0 / 0 S1 / 0 S3 / 1 S2 / 0 0 1 1 0 0 1 0 1 06:23 PM
  • 49.
    49 / 60 Designof Clocked Sequential Circuits • Example: Detect 3 or more consecutive 1’s Present State Input Next State Output A B x A B y 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 1 1 1 A(t+1) = DA (A, B, x) = ∑ (3, 5, 7) B(t+1) = DB (A, B, x) = ∑ (1, 5, 7) y(A, B, x) = ∑ (6, 7) Synthesis using D Flip-Flops 06:23 PM
  • 50.
    50 / 60 Designof Clocked Sequential Circuits with D F.F. • Example: Detect 3 or more consecutive 1’s DA (A, B, x) = ∑ (3, 5, 7) = A x + B x DB (A, B, x) = ∑ (1, 5, 7) = A x + B’x y(A, B, x) = ∑ (6, 7) = A B Synthesis using D Flip-Flops B 0 0 1 0 A 0 1 1 0 x B 0 1 0 0 A 0 1 1 0 x B 0 0 0 0 A 0 0 1 1 x 06:23 PM
  • 51.
    51 / 60 Designof Clocked Sequential Circuits with D F.F. • Example: Detect 3 or more consecutive 1’s DA = A x + B x DB = A x + B’x y = A B Synthesis using D Flip-Flops D Q Q A CLK x B D Q Q y 06:23 PM
  • 52.
    52 / 60 Flip-FlopExcitation Tables Present State Next State F.F. Input Q(t) Q(t+1) D 0 0 0 1 1 0 1 1 Present State Next State F.F. Input Q(t) Q(t+1) J K 0 0 0 1 1 0 1 1 0 0 (No change) 0 1 (Reset) 0 x 1 x x 1 x 0 0 1 0 1 1 0 (Set) 1 1 (Toggle) 0 1 (Reset) 1 1 (Toggle) 0 0 (No change) 1 0 (Set) Q(t) Q(t+1) T 0 0 0 1 1 0 1 1 0 1 1 0 06:23 PM
  • 53.
    53 / 60 Designof Clocked Sequential Circuits with JK F.F. • Example: Detect 3 or more consecutive 1’s Present State Input Next State Flip-Flop Inputs A B x A B JA KA JB KB 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 1 1 1 1 0 0 0 1 1 1 1 1 0 x 0 x 0 x 1 x x 1 x 0 x 1 x 0 JA (A, B, x) = ∑ (3) dJA (A, B, x) = ∑ (4,5,6,7) KA (A, B, x) = ∑ (4, 6) dKA (A, B, x) = ∑ (0,1,2,3) JB (A, B, x) = ∑ (1, 5) dJB (A, B, x) = ∑ (2,3,6,7) KB (A, B, x) = ∑ (2, 3, 6) dKB (A, B, x) = ∑ (0,1,4,5) Synthesis using JK F.F. 0 x 1 x x 1 x 1 0 x 1 x x 1 x 0 06:23 PM
  • 54.
    54 / 60 Designof Clocked Sequential Circuits with JK F.F. • Example: Detect 3 or more consecutive 1’s JA = B x KA = x’ JB = x KB = A’ + x’ Synthesis using JK Flip-Flops B 0 0 1 0 A x x x x x B x x x x A 1 0 0 1 x B 0 1 x x A 0 1 x x x B x x 1 1 A x x 0 1 x CLK J Q Q K x A B J Q Q K y 06:23 PM
  • 55.
    55 / 60 Designof Clocked Sequential Circuits with T F.F. • Example: Detect 3 or more consecutive 1’s Present State Input Next State F.F. Input A B x A B TA TB 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 0 1 0 Synthesis using T Flip-Flops 0 1 1 1 0 1 1 0 TA (A, B, x) = ∑ (3, 4, 6) TB (A, B, x) = ∑ (1, 2, 3, 5, 6) 06:23 PM
  • 56.
    56 / 60 Designof Clocked Sequential Circuits with T F.F. • Example: Detect 3 or more consecutive 1’s TA = A x’ + A’B x TB = A’B + B  x Synthesis using T Flip-Flops B 0 0 1 0 A 1 0 0 1 x B 0 1 1 1 A 0 1 0 1 x A B y T Q Q x CLK T Q Q 06:23 PM
  • 57.
    57 / 60 Homework •Mano – Chapter 5 • 5-1 • 5-3 • 5-6 • 5-8 • 5-9 06:23 PM
  • 58.
    58 / 60 Homework 5-1The D latch is constructed with four NAND gates and an inverter. Consider the following three other ways for obtaining a D latch. In each case, draw the logic diagram and verify the circuit operation. (a) Use NOR gates for the SR latch part and AND gates for the other two. An inverter may be needed. (b) Use NOR gates for all four gates. Inverters may be needed. (c) Use four NAND gates only (without an inverter). This can be done by connecting the output of the upper gate that goes to the SR latch to the input of the lower gate instead of the inverter output. 06:23 PM
  • 59.
    59 / 60 Homework 5-3Show that the characteristic equation for the complement output of a JK flip-flop is Q’(t+1) = J’Q + K Q 5-6 A sequential circuit with two D flip-flops, A and B; two inputs, x and y; and one output, z, is specified by the following next-state and output equations: A(t+1) = x’ y + x A B(t+1) = x’ B + x A z = B (a) Draw the logic diagram of the circuit. (b) List the state table for the sequential circuit. (c) Draw the corresponding state diagram. 06:23 PM
  • 60.
    60 / 60 Homework 5-8Derive the state table and the state diagram of the sequential shown circuit. Explain the function that the circuit performs. A B CLK T Q Q T Q Q 06:23 PM
  • 61.
    61 / 60 Homework 5-9A sequential circuit has two JK flip-flops A and B and one input x. The circuit is described by the following flip-flop input equations: JA = x KA = B’ JB = x KB = A (a) Derive the state equations A(t+1) and B(t+1) by substituting the input equations for the J and K variables. (b) Draw the state diagram of the circuit. 06:23 PM