cpre 281: digital logic - computer engineeringtoggle. jk flip-flop (how it works) a versatile...

59
Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/ CprE 281: Digital Logic

Upload: others

Post on 15-Oct-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

Instructor: Alexander Stoytchev

http://www.ece.iastate.edu/~alexs/classes/

CprE 281: Digital Logic

Page 2: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

T Flip-Flops &

JK Flip-Flops

CprE 281: Digital LogicIowa State University, Ames, IACopyright © Alexander Stoytchev

Page 3: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

Administrative Stuff

• Homework 8 is due next Monday.

• The second midterm exam is next Friday.

Page 4: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

Administrative Stuff• Midterm Exam #2

• When: Friday November 1 @ 4pm.

• Where: This classroom

• What: Chapters 1, 2, 3, 4 and 5.1-5.8

• The exam will be closed book but open notes (you can bring up to 3 pages of handwritten notes).

Page 5: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

Midterm 2: Format

• The exam will be out of 130 points

• You need 95 points to get an A for this exam

• It will be great if you can score more than 100 points.§ but you can’t roll over your extra points L

Page 6: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

Midterm 2: Topics

• Binary Numbers and Hexadecimal Numbers• 1’s complement and 2’s complement representation• Addition and subtraction of binary numbers• Circuits for adders and fast adders

• Single and Double precision IEEE floating point formats• Converting a real number to the IEEE format• Converting a floating point number to base 10

• Multiplexers (circuits and function)• Synthesis of logic functions using multiplexers• Shannon’s Expansion Theorem

Page 7: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

Midterm 2: Topics• Decoders (circuits and function)• Demultiplexers• Encoders (binary and priority)• Code Converters• K-maps for 2, 3, and 4 variables

• Synthesis of logic circuits using adders, multiplexers, encoders, decoders, and basic logic gates

• Synthesis of logic circuits given constraints on the available building blocks that you can use

• Latches (circuits, behavior, timing diagrams)• Flip-Flops (circuits, behavior, timing diagrams)• Registers and Register Files

Page 8: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

T Flip-Flop

Page 9: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

Motivation

A slight modification of the D flip-flop that can be used for some nice applications.

In this case, T stands for Toggle.

Page 10: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

[ Figure 5.15a from the textbook ]

T Flip-Flop

Page 11: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

[ Figure 5.15a from the textbook ]

T Flip-Flop

Positive-edge-triggered D Flip-Flop

Page 12: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

[ Figure 5.15a from the textbook ]

T Flip-Flop

What is this?

Page 13: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

What is this?

Q

Q

TD

Page 14: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

It is a 2-to-1 Multiplexer

Q

Q

TD

QQ

T

D

Page 15: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

What is this?

+ = ?QQ

T

D

Page 16: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

T

0

1 D Q

Q Clock

It is a T Flip-Flop

Page 17: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

T

0

1 D Q

Q Clock

It is a T Flip-Flop

Q

Q

Note that the two inputs to the multiplexer are inverses of each other.

Page 18: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

T

0

1 D Q

Q Clock

Another Way to Draw This

Q

Q

Page 19: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

T

0

1 D Q

Q Clock

Another Way to Draw This

Q

Q

What is this?

Page 20: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

What is this?

Q

T

D

Page 21: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

What is this?

Q

T

D

D = QT + QT

Page 22: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

It is an XOR

Q

T

D

D = Q + T

Page 23: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

DQT

It is an XOR

D = Q + T

Page 24: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

What is this?

+ = ?

Page 25: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

T D Q

Q Clock

It is a T Flip-Flop too

Page 26: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

T Q D

0 0 00 1 11 0 11 1 0

T D Q

Q Clock

It is a T Flip-Flop too

Page 27: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

T D Q

Q Clock

It is a T Flip-Flop too

T Q D

0 0 00 1 11 0 11 1 0

Q

Q

Page 28: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

If T=0 then it stays in its current state

If T=1 then it reverses its current state

In other words the circuit “toggles” its state when T=1. This is why it is called T flip-flop.

T Flip-Flop(how it works)

Page 29: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

[ Figure 5.15a,b from the textbook ]

T Flip-Flop(circuit and truth table)

Page 30: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

[ Figure 5.15a,c from the textbook ]

T Flip-Flop(circuit and graphical symbol)

Page 31: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

[ Figure 5.15d from the textbook ]

T Flip-Flop (Timing Diagram)

1

10

01 1

1

011

1

Page 32: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

[ Figure 5.15d from the textbook ]

1

10

01 1

1

011

0

1

Decision Point

T Flip-Flop (Timing Diagram)

Page 33: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

[ Figure 5.15d from the textbook ]

1

10

01 1

1

011

0

1

T Flip-Flop (Timing Diagram)

Page 34: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

[ Figure 5.15d from the textbook ]

1

10

01 1

1

011

0

1

T Flip-Flop (Timing Diagram)

Page 35: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

[ Figure 5.15d from the textbook ]

1

10

01 1

1

011

0

1

T Flip-Flop (Timing Diagram)

Page 36: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

JK Flip-Flop

Page 37: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

[ Figure 5.16a from the textbook ]

JK Flip-Flop

D = JQ + KQ

Page 38: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

[ Figure 5.16 from the textbook ]

JK Flip-Flop

J Q

Q

K01

Q t 1+( )Q t( )

0

(b) Truth table (c) Graphical symbol

J00

0 111 Q t( )1

K

D Q

Q

Q

Q

J

Clock

(a) Circuit

K

Hold

Reset

Set

Toggle

Page 39: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

JK Flip-Flop(how it works)

A versatile circuit that can be used both as aSR flip-flop and as a T flip flop

If J=0 and S =0 it stays in the same state

Just like SR It can be set and reset J=S and K=R

If J=K=1 then it behaves as a T flip-flop

Page 40: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

JK Flip-Flop(timing diagram)

Page 41: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

JK Flip-Flop(timing diagram)

Page 42: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

JK Flip-Flop(timing diagram)

Page 43: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

JK Flip-Flop(timing diagram)

Page 44: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

Complete Wiring Diagrams

Page 45: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

Positive-Edge-Triggered D Flip-Flop

Page 46: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

Negative-Edge-Triggered D Flip-Flop

Page 47: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

The Complete Wiring Diagram for a Positive-Edge-Triggered D Flip-Flop

D

Clock

Q

Q

Page 48: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

The Complete Wiring Diagram for a Negative-Edge-Triggered D Flip-Flop

Q

Q

D

Clock

Page 49: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

The Complete Wiring Diagram for a Negative-Edge-Triggered D Flip-Flop

Q

Q

D

Clock

Page 50: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

T D Q

Q Clock

Positive-Edge-Triggered T Flip-Flop

Page 51: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

Negative-Edge-Triggered T Flip-Flop

T D Q

Q Clock

Page 52: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

The Complete Wiring Diagram for a Positive-Edge-Triggered D Flip-Flop

T

Clock

Q

Q

Page 53: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

The Complete Wiring Diagram for a Negative-Edge-Triggered D Flip-Flop

T

Clock

Q

Q

Page 54: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

D Q

Q

Q

Q

J

Clock

K

Positive-Edge-Triggered JK Flip-Flop

Page 55: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

D Q

Q

Q

Q

J

Clock

K

Negative-Edge-Triggered JK Flip-Flop

Page 56: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

The Complete Wiring Diagram for a Positive-Edge-Triggered JK Flip-Flop

Q

Q

Clock

J

K

Page 57: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

The Complete Wiring Diagram for a Negative-Edge-Triggered JK Flip-Flop

Q

Q

Clock

J

K

Page 58: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

Questions?

Page 59: CprE 281: Digital Logic - Computer EngineeringToggle. JK Flip-Flop (how it works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it

THE END