CSE 140: Components and Design Techniques for Digital Systems Lecture 7: Sequential Networks CK Cheng Dept. of Computer Science and Engineering University.

Slides:



Advertisements
Similar presentations
Changes in input values are reflected immediately (subject to the speed of light and electrical delays) on the outputs Each gate has an associated “electrical.
Advertisements

1 Introduction Sequential circuit –Output depends not just on present inputs (as in combinational circuit), but on past sequence of inputs Stores bits,
Sequential Logic ENEL 111. Sequential Logic Circuits So far we have only considered circuits where the output is purely a function of the inputs With.
Sequential Digital Circuits Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
1 Lecture 14 Memory storage elements  Latches  Flip-flops State Diagrams.
Give qualifications of instructors: DAP
ECE C03 Lecture 81 Lecture 8 Memory Elements and Clocking Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Digital Design - Sequential Logic Design Chapter 3 - Sequential Logic Design.
CHAPTER 3 Sequential Logic/ Circuits.  Concept of Sequential Logic  Latch and Flip-flops (FFs)  Shift Registers and Application  Counters (Types,
CS 151 Digital Systems Design Lecture 19 Sequential Circuits: Latches.
ECE 331 – Digital System Design Latches and Flip-Flops (Lecture #17) The slides included herein were taken from the materials accompanying Fundamentals.
Multiplexors Sequential Circuits and Finite State Machines Prof. Sin-Min Lee Department of Computer Science.
1 Sequential Circuits –Digital circuits that use memory elements as part of their operation –Characterized by feedback path –Outputs depend not only on.
1 Lecture 20 Sequential Circuits: Latches. 2 Overview °Circuits require memory to store intermediate data °Sequential circuits use a periodic signal to.
Sequential Logic Computer Organization Ellen Walker Hiram College Figures from Computer Organization and Design 3ed, D.A. Patterson & J.L. Hennessey, Morgan.
Circuits require memory to store intermediate data
EKT 124 / 3 DIGITAL ELEKTRONIC 1
ECE 424 – Introduction to VLSI Design Emre Yengel Department of Electrical and Communication Engineering Fall 2014.
Unit 11 Latches and Flip-Flops Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh.
CS 140 Lecture 7 Professor CK Cheng 4/23/02. Part II. Sequential Network (Ch ) 1.Flip-flops SR, D, T, JK, 2.SpecificationState Table 3.Implementation.
EECC341 - Shaaban #1 Lec # 13 Winter Sequential Logic Circuits Unlike combinational logic circuits, the output of sequential logic circuits.
CSE 140 Lecture 8 Sequential Networks Professor CK Cheng CSE Dept. UC San Diego 1.
CS 140 Lecture 8 Sequential Networks Professor CK Cheng CSE Dept. UC San Diego.
ENGIN112 L20: Sequential Circuits: Flip flops October 20, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 20 Sequential Circuits: Flip.
CS 151 Digital Systems Design Lecture 20 Sequential Circuits: Flip flops.
11/15/2004EE 42 fall 2004 lecture 321 Lecture #32 Registers, counters etc. Last lecture: –Digital circuits with feedback –Clocks –Flip-Flops This Lecture:
Sequential Circuits. 2 Sequential vs. Combinational Combinational Logic:  Output depends only on current input −TV channel selector (0-9) Sequential.
CS 140 Lecture 8 Professor CK Cheng 10/22/02. Part II. Sequential Network 1.Flip-flops SR, D, T, JK, State Table Characteristic Eq. Q(t+1) = f(x(t), Q(t)).
Contemporary Logic Design Sequential Logic © R.H. Katz Transparency No Chapter #6: Sequential Logic Design Sequential Switching Networks.
Chapter 3: Sequential Logic Circuit EKT 121 / 4 ELEKTRONIK DIGIT 1.
1 CSE370, Lecture 14 Lecture 14 u Logistics n Midterm 1: Average 90/100. Well done! n Midterm solutions online n HW5 due date delayed until this Friday.
Sequential Circuits Chapter 4 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S.
ETE Digital Electronics Latches and Flip-Flops [Lecture:12] Instructor: Sajib Roy Lecturer, ETE, ULAB.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
COE 202: Digital Logic Design Sequential Circuits Part 1
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 9 Sequential.
Sequential Logic Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer Organization and.
Flip Flops 3.1 Latches and Flip-Flops 3 ©Paul Godin Created September 2007 Last Edit Aug 2013.
1 CSE370, Lecture 15 Lecture 15 u Logistics n HW5 due this Friday n HW6 out today, due Friday Feb 20 n I will be away Friday, so no office hour n Bruce.
Sequential Logic Combinatorial components: the output values are computed only from their present input values. Sequential components: their output values.
Computer Organization & Programming Chapter 5 Synchronous Components.
CS 352 : Computer Organization and Design University of Wisconsin-Eau Claire Dan Ernst Latches & Flip-Flops.
Lecture 7: Sequential Networks CSE 140: Components and Design Techniques for Digital Systems Fall 2014 CK Cheng Dept. of Computer Science and Engineering.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
CEC 220 Digital Circuit Design Latches and Flip-Flops Monday, March 03 CEC 220 Digital Circuit Design Slide 1 of 19.
EKT 121 / 4 ELEKTRONIK DIGIT I
Lecture 5. Sequential Logic 1 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
Chapter5: Synchronous Sequential Logic – Part 1
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
Dept. of Electrical Engineering
7. Latches and Flip-Flops Digital Computer Logic.
CHAPTER 11 LATCHES AND FLIP-FLOPS This chapter in the book includes: Objectives Study Guide 11.1Introduction 11.2Set-Reset Latch 11.3Gated D Latch 11.4Edge-Triggered.
Sequential logic circuits First Class 1Dr. AMMAR ABDUL-HAMED KHADER.
CSE 140 Lecture 8 Sequential Networks
Digital Design - Sequential Logic Design
Lecture 4. Sequential Logic #1
Lecture 7: Sequential Networks
Sequential Networks and Finite State Machines
Chapter #6: Sequential Logic Design
Digital Design Lecture 9
ECE Digital logic Lecture 16: Synchronous Sequential Logic
Sequential Networks and Finite State Machines
CS Fall 2005 – Lec. #5 – Sequential Logic - 1
Lecture 7: Sequential Networks
CSE 370 – Winter Sequential Logic - 1
Lecture 16 Logistics Last lecture Today HW5 out, due next wednesday
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 16 Logistics Last lecture Today HW5 out, due next wednesday
Sequential Digital Circuits
Lecture 3: Timing & Sequential Circuits
Presentation transcript:

CSE 140: Components and Design Techniques for Digital Systems Lecture 7: Sequential Networks CK Cheng Dept. of Computer Science and Engineering University of California, San Diego 1

What is a sequential circuit? 2 “A circuit whose output depends on current inputs and past outputs” “A circuit with memory” Memory => Time

Part II. Sequential Networks Memory: Flip flops Specification: Finite State Machines Implementation: Excitation Tables Main Theme: Timing Present time = t and next time = t+1 Timing constraints to separate the present and next times. Memory / Time steps Clock xixi yiyi sisi y i = f i (S t,X) s i t+1 = g i (S t,X) 3

Sequential Networks Memory Components –Hierarchy of Memory –Basic Mechanism of Memory –Types of Flip-Flops Implementation –Finite State Machine 4

Memory Hierarchy 5 Hard disk Main Memory Cache Registers What are registers made of? Flip-Flops, Latches

The usage of a sequential machine 6 iClicker Question: A.Digital systems are implemented using sequential machines. B.Only a small subset of digital systems can be implemented using sequential machines. C.Sequential machines are too simple for complicated digital systems.

Fundamental Memory Mechanism 7

Memory Mechanism: Capacitive Load Fundamental building block of sequential circuits Two outputs: Q, Q There is a feedback loop! In a typical combinational logic, there is no feedback loop. No inputs 8

Capacitive Loads Consider the two possible cases: –Q = 0: then Q’ = 1 and Q = 0 (consistent) –Q = 1: then Q’ = 0 and Q = 1 (consistent) –Bistable circuit stores 1 bit of state in the state variable, Q (or Q’ ) –Hold the value due to capacitive charges and feedback loop strengthening But there are no inputs to control the state 9

iClicker 10 Q. Given a memory component made out of a loop of inverters, the number of inverters in the loop has to be A.Even B.Odd

Flight attendant call button –Press call: light turns on Stays on after button released –Press cancel: light turns off –Logic gate circuit to implement this? 11 a Bit Storage Blue light Call button Cancel button 1. Call button pressed – light turns on Bit Storage Blue light Call button Cancel button 2. Call button released – light stays on Bit Storage Blue light Call button Cancel button 3. Cancel button pressed – light turns off SR latch implementation –Call=1 : sets Q to 1 and keeps it at 1 –Cancel=1 : resets Q to 0 R S Q Call button Blue light Cancel button

SR (Set/Reset) Latch SR Latch Consider the four possible cases: –S = 1, R = 0 –S = 0, R = 1 –S = 0, R = 0 –S = 1, R = 1 12

SR Latch Analysis –S = 1, R = 0: –S = 0, R = 1: 13

SR Latch Analysis –S = 1, R = 0: then Q = 1 and Q = 0 –S = 0, R = 1: then Q = 0 and Q = 1 14

SR Latch Analysis –S = 1, R = 1: 15

SR Latch Analysis –S = 0, R = 0: 16

SR Latch Analysis –S = 0, R = 0: then Q = Q prev –S = 1, R = 1: then Q = 0 and Q = 0 17

S R y Q Q = (R+y)’ y = (S+Q)’ 18

SR Latch S R SR F-F (Set-Reset) Inputs: S, R State: (Q, y) y Q 19

Id Q(t) y(t) S R Q(t 1 ) y(t 1 ) Q(t 2 )y(t 2 ) Q(t 3 ) y(t 3 ) Q y State Transition SR Q y State Present Next State diagram

CASES: SR=01, (Q,y) = (0,1) SR=10, (Q,y) = (1,0) SR=11, (Q,y) = (0,0) SR= 00 => if (Q,y) = (0,0) or (1,1), the output keeps changing 21 Q. To avoid the SR latch output from toggling or behaving in an undefined way which input combinations should be avoided: A. (S, R) = (0, 0) B. (S, R) = (1, 1)

SR Latch

SR Latch Analysis –S = 0, R = 0: then Q = Q prev and Q = Q prev (memory!) –S = 1, R = 1: then Q = 0 and Q = 0 (invalid state: Q ≠ NOT Q) 23

CASES SR=01: (Q,y) = (0,1) SR=10: (Q,y) = (1,0) SR=11: (Q,y) = (0,0) SR = 00: if (Q,y) = (0,0) or (1,1), the output keeps changing Solutions: Avoid the two cases 1) SR = (0,0), 2) SR = (1,1). Characteristic Expression Q(t+1) = S(t)+R’(t)Q(t) Q(t+1) NS (next state) PS inputs State table SR Q(t) 24

SR Latch Symbol SR stands for Set/Reset Latch –Stores one bit of state (Q) Control what value is being stored with S, R inputs –Set: Make the output 1 (S = 1, R = 0, Q = 1) –Reset: Make the output 0 (S = 0, R = 1, Q = 0) Must do something to avoid invalid state (when S = R = 1) 25

D Latch Two inputs: CLK, D –CLK: controls when the output changes –D (the data input): controls what the output changes to Function –When CLK = 1, D passes through to Q (the latch is transparent) –When CLK = 0, Q holds its previous value (the latch is opaque) Avoids invalid case when Q ≠ NOT Q 26

D Latch Internal Circuit 27

D Latch Internal Circuit 28

D Latch Internal Circuit 29

D Flip-Flop Two inputs: CLK, D Function –The flip-flop “samples” D on the rising edge of CLK When CLK rises from 0 to 1, D passes through to Q Otherwise, Q holds its previous value –Q changes only on the rising edge of CLK A flip-flop is called an edge-triggered device because it is activated on the clock edge 30

D Flip-Flop Internal Circuit 31

D Flip-Flop Internal Circuit Two back-to-back latches (L1 and L2) controlled by complementary clocks When CLK = 0 –L1 is transparent, L2 is opaque –D passes through to N1 When CLK = 1 –L2 is transparent, L1 is opaque –N1 passes through to Q Thus, on the edge of the clock (when CLK rises from 0 1) –D passes through to Q 32

D Flip-Flop vs. D Latch 33

D Flip-Flop vs. D Latch 34

Latch and Flip-flop (two latches) A latch can be considered as a door CLK = 0, door is shutCLK = 1, door is unlocked A flip-flop is a two door entrance CLK = 1CLK = 0CLK = 1 35

D Flip-Flop (Delay) D CLK Q Q’ Id D Q(t) Q(t+1) Characteristic Expression: Q(t+1) = D(t) PS D 0 1 State table NS= Q(t+1) 36

iClicker 37 Can D flip-flip serve as a memory component? A.Yes B.No

JK F-F J CLK Q Q’ ? ? PS JK State table Q(t+1) K 38

JK F-F J CLK Q Q’ Characteristic Expression Q(t+1) = Q(t)K’(t)+Q’(t)J(t) PS JK State table Q(t+1) K 39

T CLK Q Q’ Characteristic Expression Q(t+1) = Q’(t)T(t) + Q(t)T’(t) PS T 0 1 State table Q(t+1) T Flip-Flop (Toggle) 40

Using a JK F-F to implement a D and T F-F JKJK Q Q’ x CLK 41 iClicker What is the function of the above circuit? A.D F-F B.T F-F C.None of the above

Using a JK F-F to implement a D and T F-F JKJK Q Q’ T CLK T flip flop 42

Rising vs. Falling Edge D Flip-Flop 43 D Q’ Q D Q Symbol for rising-edge triggered D flip-flop Symbol for falling-edge triggered D flip-flop Clk rising edges Clk falling edges Internal design: Just invert servant clock rather than master The triangle means clock input, edge triggered

Inputs: CLK, D, EN –The enable input (EN) controls when new data (D) is stored Function –EN = 1: D passes through to Q on the clock edge –EN = 0: the flip-flop retains its previous state Enabled D-FFs

45

Bit Storage Overview 46 S R D Q C D latch Only loads D value present at rising clock edge, so values can’t propagate to other flip- flops during same clock cycle. *Transition happens between two level of flip-flops. SR can’t be 11 if D is stable before and while C=1, and will be 11 for only a brief glitch even if D changes while C=1. *Transition may cross many levels of latches. S1 R1 S Q C R Level-sensitive SR latch S and R only have effect when C=1. We can design outside circuit so SR=11 never happens when C=1. Problem: avoiding SR=11 can be a burden. R (reset) S (set) Q SR latch S=1 sets Q to 1, R=1 resets Q to 0. Problem: SR=11 yield undefined Q. D flip-flop D latch master D latch servant DmQm Cm Ds D Clk Qs’ CsQs Q’ Q

47

Shift register Holds & shifts samples of input 48 DQDQDQDQ IN OUT1OUT2OUT3OUT4 CLK

Pattern Recognizer Combinational function of input samples 49 DQDQDQDQ IN OUT1OUT2OUT3OUT4 CLK OUT

Counters 50 DQDQDQDQ IN OUT1OUT2OUT3OUT4 CLK Sequences through a fixed set of patterns