+ All Categories
Home > Documents > Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5...

Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5...

Date post: 09-Feb-2020
Category:
Upload: others
View: 7 times
Download: 0 times
Share this document with a friend
23
1 Synchronous Sequential Logic Chapter 5 Steve Oldridge Dr. Sidney Fels 10/6/2010 c Steve Oldridge since 2010 2 Topics Sequential Circuits – What happens when we add memory? • Latches • Flip-Flops • Clocks State Tables – Reduction of States 10/6/2010 c Steve Oldridge since 2010 3 Sequential Circuits
Transcript
Page 1: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

1

Synchronous Sequential Logic

Chapter 5

Steve Oldridge

Dr. Sidney Fels

10/6/2010 c Steve Oldridge since 2010 2

Topics

• Sequential Circuits

– What happens when we add memory?

• Latches

• Flip-Flops

• Clocks

• State Tables

– Reduction of States

10/6/2010 c Steve Oldridge since 2010 3

Sequential Circuits

Page 2: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

2

10/6/2010 c Steve Oldridge since 2010 4

Synchronous Sequential Circuits

10/6/2010 c Steve Oldridge since 2010 5

Latches

• Maintains a State

– Output is the same as long as there is power

– Memory!

• SR Latch

– NOR

– NAND

• D Latch

10/6/2010 c Steve Oldridge since 2010 6

SR Latch

Page 3: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

3

10/6/2010 c Steve Oldridge since 2010 7

SR Latch Truth Table

10/6/2010 c Steve Oldridge since 2010 8

SR Latch Truth Table (NAND edition)

10/6/2010 c Steve Oldridge since 2010 9

Controlling SR Latches

• We don’t always want the circuit to change immediately

Page 4: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

4

10/6/2010 c Steve Oldridge since 2010 10

• What was the problem with latches?

– If set and reset are both active…

– Q = Q` which is impossible

• How can we overcome that?

– R = S`

10/6/2010 c Steve Oldridge since 2010 11

D Latch (Transparent Latch)

10/6/2010 c Steve Oldridge since 2010 12

Symbols for Latches

Page 5: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

5

10/6/2010 c Steve Oldridge since 2010 13

Clocks & Edge Triggers

• Latch

• FlipFlop

10/6/2010 c Steve Oldridge since 2010 14

Edge triggered D Flip-Flop

10/6/2010 c Steve Oldridge since 2010 15

Positive Edge Trigger

Page 6: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

6

10/6/2010 c Steve Oldridge since 2010 16

D Flip-Flop

10/6/2010 c Steve Oldridge since 2010 17

Other Flip-Flops?

• What is the main function of a flip-flop?

– Store & output a value

– Change only on an edge

• D flip-flop is most economical (least # of gates)

• Additional functionality can be useful

10/6/2010 c Steve Oldridge since 2010 18

JK Flip Flop

Page 7: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

7

10/6/2010 c Steve Oldridge since 2010 19

JK Flip-Flop

10/6/2010 c Steve Oldridge since 2010 20

T Flip-Flop

10/6/2010 c Steve Oldridge since 2010 21

T Flip-Flop

Page 8: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

8

10/6/2010 c Steve Oldridge since 2010 22

Characteristic Tables

10/6/2010 c Steve Oldridge since 2010 23

Adding an Asynchronous Reset

10/6/2010 c Steve Oldridge since 2010 24

Adding an Asynchronous Reset

Page 9: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

9

10/6/2010 c Steve Oldridge since 2010 25

Analysis of Sequential Circuits

10/6/2010 c Steve Oldridge since 2010 26

Analysis of Sequential Circuits

• A(t+1) = A(t)x(t) + B(t)x(t)

• B(t+1) = A’(t)x(t)

• Y = (A+B)x’

10/6/2010 c Steve Oldridge since 2010 27

State Table

Page 10: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

10

10/6/2010 c Steve Oldridge since 2010 28

State Table

10/6/2010 c Steve Oldridge since 2010 29

State Diagram

10/6/2010 c Steve Oldridge since 2010 30

State Diagram

Page 11: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

11

10/6/2010 c Steve Oldridge since 2010 31

Sequential Circuit Example

10/6/2010 c Steve Oldridge since 2010 32

Sequential Circuit Example

10/6/2010 c Steve Oldridge since 2010 33

Sequential Circuit Example

Page 12: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

12

10/6/2010 c Steve Oldridge since 2010 34

Analysis with JK FFs

10/6/2010 c Steve Oldridge since 2010 35

Analysis with JK FFs

10/6/2010 c Steve Oldridge since 2010 36

Analysis with JK FFs

Page 13: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

13

10/6/2010 c Steve Oldridge since 2010 37

Analysis with T flip flops

10/6/2010 c Steve Oldridge since 2010 38

Analysis with T flip flops

10/6/2010 c Steve Oldridge since 2010 39

Mealy Machines and Moore Machines

Page 14: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

14

10/6/2010 c Steve Oldridge since 2010 40

Mealy or Moore?

10/6/2010 c Steve Oldridge since 2010 41

Mealy or Moore?

10/6/2010 c Steve Oldridge since 2010 42

How do hardware developers create circuits?

• Visual Layout

– Draw the circuits by connecting components

– Not practical for large scale or VLSI

• Verilog / VHDL

– Describe the circuit’s functionality in code

– Run it through a ‘compiler’

– Output is a circuit

– Language details are in your text

Page 15: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

15

10/6/2010 c Steve Oldridge since 2010 43

How do hardware developers create circuits?

• Verilog / VHDL

– Describe the circuit’s functionality in code

– Run it through a ‘compiler’

– Output is a circuit compiled / synthesized

onto / into hardware

• FPGA

• Custom ASIC

– Language details are in your text

10/6/2010 c Steve Oldridge since 2010 44

Verilog

• Behavioral Modeling

– What is the circuit supposed to do?

– Describe Inputs / Outputs / States

• Structural Modeling

– What blocks make up the circuit?

– How are they connected?

10/6/2010 c Steve Oldridge since 2010 45

State Reduction

Page 16: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

16

10/6/2010 c Steve Oldridge since 2010 46

Examine the State Table

10/6/2010 c Steve Oldridge since 2010 47

Reducing

10/6/2010 c Steve Oldridge since 2010 48

Reducing Again

Page 17: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

17

10/6/2010 c Steve Oldridge since 2010 49

Our new state diagram

10/6/2010 c Steve Oldridge since 2010 50

Comparing…

10/6/2010 c Steve Oldridge since 2010 51

State Assignment

Page 18: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

18

10/6/2010 c Steve Oldridge since 2010 52

Applying Binary Assignment to our Example

10/6/2010 c Steve Oldridge since 2010 53

Design Procedure

• Derive a state diagram

• Reduce the number of states

• Assign binary values to states

– Integrate this into your state table

• Choose the type of flip-flops

• Derive the flip-flop input and output equations

• Draw (or code) the logic diagram

10/6/2010 c Steve Oldridge since 2010 54

State Diagram ->

Page 19: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

19

10/6/2010 c Steve Oldridge since 2010 55

Reduced Binary State Table ->

10/6/2010 c Steve Oldridge since 2010 56

Boolean Maps ->

10/6/2010 c Steve Oldridge since 2010 57

Circuit!

Page 20: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

20

10/6/2010 c Steve Oldridge since 2010 58

Excitation Tables

10/6/2010 c Steve Oldridge since 2010 59

State Diagram ->

10/6/2010 c Steve Oldridge since 2010 60

JK FF Excitation Tables ->

Page 21: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

21

10/6/2010 c Steve Oldridge since 2010 61

Boolean Maps ->

10/6/2010 c Steve Oldridge since 2010 62

Circuit

10/6/2010 c Steve Oldridge since 2010 63

How do we implement a binary counter?

Page 22: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

22

10/6/2010 c Steve Oldridge since 2010 64

State / Excitation Table ->

10/6/2010 c Steve Oldridge since 2010 65

Boolean Maps ->

10/6/2010 c Steve Oldridge since 2010 66

Circuit

Page 23: Synchronous Sequential Logic - UBCcourses.ece.ubc.ca/256/lectures/2010/Digital Logic Design-ch5 2010.pdf · • Verilog / VHDL – Describe the circuit’s functionality in code –

23

10/6/2010 c Steve Oldridge since 2010 67

Sequential Circuit Design Process Review

• Derive a state diagram

• Reduce the number of states

• Assign binary values to states– Integrate this into your state table

• Choose the type of flip-flops

• Derive the flip-flop excitation table

• Create the Boolean Maps

• Draw (or code) the logic diagram

10/6/2010 c Steve Oldridge since 2010 68

Review

• Sequential Circuits

• Latches

• Flip-Flops

• Design of Sequential Circuits– State Diagrams

– State Tables• Reduction of States

– Excitation tables

– Boolean Maps

10/6/2010 c Steve Oldridge since 2010 69


Recommended