Adapted from Dr. Bassam Kahhaleh’ Slides by Prof. Iyad Jafar
Digital Logic
0907231
0
Chapter 6
Sequential Logic Circuits
1
Outline
2
Introduction
3
Introduction
Combinational
Circuit
Inputs
Outputs
m
n
Xi
Yr
Yr = Fr(Xn-1, , … , X0)
4
Introduction
5
Sequential Circuits
Combinational
Circuit
Memory�Elements
Inputs
Outputs
m
n
Xi
Yr
Yr = Fr (Qk-1,Qk-2, … , Q0,Xn-1, , … , X0)
k
k
Qj(t)
Present
State
Next
State
Qj(t+1)
Qj(t+1) = Gj (Qk-1,Qk-2, … , Q0,Xn-1, , … , X0)
6
Sequential Circuits
Clock
Combinational
Circuit
Memory�Elements
Inputs
Outputs
m
n
Xi
Yr
Yr = Fr (Qk-1,Qk-2, … , Q0,Xn-1, , … , X0)
k
k
Qj(t)
Present
State
Next
State
Qj(t+1)
Qj (t+1) = Gj (Qk-1,Qk-2, … , Q0,Xn-1, , … , X0)
7
Storage Elements
8
Storage Elements
Q
Q
Input
Stored Value
Complement of
stored Value
9
Storage Elements
10
Latches
S R Q | Q+ | Q+’ |
0 0 0 | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
0
1
0
0
0 | 1 |
Q+ = Q
Initial Value
Q is Q(t); the present state
Q+ is Q(t+1); the next state
Reset
Set
11
Latches
S R Q | Q+ | Q+’ |
0 0 0 | 0 | 1 |
0 0 1 | | |
| | |
| | |
| | |
| | |
| | |
| | |
1
0
0
0
1 | 0 |
Q+ = Q
Q+ = Q
12
Latches
S R Q | Q+ | Q+’ |
0 0 0 | 0 | 1 |
0 0 1 | 1 | 0 |
0 1 0 | 0 | |
| | |
| | |
| | |
| | |
| | |
0
1
1
0
| 1 |
Q+ = 0
Q+ = Q
13
Latches
S R Q | 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+ = Q
Q+ = 0
1
0
14
Latches
S R Q | 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+ = Q
Q+ = 1
0
1
15
Latches
S R Q | 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+ = Q
Q+ = 1
Q+ = 1
16
Latches
S R Q | 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
17
Latches
S R Q | 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+ = Q
Q+ = 1
Q+ = Q+’
Q+ = Q+’
0
18
Latches
S R | Q(t+1) |
0 0 | Q(t) |
0 1 | 0 |
1 0 | 1 |
1 1 | Q=Q’=0 |
No change
Reset
Set
Invalid
S
Q
Q
R
19
Latches
S R | Q(t+1) |
0 0 | Q(t) |
0 1 | 0 |
1 0 | 1 |
1 1 | Q=Q’=0 |
Hold
Reset
Set
Invalid
S
Q
Q
R
Timing Diagram
Set
Hold
Reset
Hold
Hold
Set
S
R
Q
Time
20
Latches
S R | Q(t+1) |
0 0 | Q=Q’=1 |
0 1 | 1 |
1 0 | 0 |
1 1 | Q(t) |
Invalid
Set
Reset
No change
S
Q
Q
R
21
Latches
22
Controlled Latches
C S R | Q(t+1) |
0 x x | Q(t) |
1 0 0 | Q(t) |
1 0 1 | 0 |
1 1 0 | 1 |
1 1 1 | Q=Q’ |
No change
No change
Reset
Set
Invalid
S
Q
Q
R
C
Reset
Set
Control
(Clock)
23
Example 1
C S R | Q(t+1) |
0 x x | Q(t) |
1 0 0 | Q(t) |
1 0 1 | 0 |
1 1 0 | 1 |
1 1 1 | Q=Q’ |
No change
Hold
Reset
Set
Invalid
S
Q
Q
R
C
Timing Diagram
Set
No
Change
Reset
Hold
S
R
Q
C
Hold
No
Change
Output may change
24
Controlled Latches
C D | Q(t+1) |
0 x | Q(t) |
1 0 | 0 |
1 1 | 1 |
No change
Reset
Set
C
Timing Diagram
D
Q
Output may change
D
Q
Q
C
25
Controlled Latches
C
Timing Diagram
D
Q
t
Output may change
C D | Q(t+1) |
0 x | Q(t) |
1 0 | 0 |
1 1 | 1 |
No change
Reset
Set
26
Latches Summary
S
Q
Q
R
C
D
Q
Q
C
+ve pulse-triggered D latch
+ve pulse-triggered SR latch
C = 0 🡪 Hold
C = 1 🡪 Change
S
Q
Q
R
C
D
Q
Q
C
-ve pulse-triggered D latch
-ve pulse-triggered SR latch
C = 1 🡪 Hold
C = 0 🡪 Change
27
Real Stuff
28
Controlled Latches
C
29
Flip-Flops
CLK
Positive Edge
(Rising)
CLK
Negative Edge
(Falling)
30
Flip-Flops
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
31
Flip-Flops
D
Q
Q
D
Q
Q
Positive Edge
Negative Edge
32
Flip-Flops
J
Q
Q
K
J | K | Q(t+1) |
0 | 0 | Q(t) |
0 | 1 | 0 |
1 | 0 | 1 |
1 | 1 | Q’(t) |
Hold
Reset
Set
Toggle
33
Flip-Flops
J
Q
Q
K
T
D
Q
Q
T
T
Q
Q
T | Q(t+1) |
0 | Q(t) |
1 | Q’(t) |
Hold
Toggle
34
Flip-Flop Characteristic Tables (For Analysis)
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) |
Hold
Reset
Set
Toggle
J
Q
Q
K
T
Q
Q
T | Q(t+1) |
0 | Q(t) |
1 | Q’(t) |
Hold
Toggle
35
Flip-Flop Characteristic Tables (For Analysis)
D
Q
Q
J
Q
Q
K
T
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) |
Hold
Reset
Set
Toggle
T | Q(t+1) |
0 | Q(t) |
1 | Q’(t) |
Hold
Toggle
36
Example 2
Clock
T
Q
Hold
Toggle
T
Q
Q
Clock
Toggle
T | Q(t+1) |
0 | Q(t) |
1 | Q’(t) |
Hold
Toggle
37
Flip-Flop Characteristic Equations (For Analysis)
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
38
Flip-Flop Characteristic Equations
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
39
Flip-Flop Characteristic Equations
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
40
Flip-Flop Characteristic Equations
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
41
Flip-Flop Characteristic Equations
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
42
Flip-Flop Characteristic Equations
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
43
Exercise
T | Q(t+1) |
0 | Q(t) |
1 | Q’(t) |
T | Q(t) | Q(t+1) |
0 | 0 | |
0 | 1 | |
1 | 0 | |
1 | 1 | |
44
Flip-Flops with Direct Inputs
D
Q
Q
R
Reset
| D | CLK | Q(t+1) |
| | | |
| | | |
| | | |
1 | 0 | ↑ | 0 |
1 | 1 | ↑ | 1 |
0 | x | x | 0 |
45
Flip-Flops with Direct Inputs
| | 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
46
Example 3
D
Q
Q
CLR
Reset
PR
Preset
Clock
D
Q
Preset
Reset
Output changed without edges due to direct inputs
47
Example 4
48
Direct Inputs
D
Q
Q
CLR
Reset
PR
Preset
D
Q
Q
CLR
Reset
PR
Preset
+ve Edge-triggered D-FF with active-high direct inputs
+ve Edge-triggered D-FF with active-low direct inputs
49
Real Stuff
50
Real Stuff
51
Analysis of Sequential Circuits
52
Analysis of Clocked Sequential Circuits
Clock
Combinational
Circuit
Memory�Elements
Inputs
Outputs
m
n
Xi
Yr
Yr = Fr(Qk-1,Qk-2, … , Q0,Xn-1, , … , X0)
k
k
Qj(t)
Present
State
Next
State
Qj(t+1)
Qj = Gj(Qk-1,Qk-2, … , Q0,Xn-1, , … , X0)
53
Analysis of Clocked Sequential Circuits
State Variables
Possible States
A B = 0 0
A B = 0 1
A B = 1 0
A B = 1 1
54
Analysis of Clocked Sequential Circuits
55
Analysis of Clocked Sequential Circuits
56
Example 5 – Analysis of Sequential Circuits
DA = A(t) +x(t)
= A + x
y(t) = A’(t) x(t)
= A’ x
57
Example 5 – Analysis of Sequential Circuits
A(t+1) = DA
= A(t) +x(t)
= A + x
58
Example 5 – Analysis of Sequential Circuits
Present State | Input | Next State | Output |
A(t) | x | A(t+1) | y |
0 | 0 | | |
0 | 1 | | |
1 | 0 | | |
1 | 1 | | |
t+1
t
t
0 0
1 1
1 0
1 0
A(t+1) = A + x
y(t) = A’ x
59
Example 6 – Analysis of Sequential Circuits
DA = A(t) x(t)+B(t) x(t)
= A x + B x
DB = A’(t) x(t)
= A’ x
y(t) = [A(t)+ B(t)] x’(t)
= (A + B) x’
60
Example 6 – Analysis of Sequential Circuits
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
61
Example 6 - – Analysis of Sequential Circuits
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
62
Example 6 – Analysis of Sequential Circuits
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
63
Analysis of Clocked Sequential Circuits
AB
input/output
64
Analysis of Clocked Sequential Circuits
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
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 |
65
Example 7 – Analysis of Sequential Circuits
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
0
1
11
01
01
10
10
00
11
00
66
Example 8 – Analysis of Sequential Circuits
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
For JK FF, Q(t+1) = JQ’ + K’Q
67
Example 8 – Analysis of Sequential Circuits
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
68
Example 9 – Analysis of Sequential Circuits
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
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
For T FF, Q(t+1) = T ⊕ Q(t)
69
Example 9 – Analysis of Sequential Circuits
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
70
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
71
Mealy and Moore Models
Mealy Machine
Mealy type output depends on state and input
State
In/out
01
1/0
to next state
Moore Machine
Moore type output depends only on state
State
out
in
to next state
01
1
1
72
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
73
Timing Diagram (Moore Circuit)
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
74
Timing Diagram (Mealy Circuit)
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
75
Execise
76
Design of Synchronous Sequential Circuits
77
Design of Synchronous Sequential Circuits
Clock
Combinational
Circuit
Memory�Elements
Inputs
Outputs
m
n
Xi
Yr
Yr = Fr(Qk-1,Qk-2, … , Q0,Xn-1, , … , X0)
k
k
Qj(t)
Present
State
Next
State
Qj(t+1)
Qj = Gj(Qk-1,Qk-2, … , Q0,Xn-1, , … , X0)
78
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 | |
0
1
0
1
D-FF Excitation Table
D
Q
Q
79
Flip-Flop Excitation Tables
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
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
T-FF Excitation Table
JK-FF Excitation Table
T = 0 (No change)
T = 1 (Toggle)
T = 1 (Toggle)
T = 0 (Hold)
80
Example 10
One input 🡺 x
One output 🡺 y
Four states 🡺 Two FFs
State Variables🡺 A and B
Two FFs inputs 🡺 DA and DB
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 | 1 |
0 | 1 | 0 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 0 | 1 |
1 | 0 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 1 | 1 | 1 |
1 | 1 | 0 | 0 | 1 | 1 |
1 | 1 | 1 | 1 | 0 | 1 |
81
Example 10
D
Q
Q
D
Q
Q
????
y(t)
A(t)
B(t)
Clock
x(t)
DA
DB
82
Example 10
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 | 1 |
0 | 1 | 0 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 0 | 1 |
1 | 0 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 1 | 1 | 1 |
1 | 1 | 0 | 0 | 1 | 1 |
1 | 1 | 1 | 1 | 0 | 1 |
F.F�Inputs | |
DA | DB |
| |
| |
| |
| |
| |
| |
| |
| |
Present State | Next State | F.F. Input |
Q(t) | Q(t+1) | D |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 0 |
1 | 1 | 1 |
0
0
0
0
0
1
0
1
0
1
1
0
0
1
1
0
D-FF Excitation Table
83
Example 10
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 | 1 |
0 | 1 | 0 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 0 | 1 |
1 | 0 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 1 | 1 | 1 |
1 | 1 | 0 | 0 | 1 | 1 |
1 | 1 | 1 | 1 | 0 | 1 |
F.F�Inputs | |
DA | DB |
| |
| |
| |
| |
| |
| |
| |
| |
| | | B | ||
| |||||
| | 0 | 0 | 0 | 0 |
A | 0 | 1 | 1 | 0 | |
| | x | | ||
| | ||||
| | | B | ||
| |||||
| | 0 | 1 | 0 | 1 |
A | 0 | 1 | 0 | 1 | |
| | x | | ||
| | ||||
| | | B | ||
| |||||
| | 0 | 1 | 1 | 0 |
A | 1 | 1 | 1 | 1 | |
| | x | | ||
| | ||||
DA = A(t) x
0
0
0
0
0
1
0
1
0
1
1
0
0
1
1
0
DB = B’(t)x + B(t)x’
y = A(t) + x
84
Example 10
D
Q
Q
D
Q
Q
y(t)
A(t)
B(t)
Clock
x(t)
DA
DB
DA = A(t) x
DB = B’(t)x + B(t)x’
y = A(t) + x
85
Example 10
T
Q
Q
T
Q
Q
????
y(t)
A(t)
B(t)
Clock
x(t)
TA
TB
86
Example 10
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 | 1 |
0 | 1 | 0 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 0 | 1 |
1 | 0 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 1 | 1 | 1 |
1 | 1 | 0 | 0 | 1 | 1 |
1 | 1 | 1 | 1 | 0 | 1 |
F.F�Inputs | |
TA | TB |
| |
| |
| |
| |
| |
| |
| |
| |
Present State | Next State | F.F. Input |
Q(t) | Q(t+1) | T |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
0
0
0
0
1
0
1
0
0
1
0
1
0
1
0
1
T-FF Excitation Table
87
Example 10
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 | 1 |
0 | 1 | 0 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 0 | 1 |
1 | 0 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 1 | 1 | 1 |
1 | 1 | 0 | 0 | 1 | 1 |
1 | 1 | 1 | 1 | 0 | 1 |
F.F�Inputs | |
TA | TB |
| |
| |
| |
| |
| |
| |
| |
| |
| | | B | ||
| |||||
| | 0 | 0 | 0 | 0 |
A | 1 | 0 | 0 | 1 | |
| | x | | ||
| | ||||
| | | B | ||
| |||||
| | 0 | 1 | 1 | 0 |
A | 0 | 1 | 1 | 0 | |
| | x | | ||
| | ||||
| | | B | ||
| |||||
| | 0 | 1 | 1 | 0 |
A | 1 | 1 | 1 | 1 | |
| | x | | ||
| | ||||
TA = A(t) x’
TB = x
y = A(t) + x
0
0
0
0
1
0
1
0
0
1
0
1
0
1
0
1
88
Example 10
T
Q
Q
T
Q
Q
y(t)
A(t)
B(t)
Clock
x(t)
TA
TB
TA = A(t) x’
TB = x
y = A(t) + x
89
Example 10
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 | 1 |
0 | 1 | 0 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 0 | 1 |
1 | 0 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 1 | 1 | 1 |
1 | 1 | 0 | 0 | 1 | 1 |
1 | 1 | 1 | 1 | 0 | 1 |
F.F�Inputs | |||
JA | KA | JB | KB |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | ||
| |||||
| | | | | |
| | | | | |
| | | | ||
| | ||||
| | | | ||
| |||||
| | | | | |
| | | | | |
| | | | ||
| | ||||
| | | | ||
| |||||
| | | | | |
| | | | | |
| | | | ||
| | ||||
| | | | ||
| |||||
| | | | | |
| | | | | |
| | | | ||
| | ||||
Q(t) | Q(t+1) | J | K |
0 | 0 | 0 | x |
0 | 1 | 1 | x |
1 | 0 | x | 1 |
1 | 1 | x | 0 |
JK-FF Excitation Table
90
Example 10
A(t)
Clock
J
Q
Q
K
B(t)
J
Q
Q
K
y(t)
x(t)
91
Example 11
No input 🡺 Free running
Output 🡺 Count value (Q1 and Q0 )
Four states 🡺 Two FFs
State Variables🡺 Q1 and Q0
Four FFs inputs 🡺 J1, K1, J0 and K0
2
0
1
3
92
Example 11
????
Q1(t)
Clock
J1
Q
Q
K1
Q0(t)
J0
Q
Q
K0
93
Example 11
Present State | Next State | ||
Q1 | Q0 | Q1 | Q0 |
0 | 0 | 1 | 0 |
0 | 1 | 1 | 1 |
1 | 0 | 0 | 1 |
1 | 1 | 0 | 0 |
F.F�Inputs | |||
J1 | K1 | J0 | K0 |
1 | x | 0 | x |
1 | x | x | 0 |
x | 1 | 1 | x |
x | 1 | x | 1 |
1 | 1 |
x | x |
Q1
Q0
x | x |
1 | 1 |
Q1
Q0
0 | x |
1 | x |
Q1
x | 0 |
x | 1 |
Q1
J1 = 1
K1 = 1
J0 = Q1
K0 = Q1
Q(t) | Q(t+1) | J | K |
0 | 0 | 0 | x |
0 | 1 | 1 | x |
1 | 0 | x | 1 |
1 | 1 | x | 0 |
JK-FF Excitation Table
94
Example 11
Q1(t)
Clock
J1
Q
Q
K1
Q0(t)
J0
Q
Q
K0
1
J1 = 1
K1 = 1
J0 = Q1
K0 = Q1
95
Example 12
One input 🡺 x
Output 🡺 Count value (Q1 and Q0 )
Four states 🡺 Two FFs
State Variables🡺 Q1 and Q0
1
0
2
3
0
0
0
0
1
1
1
1
96
Example 12
Present State | IN | Next State | ||
Q1(t) | Q0(t) | x | Q1(t+1) | Q0(t+1) |
1 | 1 | 0 | 0 | 0 |
1 | 1 | 1 | 1 | 1 |
0 | 0 | 0 | 0 | 1 |
0 | 0 | 1 | 0 | 0 |
0 | 1 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 1 |
1 | 0 | 0 | 1 | 1 |
1 | 0 | 1 | 1 | 0 |
| |
| |
| |
| |
| |
| |
| |
| |
T1 | T0 |
| | | | ||
| |||||
| | | | | |
| | | | | |
| | | | ||
| | ||||
| | | | ||
| |||||
| | | | | |
| | | | | |
| | | | ||
| | ||||
97
Example 12
T
Q
Q
T
Q
Q
Q1(t)
Q0(t)
Clock
T1
T0
98
Exercise
PS | IN | NS | ||
Q1 | Q0 | x | Q1+ | Q0+ |
1 | 1 | 0 | 0 | 0 |
1 | 1 | 1 | 1 | 1 |
0 | 0 | 0 | 0 | 1 |
0 | 0 | 1 | 0 | 0 |
0 | 1 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 1 |
1 | 0 | 0 | 1 | 1 |
1 | 0 | 1 | 1 | 0 |
| |
| |
| |
| |
| |
| |
| |
| |
J1 | K1 |
| |
| |
| |
| |
| |
| |
| |
| |
J0 | K0 |
| | | | ||
| |||||
| | | | | |
| | | | | |
| | | | ||
| | ||||
| | | | ||
| |||||
| | | | | |
| | | | | |
| | | | ||
| | ||||
| | | | ||
| |||||
| | | | | |
| | | | | |
| | | | ||
| | ||||
| | | | ||
| |||||
| | | | | |
| | | | | |
| | | | ||
| | ||||
99
Exercise
PS | IN | NS | |
Q | J | K | Q+ |
0 | 0 | 0 | |
0 | 0 | 1 | |
0 | 1 | 0 | |
0 | 1 | 1 | |
1 | 0 | 0 | |
1 | 0 | 1 | |
1 | 1 | 0 | |
1 | 1 | 1 | |
D |
|
|
|
|
|
|
|
|
| | | | ||
| |||||
| | | | | |
| | | | | |
| | | | ||
| | ||||
100
Exercise
PS | IN | NS |
Q(t) | T | Q+ |
0 | 0 | |
0 | 1 | |
1 | 0 | |
1 | 1 | |
J |
|
|
|
|
K |
|
|
|
|
| |
| |
| |
| |
101
Example 13
No
Carry
Carry
x
y
Sum
Reset
00/0
01/1
10/1
11/1
11/0
00/1
01/0
10/0
102
Example 13
PS | IN | NS | Out | |
Q | x | y | Q+ | sum |
0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 | 1 |
0 | 1 | 0 | 0 | 1 |
0 | 1 | 1 | 1 | 0 |
1 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 1 | 0 |
1 | 1 | 0 | 1 | 0 |
1 | 1 | 1 | 1 | 1 |
Need to assign binary codes to the states!
No Carry 🡪 0
Carry State 🡪 1
| | | | ||
| |||||
| | | | | |
| | | | | |
| | | | ||
| | ||||
D |
|
|
|
|
|
|
|
|
| | | | ||
| |||||
| | | | | |
| | | | | |
| | | | ||
| | ||||
103
Example 13
D
Q
Q
sum
x
y
104
Exercise
105
Exercise
106
Real Stuff
107
Example 14
First 1
has not
arrived
First 1
Has arrived
x
y
Reset
0/0
1/1
1/0
0/1
108
Example 14
PS | IN | NS | OUT |
Q(t) | x | Q+ | y |
0 | 0 | 0 | 0 |
0 | 1 | 1 | 1 |
1 | 0 | 1 | 1 |
1 | 1 | 1 | 0 |
Need to assign binary codes to the states!
First 1 has not arrived 🡪 0
First 1 arrived 🡪 1
| |
| |
| |
| |
J |
|
|
|
|
K |
|
|
|
|
| |
| |
109
Example 14
110
Exercise
111
Example 15
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 |
Reset
Clock
Input
Output
112
Example 15
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
113
Example 15
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
114
Example 15
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 | | ||
| | ||||
115
Example 15
DA = A x + B x
DB = A x + B’ x
y = A B
Synthesis using D Flip-Flops
116
Example 15
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
117
Example 15
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 | | ||
| | ||||
118
Example 15
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)
119
Example 15
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 | | ||
| | ||||
120
Exercise
121
State Assignment
122
Design with Unused States
123
Example 16
A | B | x | A+ | B+ |
0 | 0 | 0 | 1 | 0 |
0 | 0 | 1 | 0 | 0 |
0 | 1 | 0 | 0 | 1 |
0 | 1 | 1 | 1 | 0 |
1 | 0 | 0 | 0 | 0 |
1 | 0 | 1 | 0 | 1 |
1 | 1 | 0 | ? | ? |
1 | 1 | 1 | ? | ? |
Unused State
124
Example 16
A | B | x | A+ | B+ |
0 | 0 | 0 | 1 | 0 |
0 | 0 | 1 | 0 | 0 |
0 | 1 | 0 | 0 | 1 |
0 | 1 | 1 | 1 | 0 |
1 | 0 | 0 | 0 | 0 |
1 | 0 | 1 | 0 | 1 |
1 | 1 | 0 | X | X |
1 | 1 | 1 | X | X |
DA | DB |
| |
| |
| |
| |
| |
| |
| |
| |
| | | B | ||
| |||||
| | | | | |
A | | | | | |
| | x | | ||
| | ||||
| | | B | ||
| |||||
| | | | | |
A | | | | | |
| | x | | ||
| | ||||
DA =
DB =
What if the PS is 11 and x is 1?
125
Example 16
A | B | x | A+ | B+ |
0 | 0 | 0 | 1 | 0 |
0 | 0 | 1 | 0 | 0 |
0 | 1 | 0 | 0 | 1 |
0 | 1 | 1 | 1 | 0 |
1 | 0 | 0 | 0 | 0 |
1 | 0 | 1 | 0 | 1 |
1 | 1 | 0 | 0 | 0 |
1 | 1 | 1 | 0 | 0 |
DA | DB |
| |
| |
| |
| |
| |
| |
| |
| |
| | | B | ||
| |||||
| | | | | |
A | | | | | |
| | x | | ||
| | ||||
| | | B | ||
| |||||
| | | | | |
A | | | | | |
| | x | | ||
| | ||||
DA =
DB =
Cost of CLC?
When does the circuit is allowed to change PS?
126
Example 16
D
Q
S
R
D
Q
S
R
CLC
A(t)
A(t)
B(t)
x
B(t)
127
Exercises
128
Suggested Problems (5th Editiotion)
129
Exercises
* | Show that the characteristic equation for the complement output of a JK flip-flop is Q’(t+1) = J’Q’+ K Q |
130
Exercises
* | 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. |
131
Exercises
* | |
132
Exercises
* | 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. |
133
Exercises
134