Finite State Machines CT101 – Computing Systems. FSM Overview Finite State Machine is a tool to model the desired behavior of a sequential system. The.

Slides:



Advertisements
Similar presentations
Introduction to Sequential Circuits
Advertisements

FSM Design & Implementation
Lecture 8 Sequential Logic Prof. Sin-Min Lee Department of Computer Science.
Finite State Machines (FSMs)
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
Sequential Logic Design
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Circuits require memory to store intermediate data
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 5 – Sequential Circuits Part 1 – Storage.
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
CS 151 Digital Systems Design Lecture 25 State Reduction and Assignment.
ECE 331 – Digital System Design
Sequential Logic Design Process A sequential circuit that controls Boolean outputs and a specific time- ordered behavior is called a controller. StepDescription.
Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design Finite State.
Spring 2002EECS150 - Lec15-seq2 Page 1 EECS150 - Digital Design Lecture 15 - Sequential Circuits II (Finite State Machines revisited) March 14, 2002 John.
Overview Finite State Machines
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.
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic CMOS logic elements Combinational logic elements and design.
Sequential circuit design
Lecture 17 General finite state machine (FSM) design
Sequential Circuits Chapter 4 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
Chapter 5 - Part Sequential Circuit Design Design Procedure  Specification  Formulation - Obtain a state diagram or state table  State Assignment.
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Digital Logic Design Sequential circuits
Sequential Logic Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer Organization and.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 5 – Sequential Circuits Part 2 – Sequential.
Introduction to Sequential Logic Design Finite State-Machine Design.
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.
EEE2243 Digital System Design Chapter 4: Verilog HDL (Sequential) by Muhazam Mustapha, January 2011.
Introduction to State Machine
1 Chapter 2 Introduction To Finite State Machines Presented By: Cecilia Parng Class: C.S. 147 Prof: Sin-Min Lee.
1 CSE370, Lecture 18 Lecture 20 u Logistics n HW6 due Wednesday n Lab 7 this week (Tuesday exception) n Midterm 2 Friday (covers material up to simple.
DLD Lecture 26 Finite State Machine Design Procedure.
1 Finite State Machines (FSMs) Now that we understand sequential circuits, we can use them to build: Synchronous (Clocked) Finite State Machines Finite.
ANALYSIS OF SEQUENTIAL CIRCUITS by Dr. Amin Danial Asham.
VHDL Discussion Finite State Machines
Analysis and Synthesis of Synchronous Sequential Circuits A “synchronizing” pulse/edge signal (clock) controls the operation of the memory portion of the.
VHDL Discussion Finite State Machines IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
Digital System Design using VHDL
Lecture # 15. Mealy machine A Mealy machine consists of the following 1. A finite set of states q 0, q 1, q 2, … where q 0 is the initial state. 2. An.
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Introduction to Sequential Logic Design Finite State-Machine Analysis.
Finite State Machine. Clock Clock cycle Sequential circuit Digital logic systems can be classified as combinational or sequential. – Combinational circuits.
Govt. Engineering College- Gandhinagar. It is all about……  STATE MACHINE.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Lecture #17: Clocked Synchronous State-Machine Analysis
Sequential Logic Design
FSM Design & Implementation
Finite State Machines (part 1)
4.
Introduction to Sequential Logic Design
ANALYSIS OF SEQUENTIAL CIRCUITS
FINITE STATE MACHINES (FSMs)
CSE 140L Discussion Finite State Machines.
Electronics II Physics 3620 / 6620
CSE 370 – Winter Sequential Logic-2 - 1
Introduction to Sequential Circuits
CSE 370 – Winter Sequential Logic-2 - 1
Guest Lecture by David Johnston
CSE 370 – Winter Sequential Logic-2 - 1
ECE 352 Digital System Fundamentals
Lecture 20 Logistics Last lecture Today HW6 due Wednesday
ECE 352 Digital System Fundamentals
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
EGR 2131 Unit 12 Synchronous Sequential Circuits
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
Presentation transcript:

Finite State Machines CT101 – Computing Systems

FSM Overview Finite State Machine is a tool to model the desired behavior of a sequential system. The designer has to develop a finite state model of the system behavior and then designs a circuit that implements this model A FSM consists of several states. Inputs into the machine are combined with the current state of the machine to determine the new state or next state of the machine. Depending on the state of the machine, outputs are generated based on either the state or the state and inputs of the machine.

FSM Structure X represents the range of possible input values (2 n ) Y represents the range of output values (2 m ) Q represents the range of the possible states of the system (2 k ) Transfer functions: –f: X x Q -> Y –g: X x Q -> Q

FSM Representation FSM = (X, Y, Q, f, g) –If there is no state in the Q range (Q≡Ø, the circuitry has no history), then: g: X x Ø->Ø, there is no state transition function f: X x Ø -> Y is becoming f: X -> Y –In this case, the FSM is equivalent to an CLC FSM| Q≡Ø = CLC = (X, Y, f)

Asynchronous vs. Synchronous Async FSM – the next state becomes the present state after the delays through the delay elements Sync FSM – obtained by replacing the delay elements d i with memory elements (registers). The w i bits of the next state will be written in the registers (memory elements) only on the clock (on edge or level) is applied.

Sync FSM with immediate outputs The FSM where the outputs, after they have been calculated, are used immediately (of course in the stable period of the state interval), is called an immediate state machine.

Sync FSM with delayed outputs The next state is assigned as present state on the next clock cycle. Similarly, we can proceed with the outputs, obtaining the delayed state machine. Each bit of the output is passed through a memory element.

Timing diagram for synchronous FSM

FSM Example Events: –Wake up at fixed time every day –Weekends: you don’t need alarm, so you wake up, turn off the alarm and resume sleep FSM modeling this chain of events, with: –Three states: Asleep Awake but still in bed Awake and up –Inputs: Alarm Weekday (determines you how to react to alarm) –Outputs: Turn off the alarm

State tables Similar to the truth table Doesn’t contain the system clock when specifying its transitions (it is implicit that transitions occur only when allowed by clock) Unless different stated, all the transitions are occurring on the positive edge of the clock Present State InputsNext State Outputs

Alarm clock state table When you are asleep and alarm goes on, you go from being asleep to being awaked in bed; you also turn off the alarm The next two rows encode your actions: –You get up –You go back to sleep This table doesn’t cover what you wouldn’t do…(i.e. if you are asleep and the alarm doesn't go off, you remain asleep, etc..) Present State AlarmWeekdayNext StateTurn off alarm AsleepOnXAwake in bed Yes Awake in bed OffYesAwake and up No Awake in bed OffNoAsleepNo

Alarm clock state table Covers all the cases –First row covers the situation you are asleep, the alarm doesn’t go off and you remain asleep –Last row covers the situation you are awake and up and you remain awake and up –The third row covers the case you are already up and the alarm goes off. You turn it off and remain Awake in bed Present StateAlarmWeekdayNext StateTurn off alarm AsleepOffXAsleepNo AsleepOnXAwake in bedYes Awake in bedOnXAwake in bedYes Awake in bedOffYesAwake and upNo Awake in bedOffNoAsleepNo Awake and upXX No

State diagram Graphical representation of the state table Each state is represented by a circle vertex Each row of the state table is represented as a directed arc from present state vertex to the next state vertex In this diagram, the outputs are associated with the states

Alternative state diagram The outputs are associated with the arcs –An output of 1 represents that “turn off the alarm” is Yes –By convention, inputs which are don’t care and inactive outputs are not shown.

Mealy and Moore machines Moore machine –Associates its outputs with states –The outputs are represented either within the vertex corresponding to a state or adjacent to the vertex Mealy machine: –Associates its outputs with the transitions –In addition to the input values, each arc also shows the output values generated during the transition; the format of the label of each arc is Inputs/Outputs Both can be used to represent any sequential system and each has its advantages.

Mealy FSM Output is dependent on the inputs and the current state Delayed output FSM implies the fact that the calculated output for an input applied at time t is assigned at time t+1. This is correct at an Mealy FSM

Moore FSM Output is dependent only on the current state Immediate Moore FSM: the output is obtained with a clock period delay, since the then the next state becomes present state Delayed Moore FSM: the output is actually obtained with two clock period delay, because of the Registers Bank 2

Moore machine diagram Self arcs can be missing (since it outputs are associated with the states and not with the arcs) Offers a simpler implementation when the output values depend only on the state and not on the transitions It requires less hardware to produce the output values than does a Mealy machine, since its outputs depend only on its state and its input values It is well suited for representing the control units of microprocessors

Mealy machine diagram Self arcs must be shown (because the output values are shown on the arcs) Can be more compact than Moore machine, especially when two or more arcs with different output values go into the same state

References “Computer Systems Organization & Architecture”, John D. Carpinelli, ISBN: