Tutorial Slides for Week 10 ENEL 353: Digital Circuits Fall 2015 - - PowerPoint PPT Presentation

tutorial slides for week 10
SMART_READER_LITE
LIVE PREVIEW

Tutorial Slides for Week 10 ENEL 353: Digital Circuits Fall 2015 - - PowerPoint PPT Presentation

Tutorial Slides for Week 10 ENEL 353: Digital Circuits Fall 2015 Term Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary 10 November, 2015 slide 2/11 ENEL 353 F15 Tutorial


slide-1
SLIDE 1

Tutorial Slides for Week 10

ENEL 353: Digital Circuits — Fall 2015 Term Steve Norman, PhD, PEng

Electrical & Computer Engineering Schulich School of Engineering University of Calgary

10 November, 2015

slide-2
SLIDE 2

ENEL 353 F15 Tutorial Slides for Week 10

slide 2/11

Topics for today

D flip-flops and finite state machines.

slide-3
SLIDE 3

ENEL 353 F15 Tutorial Slides for Week 10

slide 3/11

Exercise 1: Moore FSMs and the clock divider

This is the general structure of a Moore FSM . . .

  • utput

logic next state logic state next state k k M N inputs

  • utputs

CLK

And this is a clock divider circuit . . .

CLK

Y

slide-4
SLIDE 4

ENEL 353 F15 Tutorial Slides for Week 10

slide 4/11

The clock divider circuit is just about the simplest possible Moore FSM. For the clock divider,

◮ What is M, the number of input bits? ◮ What is k, the number of state bits? ◮ What is N, the number of output bits? ◮ What is correct Boolean algebra for the next-state logic? ◮ What is correct Boolean algebra for the output logic?

slide-5
SLIDE 5

ENEL 353 F15 Tutorial Slides for Week 10

slide 5/11

Notes about notation for FSMs

Your ENEL 353 instructors will follow notation used in the course textbook. S0, S1, S2 and so on are names of states. Note that the numbers are the same size as the S, on the same level. S0, S1, S2 and so on are state bits—Q outputs of DFFs. Note that the numbers are subscripts. S′

i is the next value of the state bit Si.

Many books use the ′ operator for NOT. (For example, in those books A′ means what our textbook would write as A.) Watch out for that! In discussion of FSMs, some books use Qi for the ith state bit, and Q⋆

i for the next value of Qi.

slide-6
SLIDE 6

ENEL 353 F15 Tutorial Slides for Week 10

slide 6/11

Exercise 2

S′ S′

1

S′

2

S2 S0 S1 Y A r

CLK

R

For this Moore FSM, what are

◮ M, the number of inputs? ◮ k, the number of state

bits?

◮ the number of possible

states of the machine?

◮ N, the number of output

bits?

◮ next-state equations? ◮ output equations?

slide-7
SLIDE 7

ENEL 353 F15 Tutorial Slides for Week 10

slide 7/11

Exercise 2, continued

S′ S′

1

S′

2

S2 S0 S1 Y A r

CLK

R

Let’s add waveforms for S0, S1 and S2 to the timing diagram. Let’s assume synchronous reset for the three DFFs in the register.

1 1 1 CLK

R A

slide-8
SLIDE 8

ENEL 353 F15 Tutorial Slides for Week 10

slide 8/11

Remark about Exercise 2

We found the waveforms for S0, S1 and S2 based on rules about the behaviour of DFFs. Next week in lectures, we’ll see another method for solving the

  • problem. The textbook calls this method, “Deriving an FSM

from its schematic.” Your instructors might sometimes call it “FSM analysis.”

slide-9
SLIDE 9

ENEL 353 F15 Tutorial Slides for Week 10

slide 9/11

Exercise 3: More DFF practice

r Q0 r r Q1 Q2 A R

CLK

Let’s add waveforms for Q0, Q1 and Q2 to the timing diagram.

1 1 1 CLK

R A

slide-10
SLIDE 10

ENEL 353 F15 Tutorial Slides for Week 10

slide 10/11

Exercise 4: Simple FSM design

Design an FSM with a single output bit, such that

◮ on reset the output goes to 0; ◮ when reset is turned off, the output repeats the sequence

  • f 0 for one clock cycle, 1 for three cycles, 0 for one

cycle, 1 for three cycles, and so on.

slide-11
SLIDE 11

ENEL 353 F15 Tutorial Slides for Week 10

slide 11/11

Next week

Tue Nov 17: Quiz #4—exact topics to be announced closer to the date of the quiz. Likely topics include SR latches, D latches, DFFs, and simple FSM designs. The Problem Set #4 exercises on sequential logic are highly recommended as preparation.