Docsity

State Machines Analysis Examples - Digital Logic | ECE 240, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
COE/EE 243
Digital Logic Session 34; Page 1/5
Spring 2003
EE/CompE 243
State Machine Analysis Examples
1. For the state machine shown in the figure below do the following:
(a) Find the excitation equations for the flip-flops. Then construct a transition table, a state table,
and a state diagram. Is this a Moore Machine or a Mealy Machine?
(b) What is the output sequence when the input sequence is X=01100?
(c) Draw a timing diagram for the input sequence from part (b). Show Pc, X, A, B and Z. Assume
input changes between clock pulses.
CK
Ka Ja
A/A
B’
CK
/B B
JbKb
Z
CLK
X’ A’X’
B
X
(a) Derive state equations
JA

X
¼
B
¼
XB
¼
¼
¼
X
¼
B
XB
¼
KA
X
¼
B
JB

X
¼
A
¼
¼
XA
KB

X
¼
A
¼
¼
XA
A

JAQ
¼
K
¼
AQ
X
¼
B
XB
¼
A
¼

X
¼
B
¼
A
A
¼
BX
¼
A
¼
B
¼
X
AX
AB
¼
B

JBQ
¼
K
¼
BQ
XAB
¼

XA
¼
B
pf3
pf4
pf5

Partial preview of the text

Download State Machines Analysis Examples - Digital Logic | ECE 240 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Digital Logic Spring 2003

EE/CompE 243 State Machine Analysis Examples

1. For the state machine shown in the figure below do the following:

(a) Find the excitation equations for the flip-flops. Then construct a transition table, a state table, and a state diagram. Is this a Moore Machine or a Mealy Machine? (b) What is the output sequence when the input sequence is X=01100? (c) Draw a timing diagram for the input sequence from part (b). Show Pc , X, A, B and Z. Assume input changes between clock pulses.

CK Ka Ja

/A A

B’

CK

/B B

Kb Jb

Z

CLK

X’ X’ A’ B

X

(a) Derive state equations

JA  X B   XB   X B  XB KA X B JB  X  A  XA KB  X  A  XA A  JA Q  K A Q  X B  XB  A   X B  A A BX  A B X  AX  AB B  JB Q  K B Q XAB   XA  B

Digital Logic Spring 2003

AB X  BX  A B Z  A  B  AB

It is a Moore machine, since Z only depends on A, B not on X

Present State Next State (A+B+) AB X=0 X = 1 Z 00 00 10 0 01 11 01 0 11 01 10 1 10 10 11 0

Present State Next State (A+B+) AB X=0 X = 1 Z S0 S0 S3 0 S1 S2 S1 0 S2 S1 S3 1 S3 S3 S2 0

S Z=

(^0) Z=0 Z=

S

S Z=

S

0

1

1

0

(^10) 1

(b) Based on the state/output diagram above, we see that Z will be 1 only when AB 11. Note also that we can consider the initial output for Z to be a false output until the first falling edge of the clock. So we get Z  0 00101 as shown in the figure below. (c) Timing diagram for network:

Z

Propagation delay is assumed to be 0.

Pc

X

A

B

Digital Logic Spring 2003

b. Draw a timing diagram for the network. Show X, clock, Q1, Q2, and Q3. Use the input sequence X=01011 and assume that X changes midway between clock pulses. Indicate any false output changes.

Clock

False

Z

Q

Q

Q

X

c. Compare output sequence from timing diagram with the one predicted by the state diagram. From timing diagram: 0 1 (0) 1 0 1 From state diagram: 0 1 1 0 1 d. How can you correct the difference? By changing input on falling edge of the clock the false outputs can be eliminated.

3. A Mealy synchronous state machine has 1 input, 1 output and 2 flip-flops. A timing diagram is shown below. Construct a state table and a state diagram

Z

X

A

B

Clock

Propagation delay is assumed to be 0 division

Since the timing diagram shown here is for a Mealy sequential network, we know that the Mealy network depends on both the present state and the inputs. For this network X is the input and Z is the output and Q 1 , Q 2 represent the present states.

Digital Logic Spring 2003

The state table can be constructed by simply finding the output value(Z) for various input combi- nations from the timing diagram.

Present State Next State ( Q 1  Q 2 ) Z 1 Z 2 Q 1 Q 2 X=0 X=1 X=0 X= 00 01 10 1 0 01 00 11 0 1 10 11 00 1 0 11 10 01 0 1

Present State Next State ( Q 1  Q 2 ) Z 1 Z 2 Q 1 Q 2 X=0 X=1 X=0 X= S0 S1 S2 1 0 S1 S0 S3 0 1 S2 S3 S0 1 0 S3 S2 S1 0 1

S

S

S

1 / 0 1 / 0

0 / 1

0 / 0

0 / 0

0 / 1

1 / 1 1 / 1

S