CS221: Digital Design. Dr. A. Sahu. Indian Institute of Technology Guwahati

Similar documents
Lecture 10: Synchronous Sequential Circuits Design

CS221: Digital Design. Dr. A. Sahu. Indian Institute of Technology Guwahati

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

Models for representing sequential circuits

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

Lecture 8: Sequential Networks and Finite State Machines

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

Finite State Machines CS 64: Computer Organization and Design Logic Lecture #15 Fall 2018

Sequential Logic (3.1 and is a long difficult section you really should read!)

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Synchronous Sequential Circuit Design. Digital Computer Design

Synchronous Sequential Circuit Design

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

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

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

Finite State Machine. By : Ali Mustafa

FSM model for sequential circuits

State Graphs FSMs. Page 1

CSCI 2150 Intro to State Machines

ELE2120 Digital Circuits and Systems. Tutorial Note 9

Lecture 14 Finite state machines

Parity Checker Example. EECS150 - Digital Design Lecture 9 - Finite State Machines 1. Formal Design Process. Formal Design Process

ECE 341. Lecture # 3

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

ENGG 1203 Tutorial. Solution (b) Solution (a) Simplification using K-map. Combinational Logic (II) and Sequential Logic (I) 8 Feb Learning Objectives

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

CPE100: Digital Logic Design I

Digital Logic Design - Chapter 5

Finite State Machine (FSM)

Sequential Synchronous Circuit Analysis

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

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

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

Synchronous Sequential Logic Part I

EEE2135 Digital Logic Design

ELCT201: DIGITAL LOGIC DESIGN

Review for B33DV2-Digital Design. Digital Design

or 0101 Machine

ALU, Latches and Flip-Flops

FYSE420 DIGITAL ELECTRONICS

Fundamentals of Digital Design

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

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

Different encodings generate different circuits

Philadelphia University Student Name: Student Number:

Philadelphia University Student Name: Student Number:

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

L10 State Machine Design Topics

CHW 261: Logic Design

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

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

Digital Circuits ECS 371

State Machines ELCTEC-131

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

10/12/2016. An FSM with No Inputs Moves from State to State. ECE 120: Introduction to Computing. Eventually, the States Form a Loop

CSE140: Digital Logic Design Registers and Counters

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

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.

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

FSM Optimization. Counter Logic Diagram Q1 Q2 Q3. Counter Implementation using RS FF 10/13/2015

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

Chapter 5 Synchronous Sequential Logic

EECS150 - Digital Design Lecture 16 Counters. Announcements

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

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

Chapter 4 Part 2 Sequential Circuits

CprE 281: Digital Logic

Sequential logic and design

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

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

Last lecture Counter design Finite state machine started vending machine example. Today Continue on the vending machine example Moore/Mealy machines

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

Synchronous Sequential Logic

Chapter 6 Introduction to state machines

Digital Control of Electric Drives

Logic Design II (17.342) Spring Lecture Outline

Module 10: Sequential Circuit Design

Generalized FSM model: Moore and Mealy

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

EGR224 F 18 Assignment #4

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

From Sequential Circuits to Real Computers

Digital Circuit Engineering

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

Sequential vs. Combinational

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

14.1. Unit 14. State Machine Design

EXPERIMENT Traffic Light Controller

CE1911 LECTURE FSM DESIGN PRACTICE DAY 1

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

Sequential Circuits Sequential circuits combinational circuits state gate delay

ELCT201: DIGITAL LOGIC DESIGN

State & Finite State Machines

Digital Logic Appendix A

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

Digital Circuit Engineering

Random Number Generator Digital Design - Demo

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

Transcription:

CS221: Digital Design FiniteStateMachine Dr. A. Sahu DeptofComp.Sc.&Engg. Indian Institute of Technology Guwahati

Outline Finite State Machine Describe the sequential behavior using a FSM Example of FSM Convert a finite state machine to a Controller a sequential circuit having A register and Combinational logic

SequentialCircuit:FSM FS SM inp puts b Combinational Circuit s1 s0 State register/ History/ Sequence n1 n0 x FS SM outp puts clk Y (t) = F (a(t),b(t), H) H is History/Sequence /State Formally Describe/mathematically Describe Boolean Algebra: Working Combinational Circuit Finite State Machine: Working of Sequential Circuit

Need Better Way to Design Sequential Circuits Trial and error : not a good design method Will we be able to guess a circuit that works for other desired behavior? How about counting up from 1 to 9? Pulsing an output for 1 cycle every 10 cycles? Detecting the sequence 1 3 5 in binary on a 3 bit input?

Need a Better Way to Design Sequential Circuits Combinationalcircuitdesignprocesshad two important things 1.A Aformalwaytodescribedesiredcircuit desired circuit behavior Booleanequation equation, ortruthtable table 2.A well defined process to convert that behavior to a circuit We need those things for sequence circuit itdi design

Finite State Machine Finite State Machine (FSM) A Awaytodescribedesiredbehaviorof desired behavior of sequential circuit Akin to Boolean equations for combinational behavior List states, and transitions among states 6

Finite State Machine: Example Example: Make x change toggle (0 to 1, or 1 to0)everyclockcycle cycle Two states: Off (x=0), and On (x=1) Transition from Off to On, or On to Off, on rising clock edge Arrow with no starting state points to initial state (when circuit first starts)

Finite State Machine: Example Outputs: x x=0 clk^ x=1 Off clk^ On Off On Off On Off On Off On clk cycle 1 cycle 2 cycle 3 cycle 4 state Off On Off On Outputs: t x

ControllerforOn Off Off Input Output CLK P X N RE1 0 1 1 CLK Combinational Logic RE1 1 0 0 D FF P N X CLK P N Think of Clock Enable: only Rising Edge (RE) Above one may not work: Level Sensitive X P Rising Edge: Clock implicit X N

FSM Example: 0,1,1,1,repeat Want 0, 1, 1, 1, 0, 1, 1, 1,... Each value for one clock cycle Can describe as FSM: Four states, Transition on rising clock edge to next state Outputs: x clk x=0 clk^ x=1 clk ^ x=1 clk^ x=1 State Off On1 On2 On3 Off On1 On2 On3 Off Off On1 On2 On3 Outputs: x clk^

Extend FSM to Three Cycles High Laser Timer Four states: Wait in Off state while b is 0 (b ) Whenb=1(&risingclockedge) b1 edge), transition to On1 Sets X=1 On next two clock edges, transition to On2, then On3, which also set x=1 Sox=1forthreecyclesafterbutton pressed

Extend FSM to Three Cycles High Laser Timer Inputs: b; Outputs: x x=0 Off b *clk^ clk^ b*clk^b x=1 clk^ On1 x=1 On2 clk^ x=1 On3 clk Inputs: b St at e Off Off Off Off Off On1 On2 On3 Off Outputs: x

FSM Simplification: Rising Clock Edges Implicit Showing rising clock on every transition: cluttered Make implicit assume every edge has rising clock What if we wanted a transition withouta rising edge Asynchronous FSMs less common, and advanced topic We consider synchronous FSMs Alltransition on rising edge

FSM Simplification: Rising Clock Edges Implicit Inputs: b; Outputs: x x=0 clk^ Off b *clk^ Inputs: b; Outputs: x x=0 Off b a b*clk^ x=1 clk^ x=1 clk^ x=1 b x=1 x=1 x=1 On1 On2 On3 On1 On2 On3 Note: Transition with no associated condition thus transistions to next state on next clock cycle

Set of states Ex: {Off, On1, On2, On3} St Set of finputs & set of outputs Ex: Inputs: {x}, Outputs: {b} FSM Definition Inputs: b; Outputs: x x=0 Off b Initial state x=1 x=1 x=1 Ex: Off Set of transitions b On1 Describes next states, Ex: Has 5 transitions Set of actions St Sets outputs t while in states tt Ex: x=0, x=1, x=1, and x=1 On2 On3 We often draw FSM graphically, known as state diagram Can also use table (state table), or textual languages

FSM Example: Code Detector Unlock door (u=1) only when buttons pressed in sequence: start, then red, blue, green, red Input from each button: s, r, g, b Also, output aindicates that some colored button pressed a a Start Red Green Blue s r g b a Code detector u Door lock

FSM Example: Code Detector Wait for start (s=1) in Wait, Once started( Start ) If see red, go to Red1 Then, if see blue, go to Blue, Then, if see green, go to Green, Then, if see red, go to Red2 In that state, open the door (u=1) Wrong button at any step, return to Wait

FSM Example: Code Detector Wait a Inputs: s,r,g,b,a; Outputs: u u=0 s s ar ab ag ar Start a u=0 ar Red1 ab Blue ag Green ar Red2 u=0 a a u=0 a u=0 a u=1 Q: Can you trick this FSM to open the door, without knowing the code? A: Yes, hold all buttons simultaneously

ImproveFSMforCodeDetector u=0 Wait s s ar ab ag ar Inputs: s,r,g,b,a; Outputs: u a u=0 ar Start a ab ag ar Red1 Blue Green Red2 a a a u=0 u=0 u=0 u=1 New transition conditionsdetect if wrong button pressed, returns to Wait FSM provides formal, concrete means to accurately define desired behavior

Thanks