Finite State Machines Prof. Sirer COMP 303 Koç University.

Slides:



Advertisements
Similar presentations
ENGIN112 L23: Finite State Machine Design Procedure October 27, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 23 Finite State Machine.
Advertisements

Lab 2: Finite State Machines CS 3410 Spring 2015.
State-machine structure (Mealy)
Prof. Kavita Bala and Prof. Hakim Weatherspoon CS 3410, Spring 2014 Computer Science Cornell University See P&H Appendix B.7. B.8, B.10, B.11.
State Machine Design Procedure
COE 202: Digital Logic Design Sequential Circuits Part 3
Computing Machinery Chapter 5: Sequential Circuits.
Circuits require memory to store intermediate data
State and Finite State Machines
Lecture 22: Sequential Circuits Today’s topic –Clocks and sequential circuits –Finite state machines 1.
Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University See P&H Appendix B.7. B.8, B.10, B.11.
Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University See P&H Appendix B.7. B.8, B.10, B.11.
Sequential Design Part II. Output A(t+1) =D A = AX + BX B(t+1) =D B = AX Y = AX + BX.
ECE 331 – Digital System Design
Sequential Circuits and Finite State Machines Prof. Sin-Min Lee
Give qualifications of instructors: DAP
Sequential Circuits Problems(I) Prof. Sin-Min Lee Department of Mathematics and Computer Science Algorithm = Logic + Control.
State & Finite State Machines Hakim Weatherspoon CS 3410, Spring 2011 Computer Science Cornell University See P&H Appendix C.7. C.8, C.10, C.11.
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
ENGIN112 L25: State Reduction and Assignment October 31, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 25 State Reduction and Assignment.
Lecture 8: Sequential Networks and Finite State Machines CSE 140: Components and Design Techniques for Digital Systems Fall 2014 CK Cheng Dept. of Computer.
EECS 370 Discussion 1 xkcd.com. EECS 370 Discussion Topics Today: – Floating Point – Finite State Machines – Combinational Logic – Sequential Logic 2.
ECE 331 – Digital Systems Design Sequential Logic Circuits: FSM Design (Lecture #20)
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Introduction to Sequential Logic Design Finite State-Machine Design.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 5 – Sequential Circuits Logic and Computer.
ECE 3130 – Digital Electronics and Design Lab 6 State Machines Fall 2012 Allan Guan.
1 CSE370, Lecture 19 Lecture 19 u Logistics n Lab 8 this week to be done in pairs íFind a partner before your lab period íOtherwise you will have to wait.
Asynch 1.1 Asynchronous Counters 1 ©Paul Godin Last Edit Sept 2009.
Introduction to State Machine
2017/4/24 1.
SEQUENTIAL LOGIC By Tom Fitch. Types of Circuits Combinational: Gates Combinational: Gates Sequential: Flip-Flops Sequential: Flip-Flops.
Lecture 5. Sequential Logic 2 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
DLD Lecture 26 Finite State Machine Design Procedure.
Digital Logic Design.

1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
Prof. Kavita Bala and Prof. Hakim Weatherspoon CS 3410, Spring 2014 Computer Science Cornell University See P&H Appendix B.7. B.8, B.10, B.11.
Sequential Circuit: Design BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
State Machine Design State Machine Design Digital Electronics
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP
1 Lecture 13: Sequential Circuits, FSM Today’s topics:  Sequential circuits  Finite state machines  Single-cycle CPU Reminder: midterm on Tue 10/20.
Sequential Networks and Finite State Machines
Lecture 4. Sequential Logic #2
Sequential logic design principles
EKT 221 : Digital 2 COUNTERS.
COMP541 Sequential Logic – 2: Finite State Machines
Dr. Clincy Professor of CS
ECE 301 – Digital Electronics
CSE 140L Discussion Finite State Machines.
Lecture 13: Sequential Circuits, FSM
Hakim Weatherspoon CS 3410 Computer Science Cornell University
ECE 3130 – Digital Electronics and Design
Introduction to Sequential Circuits
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
State Machine Design State Machine Design Digital Electronics
MTE 202, Summer 2016 Digital Circuits Dr.-Ing. Saleh Hussin
Electronics for Physicists
Lecture 24 Logistics Last lecture Today HW7 back today
FINITE STATE MACHINES.
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
CSE 140 Lecture 9 Sequential Networks
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
Lecture 4 Sequential units. Registers
COE 202: Digital Logic Design Sequential Circuits Part 3
Lecture 4: Finite State Machines
Presentation transcript:

Finite State Machines Prof. Sirer COMP 303 Koç University

Finite State Machines An electronic machine which has external inputs externally visible outputs internal state Output and next state depend on inputs current state

Designing an FSM Draw a state diagram Write down state transition table Assign numbers to states Determine logic equations for all flip-flops and outputs

A Simple Example Goal: flash hello on LEDs Inputs: clock Outputs: Just one 7-segment LED Flash “h” then “e” then “l” then “l” then “o” h = e = l = o = o0o0 o1o1 o2o2 o3o3 o4o4 o5o5 o6o6

HELLObox: State Diagram Determine the transitions label all edges (transitions) with the inputs that cause them, unlabeled edges are unconditional transitions show start state S0S1S2S3S4 H E L L O

HELLObox: State Table Current State Next State Output S0S S1S S2S S3S S4S Build state table rote encoding of the state diagram

HELLObox: State Assignment 1 Current State Next State Output Assign bit patterns to states that would make the resulting device simple One option is shown Determine logic equations for every bit of output and next state, for every flip- flop and output

HELLObox #1 10 bits of information (7 outputs + 3 bits of next state) are computed by the combinatorial circuit All 10 bits have non- trivial logic equations flip-flops combinational circuit o0o0 o1o1 o2o2 o3o3 o4o4 o5o5 o6o6

HELLObox: State Assignment 2 Current State Next State Output Assign bit patterns to states that would make the resulting device simple Here, we use far more bits than necessary to simplify the combinatorial circuit

HELLObox #2 15 bits of information (7 outputs + 8 bits of next state) are computed by the combinatorial circuit 8 bits have non-trivial logic equations all 7 outputs are simple pass-throughs flip-flops combinational circuit o0o0 o1o1 o2o2 o3o3 o4o4 o5o5 o6o6

A Traffic Light There is a large avenue and a Hospital ER on a side street The avenue traffic light should be green at all times Except when an ambulance is waiting on the side street A sensor detects a waiting ambulance Design the light controller H a

A Traffic Light There is a large avenue and a Hospital ER on a side street The avenue traffic light should be green at all times Except when an ambulance is waiting on the side street H

A Traffic Light There is a large avenue and a Hospital ER on a side street The avenue traffic light should be green at all times Except when an ambulance is waiting on the side street H

A Traffic Light There is a large avenue and a Hospital ER on a side street The avenue traffic light should be green at all times Except when an ambulance is waiting on the side street H

A Traffic Light There is a large avenue and a Hospital ER on a side street The avenue traffic light should be green at all times Except when an ambulance is waiting on the side street H

A Traffic Light There is a large avenue and a Hospital ER on a side street The avenue traffic light should be green at all times Except when an ambulance is waiting on the side street H

A Traffic Light There is a large avenue and a Hospital ER on a side street The avenue traffic light should be green at all times Except when an ambulance is waiting on the side street H

A Traffic Light There is a large avenue and a Hospital ER on a side street The avenue traffic light should be green at all times Except when an ambulance is waiting on the side street H

A Traffic Light One input a Six outputs (AR, AO, AG, HR, HO, HG) & S0S1S2S3S4S5

FSM: Serial Adder Add two input bit streams streams are sent with least-significant-bit (lsb) first …10110 …01111 …00101

FSM: State Diagram Two states: S0 (no carry), S1 (carry in hand) Inputs: a and b Output: z Arcs labelled with input bits a and b, and output z S0 S1 00/0 10/101/110/001/0 11/1 00/1 11/0

Serial Adder: State Table Write down all input and state combinations abstate z next state 00S S1 00 1S0 01S

Serial Adder: State Assignment Two states, so 1-bit is sufficient A single flip-flop will encode the state abs zs’

Serial Adder: Circuit Equations z = abs + abs + abs + abs s’ = abs + abs + abs + abs clk QD z a b combinational logic s s’