Lec 24 Sequential Logic Revisited Sequential Circuit Design and Timing

Similar documents
Traversing Digital Design. EECS Components and Design Techniques for Digital Systems. Lec 22 Sequential Logic - Advanced

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

Sequential Circuits. Sequential Logic. Circuits with Feedback. Simplest Circuits with Feedback. Memory with Cross-coupled Gates.

Sequential Logic. Sequential Circuits. ! Timing Methodologies " Cascading flip-flops for proper operation " Clock skew

! Two inverters form a static memory cell " Will hold value as long as it has power applied

Sequential logic. Circuits with feedback. How to control feedback? Sequential circuits. Timing methodologies. Basic registers

ALGORITHMS IN HW EECS150 ALGORITHMS IN HW. COMBINATIONAL vs. SEQUENTIAL. Sequential Circuits ALGORITHMS IN HW

Chapter 6. sequential logic design. This is the beginning of the second part of this course, sequential logic.

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

6. Sequential Logic Flip-Flops

Chapter 6. sequential logic design. This is the beginning of the second part of this course, sequential logic.

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

Engr354: Digital Logic Circuits

ECEN454 Digital Integrated Circuit Design. Sequential Circuits. Sequencing. Output depends on current inputs

Unit 11. Latches and Flip-Flops

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

ECE321 Electronics I

CSE115: Digital Design Lecture 23: Latches & Flip-Flops

EECS150 - Digital Design Lecture 3 Synchronous Digital Systems Review. Announcements

EEC 118 Lecture #9: Sequential Logic. Rajeevan Amirtharajah University of California, Davis Jeff Parkhurst Intel Corporation

RS flip-flop using NOR gate

INTRODUCTION TO SEQUENTIAL CIRCUITS

Basis of sequential circuits: the R-S latch

Chapter 11 Latches and Flip-Flops

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

Combinational vs Sequential

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

Glitches/hazards and how to avoid them. What to do when the state machine doesn t fit!

Lecture 11: Sequential Circuit Design

ELCT201: DIGITAL LOGIC DESIGN

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

Digital Circuits ECS 371

Sequential Circuit Design: Part 1

Logic Design. Flip Flops, Registers and Counters

Clock - key to synchronous systems. Topic 7. Clocking Strategies in VLSI Systems. Latch vs Flip-Flop. Clock for timing synchronization

Clock - key to synchronous systems. Lecture 7. Clocking Strategies in VLSI Systems. Latch vs Flip-Flop. Clock for timing synchronization

SEQUENTIAL LOGIC. Satish Chandra Assistant Professor Department of Physics P P N College, Kanpur

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

Momentary Changes in Outputs. State Machine Signaling. Oscillatory Behavior. Hazards/Glitches. Types of Hazards. Static Hazards

CPE/EE 427, CPE 527 VLSI Design I Sequential Circuits. Sequencing

Sequential Circuits: Latches & Flip-Flops

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

Clocks. Sequential Logic. A clock is a free-running signal with a cycle time.

Advanced Digital Logic Design EECS 303

Memory elements. Topics. Memory element terminology. Variations in memory elements. Clock terminology. Memory element parameters. clock.

Sequential Circuit Design: Part 1

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

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

Digital Fundamentals

Sequencing. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Fall,

RS flip-flop using NOR gate

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

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.

Outline. EECS150 - Digital Design Lecture 27 - Asynchronous Sequential Circuits. Cross-coupled NOR gates. Asynchronous State Transition Diagram

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

Lecture 8: Sequential Logic

Experiment 8 Introduction to Latches and Flip-Flops and registers

CHAPTER 1 LATCHES & FLIP-FLOPS

Figure 1 shows a simple implementation of a clock switch, using an AND-OR type multiplexer logic.

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

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

CHAPTER1: Digital Logic Circuits

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.

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).

D Latch (Transparent Latch)


Project 6: Latches and flip-flops

MUX AND FLIPFLOPS/LATCHES

Chapter 5 Flip-Flops and Related Devices

Synchronous Sequential Logic

Rangkaian Sekuensial. Flip-flop

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

3 Flip-Flops. The latch is a logic block that has 2 stable states (0) or (1). The RS latch can be forced to hold a 1 when the Set line is asserted.

Part 4: Introduction to Sequential Logic. Basic Sequential structure. Positive-edge-triggered D flip-flop. Flip-flops classified by inputs

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

Chapter 5: Synchronous Sequential Logic

Synchronous Sequential Logic

Chapter 4. Logic Design

ELE2120 Digital Circuits and Systems. Tutorial Note 7

Sequential Logic. References:

Lecture 21: Sequential Circuits. Review: Timing Definitions

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

MC9211 Computer Organization

Chapter 7 Sequential Circuits

EE141-Fall 2010 Digital Integrated Circuits. Announcements. Homework #8 due next Tuesday. Project Phase 3 plan due this Sat.

ESE 570 STATIC SEQUENTIAL CMOS LOGIC CELLS. Kenneth R. Laker, University of Pennsylvania, updated 25Mar15

Digital System Design

ELCT201: DIGITAL LOGIC DESIGN

DALHOUSIE UNIVERSITY Department of Electrical & Computer Engineering Digital Circuits - ECED 220. Experiment 4 - Latches and Flip-Flops

Digital Integrated Circuits EECS 312

UNIT IV. Sequential circuit

CHAPTER 4: Logic Circuits

Fundamentals of Computer Systems

CPS311 Lecture: Sequential Circuits

LATCHES & FLIP-FLOP. Chapter 7

Introduction to Sequential Circuits

EECS150 - Digital Design Lecture 15 Finite State Machines. Announcements

ECE 341. Lecture # 2

CprE 281: Digital Logic

CHAPTER 4: Logic Circuits

Transcription:

Traversing igital esign EECS - Components and esign Techniques for igital Systems EECS wks 6 - Lec 24 Sequential Logic Revisited Sequential Circuit esign and Timing avid Culler Electrical Engineering and Computer Sciences University of California, Berkeley http://www.eecs.berkeley.edu/~culler http://www-inst.eecs.berkeley.edu/~cs EECS wks -6 EE 4 CS6C Types of Latches We have focused on -flips latch => FlipFlop => Registers (ld, clr) Most commonly used today (CMOS, FPGA) Many other types of latches RS, JK, T Should be familiar with these too Opportunity to look much more closely at timing behavior Recall: Forms of Sequential Logic Asynchronous sequential logic state changes occur whenever state inputs change (elements may be simple wires or delay elements) Synchronous sequential logic state changes occur in lock step across all storage elements (using a periodic waveform - the clock) Latch vs Flip Flops Timing Methodology Example ring oscillator Recall: General Model of Synchronous Circuit A B C E X clock input input CL reg CL reg output Period of Repeating Waveform ( tp) Gate elay ( td) option feedback A (=X) B C E output Our methodology so far: registers as flipflops with common control Single-phase clock, edge triggered design Assumptions underlying the clean abstraction Input to FF valid a setup time before clock edge Outputs don t change too quickly after clock edge (hold time)» Clk-to- => hold time

Circuits with Feedback How to control feedback? What stops values from cycling around endlessly Simplest Circuits with Feedback Two inverters form a static memory cell Will hold value as long as it has power applied How to get a new value into the memory cell? Selectively break feedback path Load new value into cell Latches Level-sensitive latch holds value when clock is low Transparent when clock is high What does it take to build a consistent timing methodology with only latches? Very hard! All stages transparent at same time. Require that minimum propagation delay is greater than high phase of the clock (duty period) a b in a b Clocks Used to keep time Wait long enough for inputs (Rand S) to settle Then allow to have effect on value stored Clocks are regular periodic signals Period (time between ticks) uty-cycle (time clock is high between ticks - expressed as of period)!!" $ Two-phase non-overlapping clocks Master-Slave Structure Sequential elements partition into two classes phase ele ts feed phase phase ele ts feed phase Approximate single phase: each register replaced by a pair of latches on two phases Can push logic across (retiming) Can always slow down the clocks to meet all timing constraints in a b a b c/l - setup time clock to delay Construct flipflop from two latches

Latches vs FlipFlips Level sensitive vs edge triggered Very different design methodologies for correct use Both are clocked, but latch is asynchronous Output can change while clock is high FF Clk Latch Asynchronous R-S Latch Cross-coupled NOR gates Similar to inverter pair, with capability to force output to (reset=) or (set=) ( ( ( ( ( Cross-coupled NAN gates Similar to inverter pair, with capability to force output to (reset=) or (set=) ( State Behavior of R-S latch Theoretical R-S Latch Behavior Transition Table ) Sequential (output depends on history when inputs R=, S=) but asynchronous * ) +), ( State iagram States: possible values Transitions: changes based on inputs ( ( ( ( ( Timing Behavior Observed R-S Latch Behavior ( Very difficult to observe R-S latch in the - state One of R or S usually changes first Ambiguously returns to state - or - A so-called "race condition" Or non-deterministic transition - ( (. (

Announcements Great early check-offs About 2/3s of class signed up. Excellent projects on Monday. If you signed up and we didn t get to you, check off at regular time, but get anyways (using frozen files) Issues on CP3? today is deadline to talk to us borrowed or provided solutions Engineer s code of ethics: always state sources of work» Credit where it is due, protect yourself, protect your employer EECS in the NEWS Towards quantum computing -7 bit devices have been built Fundamental algorithmic differences» Factoring large prime numbers Computational view of quantum theory» New undergrad course Kubiatowicz vazirani Gated R-S Latch Control when R and S inputs matter Otherwise, the slightest glitch on R or S while enable is low could cause change in value stored Ensure R S stable before utilized (to avoid transient R=, S=) ( ( ( ( ( ( ( ( Towards a Synchronous esign Controlling an R-S latch with a clock Cant let R and S change while clock is active (allowing R and S to pass) Only have half of clock period for signal changes to propagate Signals must be stable for the other half of clock period Cascading Latches Connect output of one latch to input of another How to stop changes from racing through chain? Need to control flow of data from one latch to the next Advance from one latch per clock period Worry about logic between latches (arrows) that is too fast» Shortest paths, not critical paths ( ( ( ( ( ( (( Master-Slave Structure Break flow by alternating clocks (like an air-lock) Use positive clock to latch inputs into one R-S latch Use negative clock to change outputs with another R-S latch View pair as one basic unit master-slave flip-flop twice as much logic output changes a few gate delays after the falling edge of clock but does not affect any cascaded flip-flops 2 CLK CLK / /( ( ( 2 / /( ( The s Catching Problem In first R-S stage of master-slave FF -- glitch on R or S while clock is high "caught" by master stage Leads to constraints on logic (feeding the latch) to be hazardfree 2 3 4 4 /( ( ( /

Flip-Flop JK Flip Flops Make S and R complements of each other in Master stage Eliminates s catching problem» Input only needs to settle by clock edge Cant just hold previous value (must have new value ready every clock period) Value of just before clock goes low is what is stored in flipflop Can make R-S flip-flop by adding logic to make = S + R 6 2 ) K J R R-S master/slave S /( ( ( ( / 2 (neg) Edge-Triggered Flip-Flops Edge-Triggered Flip-Flops (cont d) + More efficient solution: only 6 gates sensitive to inputs only near edge of clock signal (not while high),, (, 7 7788 97!! * )+ =, Clk High +,,, Act as inverters Hold state Edge-Triggered Flip-Flops (cont d) -FF Behavior when CLK= =, Clk High +,,,, -> ->, + u R=u S=l, -> -> Change in propagate through lower and upper latch, but R=S=, isolating slave

Behavior when CLK -> -FF; behavior when CLK== + ->,, ->, -> u -> R=u S=l, + ->~ =, R ==old, -> Lower output Upper latch retains old RS unchanged Falling edge allows latched to propagate to output latch Edge-Triggered Flip-Flops (cont d) Edge-Triggered Flip-Flops (cont d) =, Clk LOW +,,, Act as inverters Positive edge-triggered Inputs sampled on rising edge; outputs change after rising edge Negative edge-triggered flip-flops Inputs sampled on falling edge; outputs change after falling edge 2 ( ( 7 88 7 88 Timing Methodologies Timing Methodologies (cont d) Rules for interconnecting components and clocks Guarantee proper operation of system when strictly followed Approach depends on building blocks used for memory elements Focus on systems with edge-triggered flip-flops» Found in programmable logic devices Many custom integrated circuits focus on level-sensitive latches Basic rules for correct timing: () Correct inputs, with respect to time, are provided to the flip-flops (2) No flip-flop changes state more than once per clocking event efinition of terms clock: periodic event, causes state of memory element to change; can be rising or falling edge, or high or low level setup time: minimum time before the clocking event by which the input must be stable (Tsu) hold time: minimum time after the clocking event until which the input must remain stable (Th) :

Comparison of Latches and Flip- Flops (cont d) Typical Timing Specifications Positive edge-triggered flip-flop Setup and hold times Minimum clock width Propagation delays (low to high, high to low, max and typical) 2 ; 9 " Cascading Edge-triggered Flip-Flops Shift register New value goes into first stage While previous value of first stage goes into second stage Consider setup/hold/propagation delays (prop must be > hold) Cascading Edge-triggered Flip-Flops (cont d) Why this works Propagation delays exceed hold times Clock width constraint exceeds setup time This guarantees following stage will latch current value before it changes to new value IN < 9 ; 9 ; CLK 2! Clock Skew The problem Correct behavior assumes next state of all storage elements determined by all storage elements at the same time This is difficult in high-performance systems because time for clock to arrive at flip-flop is comparable to delays through logic Effect of skew on cascaded flip-flops: < 2 2 =<>+ " +"+ "?= + "+ " + "+ Need Propagation Skew > Hold Time 2! 2 Summary of Latches and Flip-Flops evelopment of -FF Level-sensitive used in custom integrated circuits» can be made with 4 pairs of gates» Usually follows multiphase non-overlapping clock discipline Edge-triggered used in programmable logic devices Good choice for data storage register Historically J-K FF was popular but now never used Similar to R-S but with - being used to toggle output (complement state) Good in days of TTL/SSI (more complex input function: = J+ K Not a good choice for PALs/PLAs as it requires 2 inputs Can always be implemented using -FF Preset and clear inputs are highly desirable on flip-flops Used at start-up or to reset system to a known state

Flip-Flop Features Reset (set state to ) R Synchronous: new = R old (when next clock edge arrives) Asynchronous: doesnt wait for clock, quick but dangerous Preset or set (set state to ) S (or sometimes P) Synchronous: new = old + S (when next clock edge arrives) Asynchronous: doesnt wait for clock, quick but dangerous Both reset and preset new = R old + S (set-dominant) new = R old + RS (reset-dominant) Selective input capability (input enable/load) L or EN Multiplexer at input: new = L + L old Load may/may not override reset/set (usually R/S have priority) Complementary outputs and Maintaining the igital Abstraction (in an analog world) Circuit design with very sharp transitions Noise margin for logical values Carefully esign Storage Elements (SE) Internal feedback Structured System esign SE + CL, cycles must cross SE Timing Methodology All SE advance state together All inputs stable across state change input clock CL @ @ reg option feedback input output CL @ reg @ output Where does this breakdown? Example Problems Interfacing to the physical world Can t tell it not to change near the clock edge A! <!! A! <!: igital Abstraction < 2 <! 88 "! B Metastability Practical Solution In worst cast, cannot bound time for FF to decide if inputs can change right on the edge Circuit has a metastable balance point horrible example In? A! <!: Series of synchronizers each reduces the chance of getting stuck (exponentially) Make P(metastability) < P(device failure) Oversample and then low pass

Metastability throughout the ages Buridan, Jean (3-8), French Scholastic philosopher, who held a theory of determinism, contending that the will must choose the greater good. Born in Bethune, he was educated at the University of Paris, where he studied with the English Scholastic philosopher William of Ocham. After his studies were completed, he was appointed professor of philosophy, and later rector, at the same university. Buridan is traditionally but probably incorrectly associated with a philosophical dilemma of moral choice called "Buridans ass." In the problem an ass starves to death between two alluring bundles of hay because it does not have the will to decide which one to eat. idn t take EECS