seq notes8

36
      COSC3410  Analysis and Design of Sequential Circuits: Examples   J. C. Huang Department of Computer Science University of Houston Sequential machine slide 1

Upload: markolz

Post on 08-Apr-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 1/36

 

 

  

 

 COSC3410

 

Analysis and Design of Sequential Circuits:Examples

 

 J. C. Huang 

Department of Computer Science

University of Houston 

Sequential machine slide 1

Page 2: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 2/36

combi-

national

circuit

inputs outputs

memory elements

 The block diagram of a sequential circuit

 

Sequential machine slide 2

Page 3: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 3/36

 

 

comb.network 

B'

B

A'

A

D

D

y = (A+B)x'x

DA=xA+xB

DB=xA'

Block diagram for the sequential circuit shown in Fig. 6-16 

Sequential machine slide 3

Page 4: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 4/36

comb.

network 

B'

B

A'

A

J

J

x

Sequential circuit implemented with JK flip-flops (Fig. 6-19)

JA = BKA = Bx'JB = x'

KB = A'x + Ax'

KA

JA

KBJB

Sequential machine slide 4

Page 5: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 5/36

An example analysis problem: 

 

Given the sequential circuit depicted below, construct the state

table that describe its behavior. 

 

comb.

network 

B'

B

A'

A

J

J

x

KA

JA

KB

JB JA = BKA = Bx'

JB = x'KB = A'x + Ax'

  

 

next statepresent state x = 0 x = 1A(t)B(t)

0 0 

A(t+1)B(t+1)

A(t+1)B(t+1)

0 1 ? ?

1 0 ? ?

1 1 ? ? 

 

Sequential machine slide 5

Page 6: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 6/36

Steps involved:

 

1. Construct the truth table of the combinational network to

determine the output and the input to the flip-flops.2. Use the characteristic table of the flip-flops to determine the

next states.

Sequential machine slide 6 

Page 7: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 7/36

comb.

network 

B'

B

A'

A

J

J

x

Sequential circuit implemented with JK flip-flops (Fig. 6-19)

JA = BKA = Bx'JB = x'

KB = A'x + Ax'

KA

JA

KBJB

  

Step 1: construct the truth table of the combinational network.

 

x A B JA KA JB KB0 0 0 0 0 1 0

0 0 1 1 1 1 0

0 1 0 0 0 1 1

0 1 1 1 1 1 1

1 0 0 0 0 0 1

1 0 1 1 0 0 1

1 1 0 0 0 0 01 1 1 1 0 0 0

 

Sequential machine slide 7 

Page 8: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 8/36

Step 2: extend the truth table to inclues contents of flip-flops at time t+1.

 

x A B JA KA JB KB A(t+1) B(t+1)

0 0 0 0 0 1 0  

0 0 1 1 1 1 0  0 1 0 0 0 1 1  

0 1 1 1 1 1 1  

1 0 0 0 0 0 1  

1 0 1 1 0 0 1  

1 1 0 0 0 0 0  

1 1 1 1 0 0 0  

 

Sequential machine slide 8

Page 9: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 9/36

Step 2.1:  find A(t+1), with the help of a characteristic table.

 

x A B JA KA JB KB A(t+1) B(t+1)

0 0 0 0 0 1 0 0

0 0 1 1 1 1 0 10 1 0 0 0 1 1 1

0 1 1 1 1 1 1 0

1 0 0 0 0 0 1 0

1 0 1 1 0 0 1 1

1 1 0 0 0 0 0 1

1 1 1 1 0 0 0 1

  

The characteristic table of a JK flip-flop

 

J K Q(t+1)

0 0 Q(t) no change

0 1 0 reset

1 0 1 set

1 1 Q'(t) complement 

Sequential machine slide 9

Page 10: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 10/36

Step 2.2: find B(t+1), with the help of a characteristic table.

 

x A B JA KA JB KB A(t+1) B(t+1)

0 0 0 0 0 1 0 0 1

0 0 1 1 1 1 0 1 10 1 0 0 0 1 1 1 1

0 1 1 1 1 1 1 0 0

1 0 0 0 0 0 1 0 0

1 0 1 1 0 0 1 1 0

1 1 0 0 0 0 0 1 0

1 1 1 1 0 0 0 1 1

  

The characteristic table of a JK flip-flop

 

J K Q(t+1)

0 0 Q(t) no change

0 1 0 reset

1 0 1 set

1 1 Q'(t) complement 

 

Sequential machine slide 10

Page 11: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 11/36

Step 2.3: final step.

 

x A B JA KA JB KB A(t+1) B(t+1)

0 0 0 0 0 1 0 0 1

0 0 1 1 1 1 0 1 10 1 0 0 0 1 1 1 1

0 1 1 1 1 1 1 0 0

1 0 0 0 0 0 1 0 0

1 0 1 1 0 0 1 1 0

1 1 0 0 0 0 0 1 0

1 1 1 1 0 0 0 1 1

 Reconstruct the state table to yield

 

next state

present state x = 0 x = 1A(t)B(t)

0 0 

A(t+1)B(t+1)

0 1 

A(t+1)B(t+1)

0 0 

0 1 1 1 1 0

1 0 1 1 1 01 1 0 0 1 1

 

 

Sequential machine slide 11

Page 12: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 12/36

Mealy and Moore Models

 

There are two models of sequential circuit:

 

Mealy Model:  the outputs are functions of both the present states and inputs. 

Moore Model:  the outputs are a function of the present state only.

 

Example:

 

Sequential machine slide 12

Page 13: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 13/36

State Reduction 

 

Two states are said to be equivalent if, for each possible single input, they give

exactly the same output and send the circuit either to the same state or to an

equivalent state.

 

When two states are equivalent in this sense, one of them can be removed without

altering the input-output relations.

Sequential machine slide 13

Page 14: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 14/36

Design Steps

 

1. Obtain the word description of the desired circuit behavior.

2. Construct the state table of the desired circuit.

3. Reduce the number of state to the extent possible (state reduction).

4. Assign a bit pattern to each state (state assignment).

5. Determine the no. of flip-flops needed and assign a letter symbol to each.

6. Choose the type of flip-flop to be used.

7. Derive the truth table of the required combinational circuit from the state table.

8. Simplify the combinational circuit.9. Draw the logic diagram.

Sequential machine slide 14

Page 15: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 15/36

Design Example:

 

Suppose we are given a word description of the desired circuit behavior, and it is

translated into the following state table (Step 2):

 

present

state

next state output

x=0 x=1 x=0 x=1

a f b 0 0

b d c 0 0

c f e 0 0

d g a 1 0

e d c 0 0

f g d 0 1

g g h 0 1

h g a 1 0

Sequential machine slide 15

Page 16: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 16/36

Design Example:

 

The number of state can be reduced to 4 (Step 3):

 

present

state

next state output

x=0 x=1 x=0 x=1

a f b 0 0

b d a   0 0

b

d f   a 1 0

a

f f   d 0 1

d

 

Sequential machine slide 16 

Page 17: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 17/36

Design Example:

 

The reduced state table (State 3):

 

present

state

next state output

x=0 x=1 x=0 x=1

a f b 0 0

b d a 0 0

d f a 1 0

f f d 0 1

Sequential machine slide 17 

Page 18: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 18/36

Design Example:

 

A possible state assignment (State 4):

 

present

state

next state output

x=0 x=1 x=0 x=1

a f b 0 0

b d a 0 0

d f a 1 0

f f d 0 1

 

00→ a   01→ b   10→ d   11→ f 

 

present

state

next state output

x=0 x=1 x=0 x=1

A B

0 0

A(t+1)B(t+1) 

1 1

A(t+1)B(t+1)

0 1

y(t)

0

y(t)

0

0 1 1 0 0 0 0 0

1 0 1 1 0 0 1 0

1 1 1 1 1 0 0 1

Sequential machine slide 18

Page 19: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 19/36

Design Example

 

This state table can be implemented by a sequential circuit of the form depicted

below using D type flip-flops (Steps 5 and 6):

 

comb.

network 

B'

B

A'

A

D

D

y=?x

DA=?

DB=?

 

Sequential machine slide 19

Page 20: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 20/36

Reconstruct the state table

present

state

next state output

x=0 x=1 x=0 x=1A B

0 0

A(t+1)B(t+1) 

1 1

A(t+1)B(t+1)

0 1

y(t)

0

y(t)

0

0 1 1 0 0 0 0 0

1 0 1 1 0 0 1 0

1 1 1 1 1 0 0 1

 

in preparation for expanding it into a truth table of the combinational network 

required (Step 7):

x A(t) B(t) A(t+1) B(t+1) y(t)

0 0 0 1 1 0

0 0 1 1 0 0

0 1 0 1 1 1

0 1 1 1 1 0

1 0 0 0 1 0

1 0 1 0 0 0

1 1 0 0 0 0

1 1 1 1 0 1

 

Sequential machine slide 20

Page 21: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 21/36

Expand the state table into the truth table of the combinational network (Step 7):

x A(t) B(t) A(t+1) B(t+1) DA DB y(t)

0 0 0 1 1 1 0

0 0 1 1 0 1 0

0 1 0 1 1 1 1

0 1 1 1 1 1 0

1 0 0 0 1 0 0

1 0 1 0 0 0 0

1 1 0 0 0 0 0

1 1 1 1 0 1 1

 

Excitation table of a D type flip-flop

Q(t) Q(t+1) D(t)

0 0 00 1 1

1 0 0

1 1 1 

Sequential machine slide 21

Page 22: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 22/36

Expand the state table into the truth table of the combinational network (Step 7):

x A(t) B(t) A(t+1) B(t+1) DA DB y(t)

0 0 0 1 1 1 1 0

0 0 1 1 0 1 0 0

0 1 0 1 1 1 1 1

0 1 1 1 1 1 1 0

1 0 0 0 1 0 1 0

1 0 1 0 0 0 0 0

1 1 0 0 0 0 0 0

1 1 1 1 0 1 0 1

 

Excitation table of a D type flip-flop

Q(t) Q(t+1) D(t)

0 0 00 1 1

1 0 0

1 1 1 

Sequential machine slide 22

Page 23: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 23/36

Simplify the Boolean functions that describe the outputs of the combinational

network (Step 8):

 

A'B' A'B AB AB'

x' 1 1 1 1

x 0 0 1 0 DA = x' + AB

 

A'B' A'B AB AB'

x' 1 0 1 1

x 1 0 0 0 DB = x'A + A'B'

 

A'B' A'B AB AB'

x' 0 0 0 1

x 0 0 1 0 y = x'AB' + xAB

Sequential machine slide 23

Page 24: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 24/36

Design Example

 

This state table can be implemented by a sequential circuit of the form depicted

below using JK flip-flops (Steps 5 and 6):

 

comb.

network 

B'B

A'

A

J

J

xKA=?

JA=?

KB=?

JB=?

y=?

 

Sequential machine slide 24

Page 25: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 25/36

Again, start with the state table:

x A(t) B(t) A(t+1) B(t+1) y(t)

0 0 0 1 1 0

0 0 1 1 0 0

0 1 0 1 1 1

0 1 1 1 1 0

1 0 0 0 1 0

1 0 1 0 0 0

1 1 0 0 0 0

1 1 1 1 0 1

 

Sequential machine slide 25

Page 26: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 26/36

In preparation for constructing the truth table of the required combinational circuit,

expand the state table to include the columns for inputs to the flip-flops:

x A(t) B(t) A(t+1) B(t+1) JA KA JB KB y(t)

0 0 0 1 1         0

0 0 1 1 0         0

0 1 0 1 1         1

0 1 1 1 1         0

1 0 0 0 1         0

1 0 1 0 0         0

1 1 0 0 0         0

1 1 1 1 0         1

 

Sequential machine slide 26 

Page 27: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 27/36

With the help of an excitation table find inputs to flip-flop A (Step 7):

x A(t) B(t) A(t+1) B(t+1) JA KA JB KB y(t)

0 0 0 1 1 1 X 0

0 0 1 1 0 1 X 0

0 1 0 1 1 X 0 1

0 1 1 1 1 X 0 0

1 0 0 0 1 0 X 0

1 0 1 0 0 0 X 0

1 1 0 0 0 X 1 0

1 1 1 1 0 X 0 1

 

Excitation table of a JK flip-flop

Q(t) Q(t+1) J(t) K(t)

0 0 0 X0 1 1 X

1 0 X 1

1 1 X 0

Sequential machine slide 27 

Page 28: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 28/36

With the help of an excitation table find inputs to flip-flop B (Step 7):

x A(t) B(t) A(t+1) B(t+1) JA KA JB KB y(t)

0 0 0 1 1 1 X 1 X 0

0 0 1 1 0 1 X X 1 0

0 1 0 1 1 X 0 1 X 1

0 1 1 1 1 X 0 X 0 0

1 0 0 0 1 0 X 1 X 0

1 0 1 0 0 0 X X 1 0

1 1 0 0 0 X 1 0 X 0

1 1 1 1 0 X 0 X 1 1

 

Excitation table of a JK flip-flop

Q(t) Q(t+1) J(t) K(t)

0 0 0 X0 1 1 X

1 0 X 1

1 1 X 0

Sequential machine slide 28

Page 29: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 29/36

Simplify the outputs of the combinational network (Step 8):

A'B' A'B AB AB'

x' 1 1 X X

x 0 0 X X JA = x'

 

A'B' A'B AB AB'

x' X X 0 0

x X X 0 1 KA = xB'

 

A'B' A'B AB AB'

x' 1 X X 1

x 1 X X 0 JB = x' + A'

 

A'B' A'B AB AB'

x' X 1 0 X

x X 1 1 X KB = x + A'

 

A'B' A'B AB AB'

x' 0 0 0 1

x 0 0 1 0 y = x'AB' + xAB

 

 

 

Sequential machine slide 29

Page 30: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 30/36

Design of a 4-bit synchronous up counter 

 

The state table

 

presentstate

(at time t)

nextstate

(at t+1)

A4 A3 A2 A1 

0 0 0 0 

A4 A3 A2 A1 

0 0 0 1 

0 0 0 1 0 0 1 0 

0 0 1 0 0 0 1 1 

0 0 1 1 0 1 0 0 

0 1 0 0 0 1 0 1 

0 1 0 1 0 1 1 0 

0 1 1 0 0 1 1 1 

0 1 1 1 1 0 0 0 

1 0 0 0 1 0 0 1 

1 0 0 1 1 0 1 0 

1 0 1 0 1 0 1 1 

1 0 1 1 1 1 0 0 

1 1 0 0 1 1 0 1 

1 1 0 1 1 1 1 0 

1 1 1 0 1 1 1 1 

1 1 1 1 0 0 0 0 

Sequential machine slide 30

Page 31: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 31/36

The block diagram

 

 

J

K

A1

A'1

J

K

A2

A'2

J

K

A3

A'3

J

K

A4

A'4

combinationalnetwork

KA4

JA1

CP  

Sequential machine slide 31

Page 32: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 32/36

The excitation function for the four JK flip-flops

 

present

state

(at time t)

next

state

(at t+1)

 

 

JA1 

 

 

KA1

 

 

JA2 

 

 

KA2

 

 

JA3 

 

 

KA3

 

 

JA4 

 

 

KA4

A4 A3 A2 A1 

0 0 0 0 

A4 A3 A2 A1 

0 0 0 1 

 

1

 

X

 

0

 

X

 

0

 

X

 

0

 

X

0 0 0 1 0 0 1 0  X 1 1 X 0 X 0 X

0 0 1 0 0 0 1 1  1 X X 0 0 X 0 X

0 0 1 1 0 1 0 0  X 1 X 1 1 X 0 X

0 1 0 0 0 1 0 1  1 X 0 X X 0 0 X

0 1 0 1 0 1 1 0  X 1 1 X X 0 0 X0 1 1 0 0 1 1 1  1 X X 0 X 0 0 X

0 1 1 1 1 0 0 0  X 1 X 1 X 1 1 X

1 0 0 0 1 0 0 1  1 X 0 X 0 X X 0

1 0 0 1 1 0 1 0  X 1 1 X 0 X X 0

1 0 1 0 1 0 1 1  1 X X 0 0 X X 0

1 0 1 1 1 1 0 0  X 1 X 1 1 X X 0

1 1 0 0 1 1 0 1  1 X 0 X X 0 X 0

1 1 0 1 1 1 1 0  X 1 1 X X 0 X 0

1 1 1 0 1 1 1 1  1 X X 0 X 0 X 0

1 1 1 1 0 0 0 0  X 1 X 1 X 1 X 1

Sequential machine slide 32

Page 33: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 33/36

From the truth table we see that the desired inputs to the flip-flops can be

simplified to

 

JA1 = 1 

KA1= 1

 

JA2 = A1 

 

KA2= A1 

 

JA3 = A2A1 

 

KA3= A2A1  

JA4 = A3A2A1 

 

KA4= A3A2A1 

 

and hence the logic diagram shown in Fig. 7-17.

 

Note that if we let JA1 = KA1 = 0 then none of the flip-flop will change its state,

and therefore we can use it to stop (i.e., to disable) the counter.

Sequential machine slide 33

Page 34: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 34/36

Design of a 4-bit synchronous down counter 

 

The state table

 

presentstate

(at time t)

nextstate

(at t+1)

A4 A3 A2 A1 

0 0 0 0

A4 A3 A2 A1 

1 1 1 1

0 0 0 1 0 0 0 0

0 0 1 0 0 0 0 1

0 0 1 1 0 0 1 0

0 1 0 0 0 0 1 1

0 1 0 1 0 1 0 0

0 1 1 0 0 1 0 1

0 1 1 1 0 1 1 0

1 0 0 0 0 1 1 1

1 0 0 1 1 0 0 0

1 0 1 0 1 0 0 1

1 0 1 1 1 0 1 0

1 1 0 0 1 0 1 1

1 1 0 1 1 1 0 0

1 1 1 0 1 1 0 1

1 1 1 1 1 1 1 0

Sequential machine slide 34

Page 35: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 35/36

The excitation function for the four JK flip-flops

 

present

state

(at time t)

next

state

(at t+1)

 

 

JA1 

 

 

KA1

 

 

JA2 

 

 

KA2

 

 

JA3 

 

 

KA3

 

 

JA4 

 

 

KA4

A4 A3 A2 A1 

0 0 0 0

A4 A3 A2 A1 

1 1 1 1

 

1

 

X

 

1

 

X

 

1

 

X

 

1

 

X

0 0 0 1 0 0 0 0 X 1 0 X 0 X 0 X

0 0 1 0 0 0 0 1 1 X X 1 0 X 0 X

0 0 1 1 0 0 1 0 X 1 X 0 0 X 0 X

0 1 0 0 0 0 1 1 1 X 1 X X 1 0 X

0 1 0 1 0 1 0 0 X 1 0 X X 0 0 X0 1 1 0 0 1 0 1 1 X X 1 X 0 0 X

0 1 1 1 0 1 1 0 X 1 X 0 X 0 0 X

1 0 0 0 0 1 1 1 1 X 1 X 1 X X 1

1 0 0 1 1 0 0 0 X 1 0 X 0 X X 0

1 0 1 0 1 0 0 1 1 X X 1 0 X X 0

1 0 1 1 1 0 1 0 X 1 X 0 0 X X 0

1 1 0 0 1 0 1 1 1 X 1 X X 1 X 0

1 1 0 1 1 1 0 0 X 1 0 X X 0 X 0

1 1 1 0 1 1 0 1 1 X X 1 X 0 X 0

1 1 1 1 1 1 1 0 X 1 X 0 X 0 X 0

Sequential machine slide 35

Page 36: seq notes8

8/7/2019 seq notes8

http://slidepdf.com/reader/full/seq-notes8 36/36

From the truth table we see that the desired inputs to the flip-flops can be

simplified to

 

JA1 = 1 

KA1= 1

 

JA2 = A'1 

 

KA2= A'1 

 

JA3 = A'2A'1 

 

KA3= A'2A'1  

JA4 = A'3A'2A'1 

 

KA4= A'3A'2A'1 

 

This is reflected in the logic diagram shown in Fig. 7-18.  Note that this design can

be directly translated into a T flip-flop implementation because the J input to every

flip-flop is identical to its K input.