ece 331 – digital system design flip-flops and registers (lecture #18) the slides included herein...

39
ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals of Logic Design, 6 th Edition, by Roth and Kinney, and were used with permission from Cengage Learning.

Upload: valerie-pearson

Post on 19-Dec-2015

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

ECE 331 – Digital System Design

Flip-Flops and Registers

(Lecture #18)

The slides included herein were taken from the materials accompanying Fundamentals of Logic Design, 6th Edition, by Roth and Kinney,

and were used with permission from Cengage Learning.

Page 2: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 2

Material to be covered …

Chapter 11: Sections 6 – 8

Chapter 12: Sections 1 – 2

Page 3: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 3

Flip-Flops

(continued)

Page 4: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 4

An S-R flip-flop is similar to an S-R latch in that S = 1 sets the Q output to 1, and R = 1 resets the Q output to 0.

The essential difference is that the flip-flop has a clock input, and the Q output can change only after an active clock edge.

SR Flip-Flop

Page 5: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 5

Operation summary: S = R = 0 no state change S = 1, R = 0 set Q to 1 (after active Ck edge) S = 0, R = 1 reset Q to 0 (after active Ck edge) S = R = 1 not allowed

SR Flip-Flop

Page 6: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 6

SR Flip-Flop (master-slave)

Page 7: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 7

SR Flip-Flop: Timing Diagram

Page 8: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 8

The J-K flip-flop is an extended version of the S-R flip-flop. The J-K flip-flop has three inputs – J, K, and the clock (CK). The J input corresponds to S, and K corresponds to R.

Unlike the S-R flip-flop, a 1 input may be applied simultaneously to J and K, in which case the flip-flop changes state (i.e. toggles) after the active clock edge.

JK Flip-Flop

Page 9: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 9

JK Flip-Flop

}Q+ = Q

}Q+ = 0

}Q+ = 1

}Q+ = Q'

set

reset

store

toggle

Page 10: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 10

JK Flip-Flop (master-slave)

Page 11: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 11

JK Flip-Flop: Timing Diagram

Page 12: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 12

The T flip-flop, also called the toggle flip-flop, is frequently used in building counters. It has a T input and a clock input.

When T = 1 the flip-flop changes state after the active edge of the clock. When T = 0, no state change occurs.

T Flip-Flop

Page 13: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 13

Q+ = T'Q + TQ' = Q T

T Flip-Flop

Page 14: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 14

T Flip-Flop: Timing Diagram

Page 15: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 15

Building a T Flip-Flop

Page 16: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 16

Asynchronous Control Signals

Page 17: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 17

Asynchronous Control Signals: Timing Diagram

Page 18: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 18

D FF with Clock Enable

Page 19: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 19

Registers

Page 20: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 20

Several D flip-flops may be grouped together with a common clock to form a register. Because each flip-flop can store one bit of information, a register with n D flip-flops can store n bits of information.

A load signal can be ANDed with the clock to enable and disable loading the registers.

A better approach is to use registers with clock enables if they are available.

Registers

Page 21: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 21

Register: 4 bits

Page 22: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 22

Transferring data between registers is a common operation in digital systems.

Data can be transferred from the output of one of two registers into a third register using tri-state buffers.

Data Transfer between Registers

Page 23: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 23

Data Transfer between Registers

Page 24: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 24

Register with Tri-state Output

Page 25: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 25

Data Transfer using Tri-state Bus

Page 26: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 26

A shift register is a register in which binary data can be stored and shifted either left or right. The data is shifted according to the applied shift signal; often there is a left shift signal and a right shift signal.

A shift register must be constructed using flip-flops (i.e. edge-triggered devices); it cannot be constructed using latches or gated-latches (i.e. level-sensitive devices).

Shift Register

Page 27: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 27

Shift Register: 4 bits

Page 28: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 28

Shift Register (4 bits): Timing Diagram

Page 29: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 29

8-bit SI SO Shift Register

Page 30: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 30

8-bit Shift Register: Timing Diagram

Page 31: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 31

4-bit PI PO Shift Register

Page 32: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 32

4-bit PI PO Shift Register: Operation

Page 33: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 33

4-bit PI PO Shift Register: Timing Diagram

Page 34: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 34

Parallel Adder with Accumulator

Page 35: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 35

In computer circuits, it is frequently desirable to store one number in a register (called an accumulator) and add a second number to it, leaving the result stored in the register.

Parallel Adder with Accumulator

Page 36: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 36

n-bit Parallel Adder with Accumulator

Page 37: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 37

Before addition in the previous circuit can take place, the accumulator must be loaded with X. This can be accomplished in several ways. The easiest way is to first clear the accumulator using the asynchronous clear inputs on the flip-flops, and then put the X data on the Y inputs to the adder and add the accumulator in the normal way.

Alternatively, we could add multiplexers at the accumulator inputs so that we could select either the Y input data or the adder output to load into the accumulator.

Loading the Accumulator

Page 38: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 38

Adder Cell with Multiplexer

Page 39: ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals

Fall 2010 ECE 331 - Digital System Design 39

Questions?