Lecture 10: Sequential Networks: Implementation (Review) CSE 140: - - PowerPoint PPT Presentation

lecture 10
SMART_READER_LITE
LIVE PREVIEW

Lecture 10: Sequential Networks: Implementation (Review) CSE 140: - - PowerPoint PPT Presentation

Lecture 10: Sequential Networks: Implementation (Review) CSE 140: Components and Design Techniques for Digital Systems Spring 2014 CK Cheng, Diba Mirza Dept. of Computer Science and Engineering University of California, San Diego 1


slide-1
SLIDE 1

Lecture 10: Sequential Networks: Implementation

(Review) CSE 140: Components and Design Techniques for Digital Systems Spring 2014

CK Cheng, Diba Mirza

  • Dept. of Computer Science and Engineering

University of California, San Diego

1

slide-2
SLIDE 2

Universal*Gates*(review)*

  • Is*the*following*func7on*a*universal*set*

****f(x,y)*=*xy*+x’y’* ****A.*Yes* ****B.*No* * *

2

slide-3
SLIDE 3

Universal*Gates*(review)*

  • Is*the*following*func7on*a*universal*set*

****f(x,y,z)*=*xyz*+x’y’z’* ****A.*Yes* ****B.*No* * *

3

slide-4
SLIDE 4

Moore Design

Output is a function of present state only

slide-5
SLIDE 5

Mealy Design

Output is a function of present state and input

slide-6
SLIDE 6

Implementation Procedure

  • 1. Draw*State*Diagram*[Mealy*or*Moore*as*required]**

* 2.*Assign*the*state,*input,*output*encoding* * 3.*Draw*State*Transi7on*Table** * 4.*Derive*Boolean*Expressions* * 5.*Draw*circuit** *

slide-7
SLIDE 7

7

Pattern Recognizer: A sequential machine has a binary input x in {a,b}. For x(t-2, t) = baa, the output y(t) = 1, otherwise y(t) = 0. Implement the corresponding circuit using JK flip flops Draw the Moore and Mealy state diagram

slide-8
SLIDE 8

STEP 1 : Moore State Diagram

S1 S0 b b b a

S2

a a

S3 1

a b

Moore Machine

C1 C2

CLK x(t) y(t) S(t)

slide-9
SLIDE 9

STEP 1 : Mealy State Diagram

S1 S0

b/0 b/0 b/0 a/1

S2

a/0 a/0

Mealy Machine

C1 C2

CLK x(t) y(t) S(t)

Looking for baa

slide-10
SLIDE 10

STEP 2 : State, Input and Output Encoding

S1 S0

b/0 b/0 b/0 a/1

S2

a/0 a/0 State Encoding S0: S1: S2: Input Encoding a: 0 b: 1 PI Q: How many binary variables are needed to encode the states in the above diagram

  • A. Three
  • B. Two
  • C. One
slide-11
SLIDE 11

STEP 3: State Table

01 00

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

10

0/0 0/0 State Encoding Q1 Q0 S0: 0 0 S1: 0 1 S2: 1 0

X(t) Q1(t) Q0(t) 0 0 1 0 0 0 1 1 0 1 1 0 1 1 0

slide-12
SLIDE 12

STEP 3: State Table

State Assignment Q1 Q0 S0: 0 0 S1: 0 1 S2: 1 0

id x(t) Q1(t) Q0(t) Q1(t+1) Q0(t+1) y(t) 0 0 0 0 1 1 0 0 0 1 2 0 1 1 0 3 1 0 1 0 1 4 1 0 0 0 1 5 1 1 0 0 1 01 00

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

10

0/0 0/0

slide-13
SLIDE 13

id x(t) Q1(t) Q0(t) Q1(t+1) Q0(t+1) y(t) …… …… …… …... 0 0 ……………...... ....................... 0 0 ………………… ………………… .………….... …………….

Mapping the variables to the Mealy circuit

C1 C2

slide-14
SLIDE 14

id x(t) Q1(t) Q0(t) Q1(t+1) Q0(t+1) y(t) … … …... ....... 0 0 ………… …............. 0 0 …………………… ……………… ………….... ……………

Excitation table using JK flip flop

C1 C2 JK

x(t) y(t) Q1(t)

JK

Q0(t)

slide-15
SLIDE 15

Excitation table using JK flip flop

id x(t) Q1(t) Q0(t) J0(t) K0(t) J1(t) K1(t) Q1(t+1) Q0(t+1) y(t) 0 0 0 0 1 1 0 0 0 1 2 0 1 1 0 3 1 0 1 0 1 4 1 0 0 0 1 5 1 1 0 0 1

0-

  • 1

1 1-

1 PS NS Q(t) Q(t+1)

JK PI Q: Which of the following completely specifies the value of J0(t) in the above table?

  • A. Q0(t)
  • B. Q1(t), Q0(t)
  • C. Q0(t), Q0(t+1)
  • D. None of the above
slide-16
SLIDE 16

Excitation table using JK flip flop

id x(t) Q1(t) Q0(t) J0(t) K0(t) J1(t) K1(t) Q1(t+1) Q0(t+1) y(t) 0 0 0 X 0 X 0 0 1 1 0 0 1 X 0 X 0 1 2 0 1 X 1 1 X 1 0 3 1 0 1 X 0 0 X 0 1 4 1 0 0 X X 1 0 0 1 5 1 1 0 1 X X 1 0 1

0-

  • 1

1 1-

1 PS NS Q(t) Q(t+1)

JK

slide-17
SLIDE 17

STEP 4, 5: Boolean Expressions, Circuit

C1 C2 JK

x(t) y(t) Q1(t)

JK

Q0(t) id x(t) Q1(t) Q0(t) J0(t) K0(t) J1(t) K1(t) Q1(t+1) Q0(t+1) y(t) … … …... ....... 0 0 ………… …............. 1 0 0 1 0 0 …………………… ……………… ………….... ……………

slide-18
SLIDE 18

id x(t) Q1(t) Q0(t) J0(t) K0(t) J1(t) K1(t) Q1(t+1) Q0(t+1) y(t) 0 0 0 X 0 X 0 0 1 1 0 0 1 X 0 X 0 1 2 0 1 X 1 1 X 1 0 3 1 0 1 X 0 0 X 0 1 4 1 0 0 X X 1 0 0 1 5 1 1 0 1 X X 1 0 1

STEP 4: Boolean Expressions

0 2 6 4 1 3 7 5

K-map for J0(t):

slide-19
SLIDE 19

id x(t) Q1(t) Q0(t) J0(t) K0(t) J1(t) K1(t) Q1(t+1) Q0(t+1) y(t) 0 0 0 X 0 X 0 0 1 1 0 0 1 X 0 X 0 1 2 0 1 X 1 1 X 1 0 3 1 0 1 X 0 0 X 0 1 4 1 0 0 X X 1 0 0 1 5 1 1 0 1 X X 1 0 1

STEP 4: Boolean Expressions

0 2 6 4 1 3 7 5

K-map for J0(t):

Q1(t) Q0(t) x(t) 1 X X 1 0 X X 0

J0(t)= x(t)

slide-20
SLIDE 20

id x(t) Q1(t) Q0(t) J0(t) K0(t) J1(t) K1(t) Q1(t+1) Q0(t+1) y(t) 0 0 0 X 0 X 0 0 1 1 0 0 1 X 0 X 0 1 2 0 1 X 1 1 X 1 0 3 1 0 1 X 0 0 X 0 1 4 1 0 0 X X 1 0 0 1 5 1 1 0 1 X X 1 0 1

STEP 4: Boolean Expressions

J0(t)= x(t) K0(t)= x(t)’ J1(t)= x(t)’Q0(t) K1(t)= 1

slide-21
SLIDE 21

STEP 5: Next state Logic

C2 JK

x(t) y(t) Q1(t)

JK

Q0(t) id x(t) Q1(t) Q0(t) J0(t) K0(t) J1(t) K1(t) Q1(t+1) Q0(t+1) y(t) … … …... ....... 0 0 ………… …............. 0 0 …………………… ……………… ………….... …………… J0(t)= x(t) K0(t)= x(t)’ J1(t)= x(t)’Q0(t) K1(t)= 1

slide-22
SLIDE 22

STEP 5: Output logic

id x(t) Q1(t) Q0(t) J0(t) K0(t) J1(t) K1(t) Q1(t+1) Q0(t+1) y(t) … … …... ....... 0 0 ………… …............. 0 0 …………………… ……………… ………….... ……………

JK

x(t) y(t) Q1(t)

JK

Q0(t) y(t)= x(t)’Q1(t) J0(t)= x(t) K0(t)= x(t)’ J1(t)= x(t)’Q0(t) K1(t)= 1

slide-23
SLIDE 23

Modified 2 bit counter

23

Q0(t) Q1(t)

D Q Q’ D Q Q’

CLK

x(t) Q0(t) Q1(t)

y(t)

Q: Is the above circuit a Moore or a Mealy?

  • A. Moore
  • B. Mealy
slide-24
SLIDE 24

24

Free running 2-bit counter using T-flip flops

S0* S1* S2* S3*

id Q1(t) Q0(t) T1(t) T0(t) Q1(t+1) Q0(t+1) 1 1 1 1 1 1 1 2 1 1 1 1 3 1 1 1 1

Excitation table

slide-25
SLIDE 25

25

T Q Q’ T Q Q’

Q0 Q1 1 T1

Free running counter with T flip flops

T0(t) = 1 T1(t) = Q0(t) Q: Notice Q1 is not fed back into the circuit. Does this mean we have only one state variable?

  • A. Yes
  • B. No
slide-26
SLIDE 26

26

Q1(t + 1) = Q0(t) + Q′

1(t)x(t),

Q0(t + 1) = Q1(t) x(t) + Q0(t)x(t), y(t) = Q′

1(t)Q0(t) + x(t)

Problem 2-II of exercise 4

Q: A state machine is described by the following equations: a) Write the state table b) Design the system with two T-flip flops and a minimal AND-OR-NOT network c) Design the system with two SR-flip flops and a minimal AND-OR-NOT network

slide-27
SLIDE 27

27

Q1(t + 1) = Q0(t) + Q′

1(t)x(t),

Q0(t + 1) = Q1(t) x(t) + Q0(t)x(t), y(t) = Q′

1(t)Q0(t) + x(t) id x(t) Q1(t) Q0(t) Q1(t+1) Q0(t+1) 0 0 1 0 1 2 1 0 3 1 1 4 1 0 0 5 1 0 1 6 1 1 0 7 1 1 1

slide-28
SLIDE 28

28

id x(t) Q1(t) Q0(t) Q1(t+1) Q0(t+1) 0 0

0**************0**

1 0 1

1**************0*

2 1 0

0**************1*

3 1 1

1**************1*

4 1 0 0

1**************1*

5 1 0 1

1**************1*

6 1 1 0 0 0 7 1 1 1 1 1

What is the next step to arrive at the circuit implementation?

  • A. Draw the state diagram of the problem
  • B. Obtain the excitation table
  • C. Get the reduced expression for the next state as a function
  • f present state and inputs
slide-29
SLIDE 29

29

id x(t) Q1(t) Q0(t)

S0(t) R0(t) S1(t)R1(t) Q1(t+1) Q0(t+1)

0 0

0**************0**

1 0 1

1**************0*

2 1 0

0**************1*

3 1 1

1**************1*

4 1 0 0

1**************1*

5 1 0 1

1**************1*

6 1 1 0 0 0 7 1 1 1 1 1

0- 01 1 10

1 PS NS Q(t) Q(t+1)

SR

slide-30
SLIDE 30

30

id x(t) Q1(t) Q0(t)

S0(t) R0(t) S1(t)R1(t) Q1(t+1) Q0(t+1)

0 0

**0**********X* **0**********X* 0**************0**

1 0 1

**0**********1* **1*********0* 1**************0*

2 1 0

**1*********0** **0*********1* 0**************1*

3 1 1

**X********0* *X*********0* 1**************1*

4 1 0 0

**1*********0* 1**********0* 1**************1*

5 1 0 1

**X*********0* 1**********0* 1**************1*

6 1 1 0 0 X 0 1 0 0 7 1 1 1 X 0 X 0 1 1

0- 01 1 10

1 PS NS Q(t) Q(t+1)

SR

slide-31
SLIDE 31

31

S0(t) = x(t)’Q1(t) R0(t) = x(t)’Q1(t)’ S1(t) = Q0(t)+x(t)Q1(t)’ R1(t) = Q0(t)’(x(t)+Q1(t)) y(t) = Q1(t)’ Q0(t)+x(t)

SR

x(t) y(t) Q1(t)

SR

Q0(t)

slide-32
SLIDE 32

Summary: Implementation

32

  • Set up canonical form
  • Mealy or Moore machine
  • Identify the next states
  • state diagram ⇨"state table
  • state assignment
  • Derive excitation table
  • Inputs of flip flops
  • Design the combinational logic
  • don’t care set utilization