Sequential Circuits. Circuits with state. Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T. L06-1

Similar documents
Fundamentals of Digital Design

ALU, Latches and Flip-Flops

Lecture 10: Sequential Networks: Timing and Retiming

Lecture 7: Sequential Networks

Synchronous Sequential Circuit Design. Digital Computer Design

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

Problem Set 9 Solutions

CPE100: Digital Logic Design I

Synchronous Sequential Logic

Chapter 3. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 3 <1>

5. Sequential Logic x Computation Structures Part 1 Digital Circuits. Copyright 2015 MIT EECS

Adders, subtractors comparators, multipliers and other ALU elements

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

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

CS61C : Machine Structures

Preparation of Examination Questions and Exercises: Solutions

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

ALU A functional unit

CS61C : Machine Structures

Lecture 9: Sequential Logic Circuits. Reading: CH 7

Digital Logic Design - Chapter 4

Sequential vs. Combinational

Sequential Logic Worksheet

CS/COE1541: Introduction to Computer Architecture. Logic Design Review. Sangyeun Cho. Computer Science Department University of Pittsburgh

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

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

Chapter 7 Sequential Logic

Adders, subtractors comparators, multipliers and other ALU elements

Example: vending machine

ELCT201: DIGITAL LOGIC DESIGN

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

Chapter 3. Chapter 3 :: Topics. Introduction. Sequential Circuits

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

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

CSE 140 Midterm 2 - Solutions Prof. Tajana Simunic Rosing Spring 2013

CSE140: Design of Sequential Logic

CPE100: Digital Logic Design I

CMPEN 411. Spring Lecture 18: Static Sequential Circuits

Lecture 7: Logic design. Combinational logic circuits

Topic 8: Sequential Circuits

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Logic Design II (17.342) Spring Lecture Outline

CPE100: Digital Logic Design I

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

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

Sequential Logic. Road Traveled So Far

Integrated Circuits & Systems

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

Sequential logic and design

Lecture 8: Sequential Networks and Finite State Machines

Sequential Logic Design: Controllers

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

Different encodings generate different circuits

ESE 570: Digital Integrated Circuits and VLSI Fundamentals

EE141- Spring 2007 Digital Integrated Circuits


State & Finite State Machines

Review for Final Exam

Logic design? Transistor as a switch. Layered design approach. CS/COE1541: Introduction to Computer Architecture. Logic Design Review.

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

Time Allowed 3:00 hrs. April, pages

Digital Control of Electric Drives

Sequential Logic Circuits

Design of Sequential Circuits

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

Models for representing sequential circuits

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

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

Principles of Computer Architecture. Appendix B: Reduction of Digital Logic. Chapter Contents

University of Minnesota Department of Electrical and Computer Engineering

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

CS/COE0447: Computer Organization

CSC 322: Computer Organization Lab

Designing Sequential Logic Circuits

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

Chapter 3 Digital Logic Structures

EEE2135 Digital Logic Design

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

State & Finite State Machines

Sequential Logic. Handouts: Lecture Slides Spring /27/01. L06 Sequential Logic 1

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Programmable Logic Devices II

EECS150 - Digital Design Lecture 23 - FFs revisited, FIFOs, ECCs, LSFRs. Cross-coupled NOR gates

CSE370 HW6 Solutions (Winter 2010)

Digital Design. Sequential Logic

CprE 281: Digital Logic

Y. Tsiatouhas. VLSI Systems and Computer Architecture Lab

6. Finite State Machines

Chapter 4. Sequential Logic Circuits

Fundamentals of Computer Systems

Laboratory Exercise #8 Introduction to Sequential Logic

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

Digital Electronics Sequential Logic

Introduction to Digital Logic

ECE/Comp Sci 352 Digital Systems Fundamentals. Charles R. Kime Section 2 Fall Logic and Computer Design Fundamentals

Timing Constraints in Sequential Designs. 63 Sources: TSR, Katz, Boriello & Vahid

Total time is: 1 setup, 2 AND, 3 XOR, 1 delay = (1*1) + (2*2) + (3*3) + (1*1) = 15ns

FSM model for sequential circuits

Latches. October 13, 2003 Latches 1

Transcription:

Sequential Circuits Circuits with state Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T. L06-1

Combinational circuits A 0 A 1 A n-1. Sel lg(n) O Mux A B Comparator Result: LT, GT, E A lg(n) ecoder. O 0 O 1 O n-1 A B OpSelect - Add, Sub,... - And, Or, Xor, Not,... - GT, LT, E, Zero,... ALU Result Comp? Such circuits have no cycles (feedback) or state elements L06-2

Simple circuits with feedback, i.e., a cycle This circuit can hold a 0 or 1 0 1 0 1 0 1? 0 1 0 1 But how do we change its state? This circuit will oscillate between 0 and 1 Circuits with cycles can hold state Generally behavior is difficult to analyze and requires paying attention to propagation delays L06-3

Latch: a famous circuit that can hold state if C=0, the value of passes to if C=1, the value of holds C C 0 1 0 L Let t-1 represent the value previously held in L; t represents the current value. C 1 1 0 C t-1 t 0 0 X 0 0 1 X 1 1 X 0 0 1 X 1 1 pass hold L06-4

Building circuits with latches C L int L If two latches are driven by the same C signal, they pass signals at the same time and hold signals at the same time. The composed latches look just like a single latch (assuming signals aren t changing too fast) L06-5

Building circuits with latches continued C L int L If latches are driven by inverted C signals, one is always holding, and one is always passing How does this circuit behave? When C = 0, holds its old value, but int follows the input When C = 1, int holds its old value, but follows int doesn t change when C = 0 or C = 1, but it changes its value when C transitions from 0 to 1 (a rising-edge of C) L06-6

Edge-Triggered Flip flop A basic storage element C C L 1 L Suppose C changes periodically (called a Clock signal) C Unstable data Metastability ata is sampled at the rising edge of the clock and must be stable at that time L06-7

Clarification: Flip-Flop Timing t SETUP t HOL CLK CLK t P Flip-flop input should not change around the rising edge of the clock to avoid metastability Formally, should be a stable and valid digital value: For at least t SETUP before the rising edge of the clock For at least t HOL after the rising edge of the clock Flip-flop propagation delay t P is measured from rising edge of the clock (CLKà) L06-8

Meeting the Setup-Time Constraint t CLK CLK 1 2 CL FF1 FF2 CLK 1 œ 2 t P,FF1 t P,CL t SETUP,FF2 To meet FF2 s setup time,! "#$! &',))* +! &',"# +!,-./&,))0 The slowest register-to-register path in the system determines the clock à limited amount of combinational logic between registers L06-9

Meeting the Hold-Time Constraint CLK 1 2 CL FF1 FF2 CLK 1 œ 2 t C,FF1 t C,CL t HOL,FF2 Propagation delay (t P ): Upper bound on time from valid inputs to valid outputs But upper bounds don t help us analyze hold time Contamination delay (t C ): Lower bound on time from invalid inputs to invalid outputs To meet FF2 s hold-time constraint,! "#,%%& +! "#,"(! *+(#,%%, Tools may need to add logic to fast paths to meet t HOL L06-10

Flip-flop with Write Enable The building block of Sequential Circuits EN EN C C 0 1 C EN t 1 t 2 t 3 EN t t+1 0 X 0 0 0 X 1 1 1 0 X 0 1 1 X 1 hold copy input ata is captured only if EN is on No need to show the clock explicitly L06-11

Clocked Sequential Circuits In this class we will deal with only clocked sequential circuits We will also assume that all flip flops are connected to the same clock To avoid clutter, the clock input will be implicit and not shown in diagrams Clock inputs are not needed in BSV descriptions unless we design multi-clock circuits L06-12

Registers En Register: A group of flip-flops with a common clock and enable Register file: A group of registers with a common clock, a shared set of input and output ports L06-13

An example Modulo-4 counter Prev State NextState q1q0 inc = 0 inc = 1 00 00 01 01 01 10 10 10 11 11 11 00 inc=1 inc=0 inc=1 00 01 Finite State q0 t+1 = ~inc q0 t + inc ~q0 t Machine (FSM) = inc Å q0 t representation q1 t+1 = ~inc q1 t + inc ~q1 t q0 t + inc q1 t ~q0 t = ~inc q1 t + inc (q1 t Å q0 t ) 11 inc=0 inc=1 inc=0 10 inc=0 inc=1 L06-14

Circuit for the modulo counter using flipflops q0 t+1 = ~inc q0 t + inc ~q0 t q1 t+1 = ~inc q1 t + inc (q1 t Å q0 t ) We can use two flip flops with enables to store q0 and q1 Notice, the state of the flip flop changes only when inc is 1. Thus, we can simplify the equations as shown q0 t+1 = ~q0 t inc=1 q1 t+1 = q1 t Å q0 t inc q0 q1 L06-15

A method for computing GC Euclid s algorithm for computing the Greatest Common ivisor (GC): a: 15 b: 6 9 6 subtract 3 6 subtract 6 3 swap 3 3 subtract 0 3 subtract answer def gcd(a, b): if a == 0: return b # stop elif a >= b: return gcd(a-b,b) # subtract else: return gcd (b,a) # swap L06-16

Sequential Circuit for GC Suppose we have two registers to hold the values a and b and combinational circuits to compute (a >= b), (a b) and (a!= 0) We can define the next state computation as: p = (a t >= b t ) a t+1 = p.(a t -b t ) + ~p.b t (a t!= 0) b t+1 = p b t + ~p a t At every cycle t, registers a and b should be enabled if (a t!= 0) def gcd(a, b): if a == 0: return b # stop elif a >= b: return gcd(a-b,b) # subtract else: return gcd (b,a) # swap L06-17

Generating the GC circuit Registers with enable Connect the enable signals The data value for registers depends on p; introduce muxes Connect p Connect the next state values for a and b Notice p = (a t >= b t ) a t+1 = p.(a t -b t ) + ~p.b t (a t!= 0) b t+1 = p b t + ~p a t!(=0) a and b will be updated only if a!= 0 The circuit is incomplete we need to define the start condition Much room for optimization: b mux can be eliminated! L06-18 >= a sub b

Finite State Machines (FSM) and Sequential Circuits FSMs are a mathematical object like the Boolean Algebra A computer (in fact any digital hardware) is an FSM Synchronous Sequential Circuits is a method to implement FSMs in hardware input state clock Combinational logic Next state output L06-19

Large digital circuits, e.g., computers Large circuits need to be described as a collection of cooperating FSMs, i.e., as a collection of interconnected modules each of which represents a sequential circuit State diagrams and next-state tables are not suitable for describing such circuits Next lecture sequential machines as objects in an object-oriented language L06-20

Take-home problems Eliminate the mux for register b Introduce muxes to inject the initial values of a and b to start the GC L06-21