Sequential Logic. E&CE 223 Digital Circuits and Systems (A. Kennings) Page 1

Similar documents
Engr354: Digital Logic Circuits

Logic Design. Flip Flops, Registers and Counters

COE 202: Digital Logic Design Sequential Circuits Part 1. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Unit 11. Latches and Flip-Flops

Chapter. Synchronous Sequential Circuits

Chapter 5 Synchronous Sequential Logic

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

Unit 9 Latches and Flip-Flops. Dept. of Electrical and Computer Eng., NCTU 1

Lecture 8: Sequential Logic

ECE 341. Lecture # 2

Digital Circuits ECS 371

Chapter 11 Latches and Flip-Flops

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Flip-Flops. Because of this the state of the latch may keep changing in circuits with feedback as long as the clock pulse remains active.

Synchronous Sequential Logic

Chapter 6. Flip-Flops and Simple Flip-Flop Applications

Introduction to Sequential Circuits

D Latch (Transparent Latch)

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

ELE2120 Digital Circuits and Systems. Tutorial Note 7

WEEK 10. Sequential Circuits: Analysis and Design. Page 1

6. Sequential Logic Flip-Flops

ELCT201: DIGITAL LOGIC DESIGN

ELCT201: DIGITAL LOGIC DESIGN

CprE 281: Digital Logic

Sequential Design Basics

EET2411 DIGITAL ELECTRONICS

INTRODUCTION TO SEQUENTIAL CIRCUITS

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) LATCHES and FLIP-FLOPS

Chapter 5: Synchronous Sequential Logic

Experiment 8 Introduction to Latches and Flip-Flops and registers

CHAPTER 4: Logic Circuits

CHAPTER 4: Logic Circuits

(CSC-3501) Lecture 7 (07 Feb 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

Other Flip-Flops. Lecture 27 1

Sequential Logic Circuits

Sequential Circuits: Latches & Flip-Flops

More on Flip-Flops Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <98> 98

Introduction to Digital Logic Missouri S&T University CPE 2210 Flip-Flops

CMSC 313 Preview Slides

RS flip-flop using NOR gate

CprE 281: Digital Logic

Introduction. NAND Gate Latch. Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1

Switching Circuits & Logic Design

Flip-Flops and Sequential Circuit Design

Introduction to Microprocessor & Digital Logic

LATCHES & FLIP-FLOP. Chapter 7

MC9211 Computer Organization

CprE 281: Digital Logic

`COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

UNIT III. Combinational Circuit- Block Diagram. Sequential Circuit- Block Diagram

RS flip-flop using NOR gate

EEE2135 Digital Logic Design Chapter 6. Latches/Flip-Flops and Registers/Counters 서강대학교 전자공학과

LAB 7. Latches & Flip Flops

UNIT IV. Sequential circuit

ECE 545 Digital System Design with VHDL Lecture 2. Digital Logic Refresher Part B Sequential Logic Building Blocks

Last time, we saw how latches can be used as memory in a circuit

The NOR latch is similar to the NAND latch

CSE Latches and Flip-flops Dr. Izadi. NOR gate property: A B Z Cross coupled NOR gates: S M S R Q M

CHAPTER 1 LATCHES & FLIP-FLOPS

Chapter 8 Sequential Circuits

cascading flip-flops for proper operation clock skew Hardware description languages and sequential logic

EECS 3201: Digital Logic Design Lecture 9. Ihab Amer, PhD, SMIEEE, P.Eng.

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs)

Chapter 5 Sequential Circuits

Sequential Digital Design. Laboratory Manual. Experiment #3. Flip Flop Storage Elements

Digital Fundamentals

Combinational vs Sequential

Rangkaian Sekuensial. Flip-flop

Digital Logic Design I

Topic D-type Flip-flops. Draw a timing diagram to illustrate the significance of edge

CSE140: Components and Design Techniques for Digital Systems. More D-Flip-Flops. Tajana Simunic Rosing. Sources: TSR, Katz, Boriello & Vahid

The outputs are formed by a combinational logic function of the inputs to the circuit or the values stored in the flip-flops (or both).

Flip-Flops and Related Devices. Wen-Hung Liao, Ph.D. 4/11/2001

Synchronous Sequential Logic. Chapter 5

Part II. Chapter2: Synchronous Sequential Logic

ECE 25 Introduction to Digital Design. Chapter 5 Sequential Circuits ( ) Part 1 Storage Elements and Sequential Circuit Analysis

Synchronous Sequential Logic

IT T35 Digital system desigm y - ii /s - iii

Counters

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

Lec 24 Sequential Logic Revisited Sequential Circuit Design and Timing

Sequential Circuit Design: Part 1

CPS311 Lecture: Sequential Circuits

12/31/2010. Overview. 12-Latches and Flip Flops Text: Unit 11. Sequential Circuits. Sequential Circuits. Feedback. Feedback

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS

ECE 545 Digital System Design with VHDL Lecture 1B. Digital Logic Refresher Part B Sequential Logic Building Blocks

CMOS Latches and Flip-Flops

Registers and Counters

Sequential Circuit Design: Part 1

Chapter 4. Logic Design

Asynchronous (Ripple) Counters

A clock is a free-running signal with a cycle time. A clock may be either high or low, and alternates between the two states.

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

CHAPTER 11 LATCHES AND FLIP-FLOPS

EE292: Fundamentals of ECE

MODULE 3. Combinational & Sequential logic

Chapter 1: Switching Algebra Chapter 2: Logical Levels, Timing & Delays. Introduction to latches Chapter 9: Binary Arithmetic

Electrical & Computer Engineering ECE 491. Introduction to VLSI. Report 1

Transcription:

Sequential Logic E&CE 223 igital Circuits and Systems (A. Kennings) Page 1

Sequential Circuits Have considered only combinational circuits in which circuit outputs are determined entirely by current circuit inputs. We can include storage elements into a circuit that act like memory and store a system state. inputs combinatorial circuit outputs memory elements state Outputs are then a function of both the current circuit inputs and the system state. E&CE 223 igital Circuits and Systems (A. Kennings) Page 2

Types of Sequential Circuits Two main types of sequential circuits (classification depends on how timing happens): Synchronous Sequential Circuits circuit behavior is determined from the knowledge of signal values at discrete instances in time. Asynchronous Sequential Circuits - circuit behavior is determined by signals at any instant in time and the order in which input signals change. E&CE 223 igital Circuits and Systems (A. Kennings) Page 3

Synchronous Sequential Circuits To control the behavior of a circuit at discrete instances in time, we will need to introduce the concept of a clock. It s a periodic signal consisting of a sequence of pulses. It is used to control the times at which the storage elements in the circuit change their values. The storage elements used can be latches or flip-flops. inputs combinatorial circuit outputs storage elements state clock/ control clock/ control The clock/control connects to the storage elements which are latches or flip-flops. E&CE 223 igital Circuits and Systems (A. Kennings) Page 4

Clocks Clocks are periodic. They can control when things happen because their transition from 0! 1 and from 1! 0 occur at discrete instances in time. The 0! 1 transition is often called the rising edge of the clock. The 1! 0 transition is often called the falling edge of the clock. clock 1 0 rising edge (0->1 transition) falling edge (1->0 transition) E&CE 223 igital Circuits and Systems (A. Kennings) Page 5

Latches Latches are level sensitive storage elements; They operate based on whether signals are at logic levels 0 or 1, not on logic transitions from 0! 1 or 1! 0. Latches are not really too useful for synchronous sequential circuits (they are for asynchronous circuits), but form the basis from which flip-flops are built. E&CE 223 igital Circuits and Systems (A. Kennings) Page 6

SR Latch (NOR Implementation) Illustrated Consider the operation of the following circuit: R (reset) S (set)! E&CE 223 igital Circuits and Systems (A. Kennings) Page 7

SR Latch (NOR Implementation) Explained In general (one exception, see below), the outputs are complements of each other (this is why they are labeled and :): When S=1, R=0 the output is =1, :=0 and the circuit in the set state. When S=0, R=1 the output is =0, :=1 and the circuit in the reset state. So, S=1 (active high) implies set (=1) and R=1 (active high) implies reset (=0). When S=0, R=0 the output holds at its previous value (storage). When S=1, R=1 the output is =:=0 which is not desirable. We want to avoid this combination of inputs. E&CE 223 igital Circuits and Systems (A. Kennings) Page 8

S R Latch (NAN Implementation) Illustrated Consider the operation of the following circuit: S (set) R (reset)! E&CE 223 igital Circuits and Systems (A. Kennings) Page 9

S R Latch (NAN Implementation) Explained In general (one exception, see below), the outputs are complements of each other (this is why they are labeled and :): When S=0, R=1 the output is =1, :=0 and the circuit in the set state. When S=1, R=0 the output is =0, :=1 and the circuit in the reset state. So, S=0 (active low) implies set (=1) and R=0 (active low) implies reset (=0). When S=1, R=1 the output holds at its previous value (storage). When S=0, R=0 the output is =:=1 which is not desirable. We want to avoid this combination of inputs. So, it works similar to the NOR implementation, but the input values are reversed for each of the different cases. E&CE 223 igital Circuits and Systems (A. Kennings) Page 10

Latch With Control Input (i.e., Gated Latch) We can add an additional control input that acts as an enable signal. Consider adding some extra NAN gates in front of an S R Latch. This gives us a SR Latch with control input. S C R! E&CE 223 igital Circuits and Systems (A. Kennings) Page 11

Latch With Control Input Explained S C R! When the control input C=0, The inputs to the latch are both 1 which puts the SR latch into hold state. The latch outputs will not change regardless of S and R values. E&CE 223 igital Circuits and Systems (A. Kennings) Page 12

Latch With Control Input (NAN Implementation) S C R! When the control input C=1, The S and R inputs will reach the latch and we can analyze the behavior. The NAN gates at the input to the latchresult in active high inputs: S=1 (and R=0) causes a set (=1). R=1 (and S=0) causes a reset (=0). E&CE 223 igital Circuits and Systems (A. Kennings) Page 13

Latch We must avoid the undesirable situation in which we cannot determine what the output of the latch will be i.e., we never want S=1, R=1 when C=1 (bad!) The solution is to construct a latch where S and R can never have the same value. E&CE 223 igital Circuits and Systems (A. Kennings) Page 14

Latch Illustrated C! We still have a hold state when the control input C=0. The output follows input when the control input C=1. E&CE 223 igital Circuits and Systems (A. Kennings) Page 15

Schematic Symbol for SR Latch (With and Without Control Input) S S C R R Note: as illustrated, this means the inputs are active high; i.e., we set when S=1 (and R=0) and we reset with R=1 (and S=0). E&CE 223 igital Circuits and Systems (A. Kennings) Page 16

Schematic Symbol for S R Latch (With and Without Control Input) S S C R R Note: as illustrated, this means the inputs are active low; i.e., we set when S=0 (and R=1) and we reset with R=0 (and S=1). E&CE 223 igital Circuits and Systems (A. Kennings) Page 17

Schematic Symbol for Latch (With Control Input) C Note: For a Latch, the control input is required, since it is via the control input that we have the hold state. E&CE 223 igital Circuits and Systems (A. Kennings) Page 18

Textbook Sections Information on Sequential Circuits, Synchronous Sequential Circuits and Latches can be found in the course textbook in Chapter 5, Sections 5.1 and 5.2. E&CE 223 igital Circuits and Systems (A. Kennings) Page 19

Problem With Latches Latches do not allow for precise control because they are level sensitive. Consider a -Latch with the clock signal connected to the control input. Output of the latch can change anytime while the clock is at its active level. This creates an interval in time over which the state, or output, of the memory element can change rather that an instant in time at which the state, or output, of the memory element can change. It would be better to only allow the output to change when the clock edge makes a transition from 0! 1 (rising edge triggering) or 1! 0 (falling edge triggering). This gives even more precise control! Flip-flops give more precise control by being edge-triggered. E&CE 223 igital Circuits and Systems (A. Kennings) Page 20

Triggering Illustrated Response to positive level (a latch) large window of time for output to change. Positive Edge Triggering. The input to the flip-flop just before the clock changes from 0! 1 causes the output to change just after the clock changes from 0! 1. Negative Edge Triggering. The input to the flip-flop just before the clock changes from 1! 0 causes the output to change just after the clock changes from 1! 0. E&CE 223 igital Circuits and Systems (A. Kennings) Page 21

Negative Edge Triggered Flip-Flop (Master-Slave) We can make a negative edge triggered -type flip-flop (FF) using two latches. We connect the clock input to the control input of the first latch (master), and the inversion of the clock input to the control input of the second latch (slave). Latch (master) Y Latch (slave) CLOCK C C E&CE 223 igital Circuits and Systems (A. Kennings) Page 22

Operation of Negative Edge Triggered Flip-Flop (Master-Slave) Latch (master) Y Latch (slave) CLOCK C C While CLK=1, Y will follow input via the master latch, but will not follow Y (it is in hold state) and will hold its current value. When CLK=0 (at the moment of change), Y will be disconnected from and will hold its current value. will follow Y via the master latch. The effect is that the value of just prior to the falling edge of the clock will get transferred to the output just after the falling edge of the clock. E&CE 223 igital Circuits and Systems (A. Kennings) Page 23

Positive Edge Triggered Flip-Flop (Master-Slave) We can make a positive edge triggered FF simply by changing the inversion of the clock signal Output of master latch, Y, follows when clock is low (slave in hold). Output of slave latch,, follows Y when clock is high (master in hold). Latch (master) Y Latch (slave) CLOCK C C E&CE 223 igital Circuits and Systems (A. Kennings) Page 24

Schematic Symbols for FFs We can introduce schematic symbols for FFs. Note the indication of the clock input and the change to the symbols (vs. a latch) to indicate edge-triggering. Positive Edge-Triggered FF: Negative Edge-Triggered FF: E&CE 223 igital Circuits and Systems (A. Kennings) Page 25

More Efficient esign of a FF Master-Slave is not the most efficient way to build an edge-triggered FF. The circuit below acts as a positive edge-triggered FF: S CLK R! E&CE 223 igital Circuits and Systems (A. Kennings) Page 26

More Efficient esign of a FF Explained (CLK=0) When CLK=0, both S=1 and R=1 and the output latch will hold its state. S 1 hold 0 CLK R 1! E&CE 223 igital Circuits and Systems (A. Kennings) Page 27

More Efficient esign of a FF Explained (=0 when CLK=0! 1) When =0 and CLK = 0! 1, R = 1! 0 and the output latch goes into its reset state (=0). Further changes in while CLK=1 cannot change R and = just after clock changes. S 1 reset ->0 0->1 CLK 1->0 R! 0 1 E&CE 223 igital Circuits and Systems (A. Kennings) Page 28

More Efficient esign of a FF Explained (=1 when CLK=0! 1) When =1 and CLK = 0! 1, S = 1! 0 and the output latch goes into its set state (=1). Further changes in while CLK=1 cannot change S and = just after clock changes. 0->1 CLK 1 1->0 S 1 R set! ->1 1 0 E&CE 223 igital Circuits and Systems (A. Kennings) Page 29

Sets and Resets Sometimes flip-flops will have additional, asynchronous control inputs that force the output to a particular value. An asynchronous signal that forces =1 is called an asynchronous set or preset. The output will remain 1 as long as the set input is active (changes in and CLK are ignored). An asynchronous signal that forces =0 is called an asynchronous clear or reset. The output will remain 0 as long as the reset input is active (changes in and CLK are ignored). E&CE 223 igital Circuits and Systems (A. Kennings) Page 30

Reset Illustrated The following circuit has an (active low) asynchronous reset. S 1 reset/ hold 0 CLK RESET 0 0/1 1 R! 1 E&CE 223 igital Circuits and Systems (A. Kennings) Page 31

Schematic Symbols for SRFFs (FF With Resets and Sets) Active low set and reset signals. S R Active high set and reset signals. S R E&CE 223 igital Circuits and Systems (A. Kennings) Page 32

Characteristic Tables and Equations We can describe the behavior of a flip-flop via a characteristic table. The characteristic table shows what the next flip-flop output value will be given the current flip-flop input value after the clock makes its active edge transition. The characteristic table for a FF is: We can also write this as a characteristic equation: For a FF, the output value becomes the input value when the clock makes its active edge transition. E&CE 223 igital Circuits and Systems (A. Kennings) Page 33

Toggle Flip-Flops (TFF) Another type of flip-flop that has a different behavior when compared to a FF. Symbol for a positive edge-triggered TFF: T Symbol for a negative edge-triggered TFF: T E&CE 223 igital Circuits and Systems (A. Kennings) Page 34

Behavior of a TFF The characteristic table for the TFF: The characteristic equation for the TFF: So with a TFF, the output toggles (or flips) its value if the input is T=1, otherwise it remains the same. E&CE 223 igital Circuits and Systems (A. Kennings) Page 35

Construction Of A TFF Using a FF We can actually build a TFF using a FF and a 2-input XOR gate. T T CLOCK E&CE 223 igital Circuits and Systems (A. Kennings) Page 36

JK Flip-Flops (JKFF) Again, another type of flip-flop that has different behavior compared to a FF or to a TFF. Positive edge-triggered JKFF: J K Negative edge-triggered JKFF: J K E&CE 223 igital Circuits and Systems (A. Kennings) Page 37

Behavior of a JKFF The characteristic table for the JKFF: We can derive the characteristic equation for the JKFF (I find it easy to explain via a K-Map): JK (t) 00 01 11 10 0 0 0 1 1 1 1 0 0 1 E&CE 223 igital Circuits and Systems (A. Kennings) Page 38

Construction Of A JKFF Using a FF We can actually build a JKFF using a FF and some other gates. J J K CLOCK K E&CE 223 igital Circuits and Systems (A. Kennings) Page 39

Circuit Timing With Flip-Flops There are some important things to understand when we go to actually make and implement a circuit with flip-flops. In reality, it takes time for gates to change their output values according to the input values i.e., there are propagation delays due to resistance, capacitance, etc. Changes in flip-flop outputs occur at the active clock edge. There are three timing parameters that are especially important: Setup Time (TSU). Hold Time (TH). Clock-To-Output Time (TCO). E&CE 223 igital Circuits and Systems (A. Kennings) Page 40

efinitions Setup Time (TSU): The setup time of a flip-flop is the amount of time that the data inputs need to be held stable (not changing) PRIOR to the arrival of the active clock edge. Hold Time (TH): The hold time of a flip-flop is the amount of time that the data inputs need to be held stable (not changing) AFTER the arrival of the active clock edge. Clock-To-Output (TCO): The clock-to-output time of a flip-flop is the amount of time it takes for the output to become stable (at its new value) AFTER the arrival of the active clock edge. E&CE 223 igital Circuits and Systems (A. Kennings) Page 41

Comments If these timing specifications are not met, then it is possible that the flip-flop will not behave as expected. That is, if we don t observe setup and hold times at the data inputs, then our output might not change as expected. That is, if we don t wait long enough (clock-to-output time) for the output to change, then we might use an incorrect value. If we violate any of these timing parameters, then we have a timing violation. These timing parameters (as we will see later) have an influence on how fast we can clock a circuit. E&CE 223 igital Circuits and Systems (A. Kennings) Page 42

Timing Parameters Illustrated (Using A FF) TSU TH TCO CLOCK should not change in this interval not stable (trustworthy) until this interval ends E&CE 223 igital Circuits and Systems (A. Kennings) Page 43

Textbook Sections Information on Flip-Flops can be found in the course textbook in Chapter 5, Section 5.3. E&CE 223 igital Circuits and Systems (A. Kennings) Page 44