ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Similar documents
Digital Logic and Design (Course Code: EE222) Lecture 19: Sequential Circuits Contd..

Synchronous Sequential Logic

Sequential vs. Combinational

ELCT201: DIGITAL LOGIC DESIGN

Chapter 14 Sequential logic, Latches and Flip-Flops

Chapter 7 Sequential Logic

Topic 8: Sequential Circuits

Sequential Synchronous Circuit Analysis

Sequential Circuit Analysis

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

Lecture 14: State Tables, Diagrams, Latches, and Flip Flop

Different encodings generate different circuits

Lecture 8: Sequential Networks and Finite State Machines

Gates and Flip-Flops

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Week-5. Sequential Circuit Design. Acknowledgement: Most of the following slides are adapted from Prof. Kale's slides at UIUC, USA.

Overview of Chapter 4

Memory Elements I. CS31 Pascal Van Hentenryck. CS031 Lecture 6 Page 1

Computers also need devices capable of Storing data and information Performing mathematical operations on such data

Chapter 4 Part 2 Sequential Circuits

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

Synchronous Sequential Logic Part I. BME208 Logic Circuits Yalçın İŞLER

Sequential Logic Circuits

Topic 8: Sequential Circuits. Bistable Devices. S-R Latches. Consider the following element. Readings : Patterson & Hennesy, Appendix B.4 - B.

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

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

Mealy & Moore Machines

Introduction to Digital Logic

Sequential Circuits Sequential circuits combinational circuits state gate delay

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

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

Chapter 4. Sequential Logic Circuits

Lecture 3 Review on Digital Logic (Part 2)

Problem Set 9 Solutions

Synchronous Sequential Logic Part I

The Design Procedure. Output Equation Determination - Derive output equations from the state table

11.1 As mentioned in Experiment 10, sequential logic circuits are a type of logic circuit where the output of

Chapter 5 Synchronous Sequential Logic

EE 209 Logic Cumulative Exam Name:

Fundamentals of Boolean Algebra

Fundamentals of Digital Design

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Sequential Circuit Design

Latches. October 13, 2003 Latches 1

I. Motivation & Examples

ELE2120 Digital Circuits and Systems. Tutorial Note 9

Synchronous Sequential Circuit

or 0101 Machine

Chapter 6 Introduction to state machines

P2 (10 points): Given the circuit below, answer the following questions:

Finite State Machine. By : Ali Mustafa

CprE 281: Digital Logic

ALU, Latches and Flip-Flops

Synchronous Sequential Circuit Design. Digital Computer Design

ECE380 Digital Logic. Synchronous sequential circuits

ELEN Electronique numérique

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Chapter 5 Synchronous Sequential Logic

Analysis and Design of Sequential Circuits: Examples

Laboratory Exercise #8 Introduction to Sequential Logic

S.Y. Diploma : Sem. III [CO/CM/IF/CD/CW] Digital Techniques

Lecture 7: Sequential Networks

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

Lecture 17: Designing Sequential Systems Using Flip Flops

Synchronous Sequential Circuit Design. Dr. Ehab A. H. AL-Hialy Page 1

Roger L. Tokheim. Chapter 8 Counters Glencoe/McGraw-Hill

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

EET 310 Flip-Flops 11/17/2011 1

CSE 140: Components and Design Techniques for Digital Systems. Lecture 9: Sequential Networks: Implementation

Digital Design. Sequential Logic

ELCT201: DIGITAL LOGIC DESIGN

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Schedule. ECEN 301 Discussion #25 Final Review 1. Date Day Class No. 1 Dec Mon 25 Final Review. Title Chapters HW Due date. Lab Due date.

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

Vidyalankar S.E. Sem. III [ETRX] Digital Circuits and Design Prelim Question Paper Solution

S.Y. Diploma : Sem. III [DE/ED/EI/EJ/EN/ET/EV/EX/IC/IE/IS/IU/MU] Principles of Digital Techniques

CS221: Digital Design. Indian Institute of Technology Guwahati

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

Ch 7. Finite State Machines. VII - Finite State Machines Contemporary Logic Design 1

Chapter 9 Asynchronous Sequential Logic

Q: Examine the relationship between X and the Next state. How would you describe this circuit? A: An inverter which is synched with a clock signal.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) State any two Boolean laws. (Any 2 laws 1 mark each)

CPE/EE 422/522. Chapter 1 - Review of Logic Design Fundamentals. Dr. Rhonda Kay Gaede UAH. 1.1 Combinational Logic

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

BER KELEY D AV IS IR VINE LOS AN GELES RIVERS IDE SAN D IEGO S AN FRANCISCO

UMBC. At the system level, DFT includes boundary scan and analog test bus. The DFT techniques discussed focus on improving testability of SAFs.

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

CHAPTER 9: SEQUENTIAL CIRCUITS

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

CPE100: Digital Logic Design I

University of Minnesota Department of Electrical and Computer Engineering

Lecture 10: Synchronous Sequential Circuits Design

6. Finite State Machines

Digital Circuits ECS 371

Hold Time Illustrations

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

Counters. We ll look at different kinds of counters and discuss how to build them

ESE 570: Digital Integrated Circuits and VLSI Fundamentals

Transcription:

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

SEQUENTIAL CIRCUITS: LATCHES

Overview Circuits require memory to store intermediate data Sequential circuits use a periodic signal to determine when to store values. A clock signal can determine storage times Clock signals are periodic Single bit storage element is a flip flop A basic type of flip flop is a latch Latches are made from logic gates NAND, NOR, AND, OR, Inverter

The story so far... Logical operations which respond to combinations of inputs to produce an output. Call these combinational logic circuits. Usually these circuits do not contain loops However, some combinational circuits have loops:

The story so far... Combinational circuits No way of remembering or storing information after inputs have been removed. To handle this, we need sequential logic capable of storing intermediate (and final) results.

Sequential Circuits Inputs Combinational circuit Next state Flip Flops Outputs Present state Timing signal (clock) Clock a periodic external event (input) synchronizes when current state changes happen keeps system well-behaved makes it easier to design and build large systems

Cross-coupled Inverters The system has two stable states A stable value can be stored at inverter outputs Not possible to set a desired state State 1 State 2

Cross-coupled Inverters (cont.) This circuit has no stable states

SR Latch

S-R Latch with NORs R (reset) Q S R Q Q S (set) Q 1 1 1 0 0 1 0 0 0 0 Forbidden 1 0 Set 0 1 Reset 0 1 1 0 Stable S-R latch made from cross-coupled NORs If Q = 1, set state set S If Q = 0, reset state Usually S=0 and R=0 reset R S=1 and R=1 generates unpredictable results Q Q

S-R Latch with NORs R (reset) Q S R Q Q S (set) Q 1 1 1 0 0 1 0 0 0 0 Forbidden 1 0 Set 0 1 Reset 0 1 1 0 Stable

S-R Latch with NORs R (reset) Q S R Q Q S (set) Q 1 1 1 0 0 1 0 0 0 0 Forbidden 1 0 Set 0 1 Reset 0 1 1 0 Stable What happens if both inputs R and S simultaneously change from 1 to 0? Race conditions

S-R Latch with NANDs S R Q Qʼ S R Q Q 0 0 0 1 1 0 1 1 1 1 Forbidden 1 0 Set 0 1 Reset 0 1 1 0 Store Latch made from cross-coupled NANDs Sometimes called S -R latch Usually S=1 and R=1 S=0 and R=0 generates unpredictable results

S-R Latches

NOR S-R Latch with Control Input Only stores data if C = 0 R Q C S Q Input sampling enabled by gates

S-R Latch with control input Occasionally, desirable to avoid latch changes C = 0 disables all latch state changes Control signal enables data change when C = 1 Right side of circuit same as ordinary S-R latch.

D-Latch

D Latch Q 0 indicates the previous state (the previously stored value) X D S Q C Y R Qʼ D C Q Q 0 1 0 1 1 1 1 0 X 0 Q 0 Q 0 X Y C Q Q 0 0 1 Q 0 Q 0 Store 0 1 1 0 1 Reset 1 0 1 1 0 Set 1 1 1 1 1 Disallowed X X 0 Q 0 Q 0 Store

D Latch D C X S Q Qʼ Y R D C Q Q 0 1 0 1 1 1 1 0 X 0 Q 0 Q 0 Input value D is passed to output Q when C is high Input value D is ignored when C is low

D Latch x D Q z Latches on following edge of clock E Clk E Z only changes when E is high If E is high, Z will follow X x z

D Latch Latches on following edge of clock E x D Q z x E C z The D latch stores data indefinitely, regardless of input D values, if C = 0 Forms basic storage element in computers

Symbols for Latches SR latch is based on NOR gates S R latch based on NAND gates D latch can be based on either. D latch sometimes called transparent latch

Summary Latches are based on combinational gates (e.g. NAND, NOR) Latches store data even after data input has been removed S-R latches operate like cross-coupled inverters with control inputs (S = set, R = reset) With additional gates, an S-R latch can be converted to a D latch (D stands for data) D latch is simple to understand conceptually When C = 1, data input D stored in latch and output as Q When C = 0, data input D ignored and previous latch value output at Q

Flip-Flops

Disadvantage of Transparent Latches

Clocking Event What if the output only changed on a C transition? Negative edge triggered C The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again. D Q Qʼ D C Q Q 0 0 1 1 1 0 X 0 Q 0 Q 0

Master-Slave D Flip Flop Consider two latches combined together Only one C value active at a time Output changes on falling edge of the clock D C Q Q 0 1 0 1 1 1 1 0 X 0 Q 0 Q 0

Positive and Negative Edge D Flip-Flop D flops can be triggered on positive or negative edge Bubble before Clock (C) input indicates negative edge trigger

Clocked D Flip-Flop Stores a value on the positive edge of C Input changes at other times have no effect on output

JK Flip-Flop

Positive Edge-Triggered J-K Flip-Flop Created from D flop D = JQ +K Q J sets K resets J=K=1 invert output J K CLK Q Qʼ 0 0 Q 0 Q 0 0 1 0 1 1 0 1 0 1 1 TOGGLE

Clocked J-K Flip Flop Two data inputs, J and K J -> set, K -> reset, if J=K=1 then toggle output Characteristic Table

T Flip-Flop

Positive Edge-Triggered T Flip-Flop Created from D flop T=0 -> keep current K resets T=1 -> invert current T C Q Qʼ 0 Q 0 Q 0 1 TOGGLE

Asynchronous Inputs

Asynchronous Inputs J, K are synchronous inputs o Effects on the output are synchronized with the CLK input. Asynchronous inputs operate independently of the synchronous inputs and clock o Set the FF to 1/0 states at any time.

Asynchronous Inputs

Asynchronous Inputs Note reset signal (R) for D flip flop If R = 0, the output Q is cleared This event can occur at any time, regardless of the value of the CLK

Summary Flip flops are powerful storage elements They can be constructed from gates and latches! D flip flop is simplest and most widely used Asynchronous inputs allow for clearing and presetting the flip flop output Multiple flops allow for data storage The basis of computer memory! Combine storage and logic to make a computation circuit Next time: Analyzing sequential circuits.

ANALYSIS OF SEQUENTIAL CIRCUITS

Overview Understanding flip flop state: Stored values inside flip flops Clocked sequential circuits: Contain flip flops Representations of state: State equations State table State diagram Finite state machines Mealy machine Moore machine

Flip Flop State Behavior of clocked sequential circuit can be determined from inputs, outputs and FF state x D 0 Q 1 Q 0 D 1 D D Q Q Q Q Q 0 Q 1 y Clk y(t) = x(t)q 1 (t)q 0 (t) Q 0 (t+1) = D 0 (t) = x(t)q 1 (t) Q 1 (t+1) = D 1 (t) = x(t) + Q 0 (t)

Output and State Equations Next state dependent on previous state. x D 0 Q 1 Q 0 D 1 D D Q Q Q Q Q 0 Q 1 y Output equation State equations Clk y(t) = x(t)q 1 (t)q 0 (t) Q 0 (t+1) = D 0 (t) = x(t)q 1 (t) Q 1 (t+1) = D 1 (t) = x(t) + Q 0 (t)

State Table Sequence of outputs, inputs, and flip flop states enumerated in state table Present state indicates current value of flip flops Next state indicates state after next rising clock edge Output is output value on current clock edge State Table Present State 0 0 0 1 1 0 1 1 Next State x=0 x=1 Output x=0 x=1 00 10 0 0 10 10 0 0 00 11 0 0 10 11 0 1 Q 1 (t) Q 0 (t) Q 1 (t+1) Q 0 (t+1)

State Table All possible input combinations enumerated All possible state combinations enumerated Separate columns for each output value. Sometimes easier to designate a symbol for each state. Let: s 0 = 00 s 1 = 01 s 2 = 10 s 3 = 11 Present State s 0 s 1 s 2 s 3 Next State x=0 x=1 Output x=0 x=1 s 0 s 2 0 0 s 2 s 2 0 0 s 0 s 3 0 0 s 2 s 3 0 1

State Diagram Circles indicate current state Arrows point to next state For x/y, x is input and y is output 0/0 00 0/0 1/0 Present State 0 0 0 1 1 0 1 1 Next State x=0 x=1 0/0 1/0 01 10 1/0 0/0 Output x=0 x=1 00 10 0 0 10 10 0 0 00 11 0 0 10 11 0 1 11 1/1

State Diagram Each state has two arrows leaving One for x = 0 and one for x = 1 Unlimited arrows can enter a state Note use of state names in this example Easier to identify 0/0 0/0 0/0 1/0 s 0 s 1 s 2 1/0 1/0 0/0 s 3 1/1

Flip Flop Input Equations Boolean expressions which indicate the input to the flip flops. x D 0 Q 1 Q 0 D 1 D D Q Q Q Q Q 0 Q 1 y Clk D Q0 = xq 1 D Q1 = x + Q 0 Format implies type of flop used

Analysis with D Flip-Flops Identify flip flop input equations Identify output equation Note: this example has no output

Mealy Machine Output based on state and present input X(t) present input Comb. Logic Q(t+1) next state Flip Flops Q(t) present state Comb. Logic Y(t) clk

Moore Machine Output based on state only X(t) present input Comb. Logic Q(t+1) next state Flip Flops Q(t) present state Comb. Logic Y(t) clk

Mealy versus Moore

State Diagram with One Input & One Mealy Output State transitions are shown as a function of inputs and current outputs. e.g. 1 1/1 0/0 S1 1/0 Input(s)/Output(s) shown in transition 0/0 S4 1/0 0/0 S3 1/0 S2 0/0

State Diagram with One Input & a Moore Output Moore machine: outputs only depend on the current state Outputs cannot change during a clock pulse if the input variables change Moore Machines usually have more states. No direct path from inputs to outputs Can be more reliable

Summary Flip flops contain state information State can be represented in several forms: State equations State table State diagram Possible to convert between these forms Circuits with state can take on a finite set of values Finite state machine Two types of machines Mealy machine Moore machine