You are on page 1of 43

2

SEQUENTIAL CIRCUIT

n inputs m outputs
Combinational
circuit

Memory
elements
3
4

Q(t) Q(t) S R Q(t+) Q (t+)


R (reset) Q 1 0 1 0
1 0 0 0 1 0 (after Q=1, Q=0)
1 0 0 1 0 1
0 1 0 0 0 1 (after Q=0, Q=1)
Q 0 1 1 1 0 0 Not Allowed
S (set)
0 0 0 0 ? ? (after Q=0, Q=0)
Indeterminite, may
oscillate

S R Q(t+)
0 0 Q(t)
0 1 0 (reset)
1 0 1 (set)
1 1 NA
5

S (set) Q
S R Q Q
1 0 0 1
1 1 0 1 (after Q=0, Q=1)
Q 0 1 1 0
1 1 1 0 (after Q=1, Q=0)
R (reset) 0 0 1 1 Not Allowed
1 1 ? ? after Q=1, Q=1
Indeterminite, may oscillate

S R Q(t+) S R Q(t+)
0 0 NA 0 0 Q(t)
0 1 1 (set) 0 1 0 (reset)
1 0 0 (reset) 1 0 1 (set)
1 1 Q(t) 1 1 NA
6

C S R Q(t+)
S (set)
Q 0 x x No change
1 0 0 Q(t)
1 0 1 0
C
Q 1 1 0 1
1 1 1 NA
R (reset)

D (data)
Q C D Q(t+)
0 x No change
1 0 0
C Q 1 1 1
7
8

D Flip Flop ( triggered) D Flip Flop ( triggered)

D D Q D Q Q D D Q D Q Q
master slave master slave
C Q C Q Q C Q C Q Q

C C
9

Graphical symbols for latches:

S Q S Q D Q
C C
R Q R Q C Q

SR Latch SR Latch D Latch

Graphical symbols for FFs:

D Q D Q S Q S Q
C C
C Q C Q R Q R Q

D FF D FF SR FF SR FF
( triggered) ( triggered) ( triggered) ( triggered)
10
11
Characteristic Equation, Characteristic and Excitation Tables
Characteristic Table:

D Q(t+1) Comment
Q(t+1):
0 0 clear (reset) 0 1
D FF
1 1 set Q(t) 0 1

D Q D

C Q
Characteristic Equation: Excitation Table:

Q(t+1)=D
Q(t) Q(t+1) D
0 0 0
0 1 1
1 0 0
1 1 1
12
Characteristic Equation, Characteristic and Excitation Tables
Characteristic Table:

S R Q(t+1) Q(t+1): S

SR FF 0 0 Q(t )
0 0 x 1
0 1 0
S Q 1 0 1 Q(t) 1 0 x 1

C 1 1 NA
R
R Q

Characteristic Equation: Excitation Table:

Q(t+1)=S+ RQ(t)
Q(t) Q(t+1) S R
0 0 0 x
0 1 1 0
1 0 0 1
1 1 x 0
13
Characteristic Equation, Characteristic and Excitation Tables
Characteristic Table:

J K Q(t+1) J
Q(t+1):
JK FF 0 0 Q(t )
0 1 0 0 0 1 1

J Q 1 0 1 1 0 0 1
Q(t)
C 1 1 Q(t )

K Q K

Characteristic Equation: Excitation Table:

Q(t+1)=JQ(t)+ KQ(t)
Q(t) Q(t+1) J K
0 0 0 x
0 1 1 x
1 0 x 1
1 1 x 0
14
Characteristic Equation, Characteristic and Excitation Tables
Characteristic Table:

T Q(t+1) Q(t+1):
0 1
T FF 0 Q(t )
1 Q(t ) Q(t) 1 0
T Q
T
C

Characteristic Equation: Excitation Table:

Q(t+1)=TQ(t)+TQ(t)
Q(t) Q(t+1) T
=TQ(t)
0 0 0
0 1 1
1 0 1
1 1 0
15

X
D Q A
Input variables: x(t)
C Q A
State variables: A(t), B(t)
( of state variables = of FFs )

D Q B
Output variables: y(t)

C Q B

CLK
16
17

State (Transition)Table: State (Transition) Diagram:

Present Input Next State Output


State
A(t) B(t) x(t) A(t+1)B(t+1) y(t)
00 0 00 0 0/0
00 1 01 0 1/0
01 0 00 1 0/1
01 1 11 0 State: 00 10
10 0 00 1 A(t)B(t)
10 1 10 0
0/1
11 0 00 1 1/0 1/0
11 1 10 0 0/1
input/output
Slightly different form of the state table: x(t)/y(t) 01 11

Present Next State Output 1/0


State
x=0 x=1 x=0 x=1
AB AB AB y y
00 00 01 0 0
01 00 11 1 0
10 00 10 1 0
11 00 10 1 0
18

Given: Input varibles: x,y


State variables: A
Output variables: No explicit output
A variables, it is same as the state
x D Q
y
DA=xyA
C Q A(t+1)= xyA
CLK A

State (Transition)Table: State (Transition) Diagram:

PS NS state:A(t)
A(t) A(t+1) 01,10
xy=00 xy=01 xy=10 xy=11 1 00,11
00,11 0
0 0 1 1 0
1 1 0 0 1 01,10
input: x(t)y(t)
(not in the form
input/output
since output=state)
19

Given: Input variables: x; State variables: A,B


J Q A Output variables: No explicit output
C
x JA=B, KA=Bx
K Q
JB=x, KB=Ax=Ax+Ax
Characteristic Eq. for JK FF: Q(t+1)=JQ+KQ
J Q B
State Equations:
C
A(t+1)= JAA+KAA
K Q
= BA+(B+x)A=AB+A B+Ax
B(t+1)= JBB+KBB
CLK =xB+(Ax)B=B x+ABx+ABx

State (Transition)Table: State (Transition) Diagram:


PS Input FF inputs NS
AB x JA KA JB KB AB 1 1
0
00 0 0 0 1 0 01 11
00
00 1 0 0 0 1 00
01 0 1 1 1 0 11
01 1 1 0 0 1 10 0
0 0
10 0 0 0 1 1 11
10 1 0 0 0 0 10
11 0 1 1 1 1 00 01 10
1
11 1 1 0 0 0 11
1
20

Given: Input variables: x


A
x T Q y Output variables: y
State variables: A,B
C R Q TA=Bx T B= x y=AB

B Characteristic Equation for T FF: Q(t+1)=TQ


T Q

C R Q State equations:
A(t+1)=TAA+TAA=(Bx)A+(Bx)A=AB+Ax+ABx
B(t+1)= TBB+TBB = xB+xB
CLK Reset

State (Transition) Diagram:


PS Input NS Output
0 1
AB x AB y 0
00/0 01/0
00 0 00 0
00 1 01 0
1 1
01 0 01 0
01 1 10 0 input: x
10 0 10 0 11/1 10/0
10 1 11 0 0 0
1
11 0 11 1
state/output:
11 1 00 1
AB/y
21

0 1 0
00/0 01/0

1 1
input: x
11/1 10/0
0 0
1
state/output:
AB/y
22
23
Partitioning algorithm with state reduction:
Given:
0/0 PS NS Output
1/1 x=0 x=1 x=0 x=1
b a
0/0 0/1 a b c 0 0
e 1/0 b a c 0 0
1/0 0/1 f c c d 0 0
d a f 1 1
0/1 1/0
c d 1/1 e c a 1 1
f a c 1 1
0/0
1/1

1) Partition considering output values 2) Divide existing states so that all


(put states having same output row members of a new state set posses the
into the same set, and indicate the NS of same index in the previous step
each element in the set for each possible S21={a,b} NS: {a(1,2), b(1,2)}
input in terms of set index) S22={c} NS: {c (2,3)}
output (0,0): S11={a,b,c} NS: {a(1,1), b(1,1), c (1,2)} S23={d} NS: {d(1,4)}
output (1,1): S12={d, e,f} NS:{d(1, 2), e(1,1), f(1,1)} S24={e,f} NS: {e(2,1), f(1,2)}
3) Repeat 2 until no new sets are formed 4) No more split: a and b are equivalent,
S31={a,b} NS: {a(1,2), b(1,2)} resulting in totally 5 states
S32={c} NS: {c (2,3)} A={a,b}, B={c}, C={d}, D={e}, E={f}
S33={d} NS: {d(1,5)}
S34={e} NS: {e(2,1)}
S35={f} NS: {f(1,2)}
24

Partitioning algorithm with state reduction: (continues)


Given:
0/0 PS NS Output
1/1 x=0 x=1 x=0 x=1
b a
0/0 0/1 a b c 0 0
e 1/0 b a c 0 0
1/0 0/1 f c c d 0 0
0/1 d a f 1 1
1/0
c d 1/1 e c a 1 1
f a c 1 1
0/0
1/1

Reduced states: A={a,b}, B={c}, C={d}, D={e}, E={f}

State table and diagram after state reduction 0/0

PS NS Output 1/1 A
0/1
x=0 x=1 x=0 x=1 D 1/0
A A B 0 0 1/0 0/1 E
B B C 0 0 0/1 1/0
C A E 1 1 B C 1/1
D B A 1 1
0/0
E A B 1 1 1/1
25
26

State table and diagram before state assignment State assignment


PS NS Output 0/0
state assignment
x=0 x=1 x=0 x=1 1/1 A
0/1 Q1 Q2Q3
A A B 0 0
D 1/0 A 000
B B C 0 0 1/0 E
0/1 B 001
C A E 1 1
D B A 1 1 0/1 1/0 C 010
B C 1/1 D 011
E A B 1 1
E 100
0/0
1/1

State diagram and state table after assignment


0/0
PS NS Output 1/1 000
0/1
Q1Q2Q3 x=0 x=1 x=0 x=1
000 000 001 0 0 011 1/0
1/0 0/1 100
001 001 010 0 0
010 000 100 1 1 0/1 1/0
011 001 000 1 1 001 010 1/1
100 000 001 1 1 0/0
1/1
27

PS NS Output
x=0 x=1 x=0 x=1
a a b 0 0
b b c 0 0
c c c 0 1
28

PS NS Output
x=0 x=1 x=0 x=1
A A B 0 0
B B C 0 0
C C C 0 1

state assignment PS NS Output


Q1 Q2 Q1Q2 x=0 x=1 x=0 x=1
A 00 00 00 01 0 0
B 01 01 01 10 0 0
C 10 10 10 10 0 1
29

PS NS Output
Q1Q2 x=0 x=1 x=0 x=1
00 00 01 0 0
01 01 10 0 0
10 10 10 0 1

Q1 transition: Q1 Q2 transition: Q1
Q1Q2 Q1Q2
00 01 11 10 00 01 11 10
x x
00 00 x 11 00 11 x 00

x 00 01 x 11 x 01 10 x 00

Q2 Q2
30

Q1 transition: Q1 Q2 transition: Q1 FF Excitation Tables


Q 1Q 2 Q 1Q 2
00 01 11 10 00 01 11 10 Q(t)Q(t+1) D S R J K T
x x
00 00 x 11 00 11 x 00 00 0 0 x 0 x 0
01 1 1 0 1 x 1
x 00 01 x 11 x 01 10 x 00 10 0 0 1 x 1 1
11 1 x 0 x 0 0
Q2 Q2

i) Implementation with D FF:


Q1 Q1
States:
D1: D2:
0 0 x 1 0 1 x 0
D1= Q1+ xQ2
x 0 1 x 1 x 1 0 x 0 D2= xQ1Q2+ xQ2
Q2 Q2

Output: Q1
y:
0 0 x 0 (independent of FF type) y= xQ1
x 0 0 x 1

Q2
Q1 transition: Q1 Q2 transition: Q1 31
Q 1Q 2 Q 1Q 2 FF Excitation Tables
00 01 11 10 00 01 11 10
x x Q(t)Q(t+1) D S R J K T
00 00 x 11 00 11 x 00 00 0 0 x 0 x 0
x 00 01 x 11 01 10 x 00 01 1 1 0 1 x 1
x
10 0 0 1 x 1 1
11 1 x 0 x 0 0
Q2 Q2

ii) Implementation with SR FF:


Q1 Q1
States:
S1: R1:
0 0 x x x x x 0
S1= xQ2
x 0 1 x x x x 0 x 0 R1 = 0

Q2 Q2
Q1 Q1
S2: R2:
0 x x 0 x 0 x x
S2=xQ1Q2
R2= xQ2
x 1 0 x 0 x 0 1 x x

Q2 Q2

Output: same as in (i) before (independent of FF type) y= xQ1


Q1 transition: Q1 Q2 transition: Q1 32
Q 1Q 2 Q 1Q 2 FF Excitation Tables
00 01 11 10 00 01 11 10
x x Q(t)Q(t+1) D S R J K T
00 00 x 11 00 11 x 00 00 0 0 x 0 x 0
x 00 01 x 11 01 10 x 00 01 1 1 0 1 x 1
x
10 0 0 1 x 1 1
11 1 x 0 x 0 0
Q2 Q2

iii) Implementation with JK FF:

States: Q1 Q1
J 1: K1: J1= xQ2
0 0 x x x x x 0
K1= 0
x 0 1 x x x x x x 0

Q2 Q2
Q1 Q1
J 2: K2:
0 x x 0 x 0 x x J2=xQ1
K2=x
x 1 x x 0 x x 1 x x

Q2 Q2

Output: same as in (i) before (independent of FF type) y= xQ1


Q1 transition: Q1 Q2 transition: Q1 33
Q 1Q 2 Q 1Q 2 FF Excitation Tables
00 01 11 10 00 01 11 10
x x Q(t)Q(t+1) D S R J K T
00 00 x 11 00 11 x 00 00 0 0 x 0 x 0
x 00 01 x 11 01 10 x 00 01 1 1 0 1 x 1
x
10 0 0 1 x 1 1
11 1 x 0 x 0 0
Q2 Q2

iii) Implementation with T FF:

States: Q1 Q1
T1: T2: T1= xQ2
0 0 x 0 0 0 x 0 T2= xQ1
x 0 1 x 0 x 1 1 x 0

Q2 Q2

Output: same as in (i) before (independent of FF type) y= xQ1


34

x
y
J1 Q1 J2 Q2

C1 C2
0 K1 Q1 K2 Q2

CLK
35
36

1) Proposed state transition diagram 2) Corresponding state transition table


(there might be different solutions)
a PS NS Output
0/0 1/0 x=0 x=1 x=0 x=1
a b c 0 0
b c b a a 0 1
c a a 1 0

0/0 1/1 0/1 1/0

3) State reduction 4) State assignment


Step1: PS NS Output
output (0,0): S11={a} NS: {a(2,3)} Q1Q2 x=0 x=1 x=0 x=1
output (0,1): S12={b} NS:{b(1, 1)} A 00 01 10 0 0
output (1,0): S12={c} NS:{c(1, 1)} B 01 00 00 0 1
Step2: No more split: C 10 00 00 1 0
A={a}, B={c}, C={c}
37
5) Implementation with T FF
Q1 transition: Q1 Q2 transition: Q1
Q1Q2 Q1Q2 T FF Excitation Table
00 01 11 10 00 01 11 10
x x
00 00 x 10 x Q(t)Q(t+1) T
01 10 00
00 0
x 01 00 x 10 x 00 10 x 00 01 1
10 1
Q2 Q2 11 0
Q1 Q1
T1: T2:
0 0 x 1 1 1 x 0 T1=Q1+xQ2
T2=xQ1+Q2
x 1 0 x 1 x 0 1 x 0

Q2 Q2

6) Find output 7) Draw circuit yourself


Q1
y:
0 0 x 1
y=xQ2+xQ1
x 0 1 x 0

Q2
38

1) state transition diagram 2) state transition table


0/0 PS NS Output
0/0 0/0
0/0 x=0 x=1 x=0 x=1
e1 1/0 e2 1/0 e3 s e1 o1 0 0
s 1/1
1/0 1/0 0/1 e1 e2 o2 0 0
1/0 o1 o2 e2 0 0
o1 0/0 o2 0/0 o3 e2 e3 o3 0 0
1/0
o2 o3 e3 0 0
Notation: e3 s s 0 1
s: start state ei: even at step I oi: odd at step i o3 s s 1 0

3) State reduction: show that there is no 4) State assignment


equivalent states, so no state reduction
PS NS Output
Q1Q2Q3 x=0 x=1 x=0 x=1
s 000 001 010 0 0
5-7) Choose a flip flop type and do the e1 001 011 100 0 0
implementation yourself o1 010 100 011 0 0
e2 011 101 110 0 0
o2 100 110 101 0 0
e3 101 000 000 0 1
o3 110 000 000 1 0
39

Time: 8 7 6 5 4 3 2 1
Xd: 0 1 0 1 0 1 0 0
Xf: 1 0 0 0 0 0 0 0
y: 1 0 0 0 0 0 0 0

1) state transition diagram 2) state transition table


10/0,11/1 PS NS Output
00/0
00 01 10 11 00 01 10 11
e
00/0 s e o s s 0 0 0 1
e e o s s 0 0 0 1
10/0, s 01/0 01/0 o o e s s 0 0 1 0
11/1
01/0 3) State reduction:
o
00/0 S11={s,e} NS: {s(1,2,1,1), e(1,2,1,1)} : A
10/1,11/0 S12={o} NS: {o(2,1,1,1)} :B
4) State assignment
01/0
PS NS Output 00/0,
10/0, 0 1 00/0
Q1 00 01 10 11 00 01 10 11
A: 0 0 1 0 0 0 0 0 1 11/1 01/0,10/1,11/0
B: 1 1 0 0 0 0 0 1 0

5-7) Choose a flip flop type and do the implementation yourself


40

BCD PS NS
considering considering output (z)
XnXn-1Xn-2 Xn-3 Xn-1Xn-2 Xn-3 XnXn-1Xn-2
Xn=0 Xn =1 Xn=0 Xn=1 Xn=0 Xn=1
0000 1000 S0 (000) S0 (000) S4 (100) 0 0
0001 1001 S1 (001) S0 (000) S4 (100) 0 0
0010 1010 S2 (010) S1 (001) S5 (101) 0 1
0011 1011 S3 (011) S1 (001) S5 (101) 0 1
0100 1100 S4 (100) S2 (010) S6 (110) 0 1
0101 1101 S5 (101) S2 (010) S6 (110) 0 1
0110 1110 S6 (110) S3 (011) S7 (111) 0 1
0111 1111 S7 (111) S3 (011) S7 (111) 0 1
41

2) state transition table 3) state reduction


PS NS output (z) Step1:
Xn=0 Xn=1 Xn+1=0 Xn+1=1 S11={S0,S1} NS: {S0(1,2), S1(1,2)}
1
S 2={S2,S3,S4,S5,S6,S7 } NS: {S2(1,2), S3(1,2), S4(2,2),
S0 S0 S4 0 0
S1 S0 S4 0 0 S5(2,2), S6(2,2), S7(2,2)}
S2 S1 S5 0 1 Step2:
S3 S1 S5 0 1 S21={S0,S1} NS: {S0(1,2), S1(1,2)}
S4 S2 S6 0 1
S22={S2,S3} NS: {S2(1,3), S3(1,3)}
S5 S2 S6 0 1 2
S6 S3 S7 0 1 S 3={S4,S5,S6,S7 } NS:{S4(2,3), S5(2,3), S6(2,3), S7(2,3)}
S7 S3 S7 0 1 Step3: No more split, stop
A: S21={S0,S1} B: S22={S2,S3} C: S23={S4,S5,S6,S7 }
4) State assignment 5-7) Choose a flip flop type and do the implementation
PS NS Output (z) yourself
Q1Q2 x=0 x=1 x=0 x=1
A: 00 00 10 0 0
B: 01 00 10 0 1
C: 10 01 10 0 1
42

Example: n=8
Three inputs: xfxAxB yAyB representation Time: 1 2 3 4 5 6 7 8
Two output: yAyB: 00 no decision yet XA: 0 1 0 1 0 1 0 0
01 A<B XB: 0 1 0 0 1 1 1 1
10 A>B Xf: 0 0 0 0 0 0 0 1
11 A=B yA: 0 0 0 0 0 0 0 1
yB: 0 0 0 0 0 0 0 0
Example: (continues) 43

1)State diagram 0--/00

1--/01
xfxAxB/yAyB: SA<B
001/00 001/00
000/00
100/11,111/11, 000/00,011/000 011/00
s SA=B
101/01,110/10
010/00 010/00
SA>B 100/11,111/11,
1--/10 101/01,110/10
0--/00

2) PS NS Output (yA,yB)
000 001 010 011 100 101 110 111 000 001 010 011 100 101 110 111
S SA=B SA<B SA>B SA=B S S S S 00 00 00 00 11 01 10 11
SA<B SA<B SA<B SA<B SA<B S S S S 00 00 00 00 01 01 01 01
SA=B SA=B SA<B SA>B SA=B S S S S 00 00 00 00 11 01 10 11
SA>B SA>B SA>B SA>B SA>B S S S S 00 00 00 00 10 10 10 10

3-7) State reduction: Show that the states S and SA=B are equivalent,
and then do the rest yourself
Example: Design a serial n bit magnitude comparator same as above, except LSB
being first in time and xf is an MSB indicator (i.e. it is 1 when MSB arrives)

You might also like