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

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

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

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

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

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

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

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

Lec 24 Sequential Logic Revisited Sequential Circuit Design and Timing

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

Collections of flip-flops with similar controls and logic

UNIT 11 LATCHES AND FLIP-FLOPS

6. Sequential Logic Flip-Flops

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

Basis of sequential circuits: the R-S latch

Switching Circuits & Logic Design

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.

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

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

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

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Overview of Chapter 4

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

Unit 11. Latches and Flip-Flops

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

ELCT201: DIGITAL LOGIC DESIGN

Logic Design. Flip Flops, Registers and Counters

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

Experiment 8 Introduction to Latches and Flip-Flops and registers

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

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

ENGR 303 Introduction to Logic Design Lecture 10. Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

COSC 243. Sequential Logic. COSC 243 (Computer Architecture) Lecture 5 - Sequential Logic 1

Combinational vs Sequential

Engr354: Digital Logic Circuits

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

Lecture 8: Sequential Logic

Chapter 11 Latches and Flip-Flops

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

Fundamentals of Computer Systems

CHAPTER 4: Logic Circuits

CHAPTER 4: Logic Circuits

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

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

Unit-5 Sequential Circuits - 1

Page 1. Some Definitions. Chapter 3: Sequential Logic. Sequential Logic. The Combinational Logic Unit. A NOR Gate with a Lumped Delay

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

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

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

Sequential Circuit Design: Part 1

Switching Circuits & Logic Design

INTRODUCTION TO SEQUENTIAL CIRCUITS

Digital Fundamentals: A Systems Approach

Universal Asynchronous Receiver- Transmitter (UART)

Fundamentals of Computer Systems

Review of digital electronics. Storage units Sequential circuits Counters Shifters

ECE321 Electronics I

give sequence to events have memory (short-term) use feedback from output to input to store information

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

Advanced Digital Logic Design EECS 303

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

RS flip-flop using NOR gate

Multiplexor (aka MUX) An example, yet VERY useful circuit!

D Latch (Transparent Latch)

Digital Circuits ECS 371

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING DIGITAL DESIGN

Registers and Counters

Sequential Circuits. Introduction to Digital Logic. Course Outline. Overview. Introduction to Digital Logic. Introduction to Sequential Circuits

Modeling Latches and Flip-flops

Chapter 3 Unit Combinational

Chapter 4. Logic Design

Digital Fundamentals

Chapter 4: One-Shots, Counters, and Clocks

RS flip-flop using NOR gate

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

Asynchronous (Ripple) Counters

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

Fundamentals of Computer Systems

CHAPTER 1 LATCHES & FLIP-FLOPS

UNIT IV. Sequential circuit

Logic Design ( Part 3) Sequential Logic (Chapter 3)

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

MC9211 Computer Organization

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District DEPARTMENT OF INFORMATION TECHNOLOGY CS 2202 DIGITAL PRINCIPLES AND SYSTEM DESIGN

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

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

Introduction to Sequential Circuits

Flip-Flops and Sequential Circuit Design

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

Counter dan Register

CHAPTER1: Digital Logic Circuits

Sequential Circuit Design: Part 1

Sequentielle Schaltelemente

CHAPTER 11 LATCHES AND FLIP-FLOPS

Registers and Counters

Chapter 5: Synchronous Sequential Logic

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

Chapter 5 Flip-Flops and Related Devices

ECE 263 Digital Systems, Fall 2015

Lecture 11: Sequential Circuit Design

Transcription:

equential Logic equential Circuits equential Circuits imple circuits with feedback Latches Edge-triggered flip-flops Timing Methodologies Cascading flip-flops for proper operation Clock skew Basic egisters hift registers Circuits with Feedback Outputs = f(inputs, past inputs, past outputs) Basis for building "memory" into logic circuits oor combination lock is an example of a sequential circuit tate is memory tate is an "output" and an "input" to combinational logic Combination storage elements are also memory value comparator C C2 C3 multiplexer mux control new equal comb. logic state reset equal open/closed C 5 - pring 24 Lec. #6 equential Logic - C 5 - pring 24 Lec. #6 equential Logic - 2 Circuits with Feedback implest Circuits with Feedback How to control feedback? What stops values from cycling around lessly Two inverters form a static memory cell Will hold value as long as it has power applied X X2 Xn switching network Z Z2 Zn "remember" "stored value" How to get a new value into the memory cell? electively break feedback path Load new value into cell "data" "load" "stored value" C 5 - pring 24 Lec. #6 equential Logic - 3 C 5 - pring 24 Lec. #6 equential Logic - 4 Memory with Cross-coupled Gates Timing Behavior Cross-coupled NO gates imilar to inverter pair, with capability to force output to (reset=) or (set=) ' ' Cross-coupled NAN gates imilar to inverter pair, with capability to force output to (reset=) or (set=) ' ' ' ' \ eset Hold et eset et ' ace C 5 - pring 24 Lec. #6 equential Logic - 5 C 5 - pring 24 Lec. #6 equential Logic - 6

tate Behavior of - latch Theoretical - Latch Behavior Truth table of - latch behavior hold unstable ' ' ' ' = = tate iagram tates: possible values Transitions: changes based on inputs ' = possible oscillation between states and = = = = = = ' ' = = = = ' = = = C 5 - pring 24 Lec. #6 equential Logic - 7 C 5 - pring 24 Lec. #6 equential Logic - 8 Observed - Latch Behavior - Latch Analysis Very difficult to observe - latch in the - state One of or usually changes first Ambiguously returns to state - or - A so-called "race condition" Or non-deterministic transition = = ' = = = = = ' ' = = = = C 5 - pring 24 Lec. #6 equential Logic - 9 = = Break feedback path (t) (t+ ) hold reset set X not allowed X ' (t) (t) C 5 - pring 24 Lec. #6 equential Logic - X X characteristic equation (t+ ) = + (t) (t+ ) Gated - Latch Clocks Control when and inputs matter Otherwise, the slightest glitch on or while enable is low could cause change in value stored et ' enable' ' eset ' Used to keep time Wait long enough for inputs (' and ') to settle Then allow to have effect on value stored Clocks are regular periodic signals Period (time between ticks) uty-cycle (time is high between ticks - expressed as % of period) duty cycle (in this case, 5%) ' ' enable' ' period C 5 - pring 24 Lec. #6 equential Logic - C 5 - pring 24 Lec. #6 equential Logic - 2

Clocks (cont d) Cascading Latches Controlling an - latch with a Can't let and change while is active (allowing and to pass) Only have half of period for signal changes to propagate ignals must be stable for the other half of period ' 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 period Worry about logic between latches (arrows) that is too fast ' ' ' stable changing stable changing stable ' ' ' and ' C 5 - pring 24 Lec. #6 equential Logic - 3 C 5 - pring 24 Lec. #6 equential Logic - 4 Master-lave tructure The s Catching Problem Break flow by alternating s (like an air-lock) Use positive to latch inputs into one - latch Use negative to change outputs with another - 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 but does not affect any cascaded flip-flops master stage slave stage P' ' P C 5 - pring 24 Lec. #6 equential Logic - 5 ' In first - stage of master-slave FF -- glitch on or while is high "caught" by master stage Leads to constraints on logic to be hazard-free P P' ' et eset s catch master stage P' ' P Master Outputs lave Outputs C 5 - pring 24 Lec. #6 equential Logic - 6 slave stage ' Flip-Flop Edge-Triggered Flip-Flops Make and complements of each other Eliminates s catching problem Can't just hold previous value (must have new value ready every period) Value of just before goes low is what is stored in flipflop Can make - flip-flop by adding logic to make = + ' master stage P' ' P C 5 - pring 24 Lec. #6 equential Logic - 7 slave stage ' ' gates Clk= More efficient solution: only 6 gates sensitive to inputs only near edge of signal (not while high) holds ' when goes low negative edge-triggered flip-flop (-FF) 4-5 gate delays must respect setup and hold time constraints to successfully capture input C 5 - pring 24 Lec. #6 equential Logic - 8 holds when goes low characteristic equation (t+) =

Edge-Triggered Flip-Flops (cont d) Edge-Triggered Flip-Flops (cont d) tep-by-step analysis =, Clk High Act as inverters Clk= Clk= Clk= Hold state new new old when goes high-to-low when is low data is latched data is held C 5 - pring 24 Lec. #6 equential Logic - 9 C 5 - pring 24 Lec. #6 equential Logic - 2 Edge-Triggered Flip-Flops (cont d) Edge-Triggered Flip-Flops (cont d) =, Clk High =, Clk LOW Act as inverters Clk= Clk= C 5 - pring 24 Lec. #6 equential Logic - 2 C 5 - pring 24 Lec. #6 equential Logic - 22 Edge-Triggered Flip-Flops (cont d) 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 Negative Edge Trigger FF in Verilog module d_ff (q, q_bar, data, clk); input data, clk; output q, q_bar; reg q; assign q_bar = ~q; pos pos' neg neg' positive edge-triggered FF negative edge-triggered FF always @(negedge clk) q <= data; C 5 - pring 24 Lec. #6 equential Logic - 23 C 5 - pring 24 Lec. #6 equential Logic - 24

Timing Methodologies Timing Methodologies (cont d) ules for interconnecting components and s Guarantee proper operation of system when strictly followed Approach deps 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 flipflops (2) No flip-flop changes state more than once per ing event C 5 - pring 24 Lec. #6 equential Logic - 25 efinition of terms : 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 ing event by which the input must be stable (Tsu) hold time: minimum time after the ing event until which the input must remain stable (Th) input T su T h data there is a timing "window" stable changing around the ing event data during which the input must remain stable and unchanged in order to be recognized C 5 - pring 24 Lec. #6 equential Logic - 26 Comparison of Latches and Flip-Flops Comparison of Latches and Flip-Flops (cont d) Type When inputs are sampled When output is valid uned always propagation delay from input change latch positive edge-triggered flip-flop G transparent (level-sensitive) latch edge latch behavior is the same unless input changes while the is high level-sensitive high propagation delay from input change latch (Tsu/Th around falling or edge (whichever is later) edge of ) master-slave high propagation delay from falling edge flip-flop (Tsu/Th around falling of edge of ) negative hi-to-lo transition propagation delay from falling edge edge-triggered (Tsu/Th around falling of flip-flop edge of ) C 5 - pring 24 Lec. #6 equential Logic - 27 C 5 - pring 24 Lec. #6 equential Logic - 28 Typical Timing pecifications Cascading Edge-triggered Flip-Flops Positive edge-triggered flip-flop etup and hold times Minimum width Propagation delays (low to high, high to low, max and typical) Tsu 2ns Th 5ns Tsu 2ns Th 5ns hift 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) OUT Tw 25ns Tplh 25ns 3ns Tphl 4ns 25ns all measurements are made from the ing event that is, the rising edge of the C 5 - pring 24 Lec. #6 equential Logic - 29 C 5 - pring 24 Lec. #6 equential Logic - 3

Cascading Edge-triggered Flip-Flops (cont d) Clock kew 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 T su 4ns T h 2ns T p 3ns T su 4ns T h 2ns T p 3ns C 5 - pring 24 Lec. #6 equential Logic - 3 timing constraints guarantee proper operation of cascaded components assumes infinitely fast distribution of the 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 to arrive at flip-flop is comparable to delays through logic Effect of skew on cascaded flip-flops: In is a delayed version of original state: =, =, = due to skew, next state becomes: =, =, and not =, = C 5 - pring 24 Lec. #6 equential Logic - 32 ummary of Latches and Flip-Flops Flip-Flop Features evelopment of -FF Level-sensitive used in custom integrated circuits can be made with 4 switches Edge-triggered used in programmable logic devices Good choice for data storage register Historically J-K FF was popular but now never used imilar to - but with - being used to toggle output (complement state) Good in days of TTL/I (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 C 5 - pring 24 Lec. #6 equential Logic - 33 eset (set state to ) ynchronous: new = ' old (when next edge arrives) Asynchronous: doesn't wait for, quick but dangerous Preset or set (set state to ) (or sometimes P) ynchronous: new = old + (when next edge arrives) Asynchronous: doesn't wait for, quick but dangerous Both reset and preset new = ' old + (set-dominant) new = ' old + ' (reset-dominant) elective input capability (input enable/load) L or EN Multiplexer at input: new = L' + L old Load may/may not override reset/set (usually / have priority) Complementary outputs and ' C 5 - pring 24 Lec. #6 equential Logic - 34 egisters hift egister Collections of flip-flops with similar controls and logic tored values somehow related (e.g., form binary value) hare, reset, and set lines imilar logic at each stage Examples hift registers Counters OUT OUT2 OUT3 OUT4 Holds samples of input tore last 4 input values in sequence 4-bit shift register: OUT OUT2 OUT3 OUT4 2 3 4 C 5 - pring 24 Lec. #6 equential Logic - 35 C 5 - pring 24 Lec. #6 equential Logic - 36

hift egister Verilog hift egister Verilog module shift_reg (out4, out3, out2, out, in, clk); output out4, out3, out2, out; input in, clk; reg out4, out3, out2, out; always @(posedge clk) out4 <= out3; out3 <= out2; out2 <= out; out <= in; module shift_reg (out, in, clk); output [4:] out; input in, clk; reg [4:] out; always @(posedge clk) out <= {out[3:], in}; C 5 - pring 24 Lec. #6 equential Logic - 37 C 5 - pring 24 Lec. #6 equential Logic - 38 Universal hift egister esign of Universal hift egister Holds 4 values erial or parallel inputs erial or parallel outputs Permits shift left or right hift in new values from left or right output left_in left_out clear s s input right_out right_in clear sets the register contents and output to s and s determine the shift function s s function hold state shift right shift left load new input Consider one of the four flip-flops New value at next cycle: clear s s new value output output value of FF to left (shift right) output value of FF to right (shift left) input to N-th cell [N-] (left) Nth cell to N+th cell CLEA s and s 2 3 control mux [N+] (right) Input[N] C 5 - pring 24 Lec. #6 equential Logic - 39 C 5 - pring 24 Lec. #6 equential Logic - 4 Universal hift egister Verilog hift egister Application module univ_shift (out, lo, ro, in, li, ri, s, clr, clk); output [3:] out; output lo, ro; input [3:] in; input [:] s; input li, ri, clr, clk; reg [3:] out; Parallel-to-serial conversion for serial transmission parallel outputs assign lo = out[3]; assign ro = out[]; always @(posedge clk or clr) if (clr) out <= ; else case (s) 3: out <= in; 2: out <= {out[2:], ri}; : out <= {li, out[3:]}; : out <= out; case parallel inputs serial transmission C 5 - pring 24 Lec. #6 equential Logic - 4 C 5 - pring 24 Lec. #6 equential Logic - 42

Pattern ecognizer Counters Combinational function of input samples In this case, recognizing the pattern on the single input signal OUT equences through a fixed set of patterns In this case,,,, If one of the patterns is its initial state (by loading or set/reset) OUT OUT2 OUT3 OUT4 OUT OUT2 OUT3 OUT4 Mobius (or Johnson) counter In this case,,,,,,,, OUT OUT2 OUT3 OUT4 C 5 - pring 24 Lec. #6 equential Logic - 43 C 5 - pring 24 Lec. #6 equential Logic - 44 Binary Counter Binary Counter Verilog Logic between registers (not just multiplexer) XO decides when bit should be toggled Always for low-order bit, only when first bit is true for second bit, and so on module shift_reg (out4, out3, out2, out, clk); output out4, out3, out2, out; input in, clk; reg out4, out3, out2, out; OUT OUT2 OUT3 OUT4 always @(posedge clk) out4 <= (out & out2 & out3) ^ out4; out3 <= (out & out2) ^ out3; out2 <= out ^ out2; out <= out ^ b ; C 5 - pring 24 Lec. #6 equential Logic - 45 C 5 - pring 24 Lec. #6 equential Logic - 46 Binary Counter Verilog Four-bit Binary ynchronous Up-Counter module shift_reg (out4, out3, out2, out, clk); output [4:] out; input in, clk; reg [4:] out; always @(posedge clk) out <= out + ; tandard component with many applications Positive edge-triggered FFs w/ sync load and clear inputs Parallel load data from, C, B, A Enable inputs: must be asserted to enable counting CO: ripple-carry out used for cascading counters high when counter is in its highest state implemented using an AN gate (2) CO goes high (3) High order 4-bits are incremented () Low order 4-bits = EN C CO B A C LOA B A CL C 5 - pring 24 Lec. #6 equential Logic - 47 C 5 - pring 24 Lec. #6 equential Logic - 48

Offset Counters equential Logic ummary tarting offset counters use of synchronous load e.g.,,,,,,,,,,,... Ending offset counter comparator for ing value e.g.,,,,...,,, Combinations of the above (start and stop value) C 5 - pring 24 Lec. #6 equential Logic - 49 EN CO C C B B A A LOA CL EN C B A LOA CL CO C B A Fundamental building block of circuits with state Latch and flip-flop - latch, - master/slave, master/slave, edge-triggered FF Timing methodologies Use of s Cascaded FFs work because prop delays exceed hold times Beware of skew Basic registers hift registers Pattern detectors Counters C 5 - pring 24 Lec. #6 equential Logic - 5