§12.2 – Finite State Machines with Output. Giving credit where credit is due: Most slides based on lecture notes created byMost slides based on lecture.

Slides:



Advertisements
Similar presentations
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
Advertisements

Modeling Computation Chapter 13.
NFA: Vending Machine Simulation
Integrated Algebra 2 Unit 1: Functions and Relations.
Lecture 20 Finite State Machines CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Finite State Machines Finite state machines with output
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
CSE 311: Foundations of Computing Fall 2013 Lecture 23: Finite state machines and minimization.
YES-NO machines Finite State Automata as language recognizers.
Finite Automata with Output
§12.2 – Finite State Machines with Output. Giving credit where credit is due: Most slides based on lecture notes created byMost slides based on lecture.
Chapter Section Section Summary Set of Strings Finite-State Automata Language Recognition by Finite-State Machines Designing Finite-State.
61 Nondeterminism and Nodeterministic Automata. 62 The computational machine models that we learned in the class are deterministic in the sense that the.
Finite Automata Finite-state machine with no output. FA consists of States, Transitions between states FA is a 5-tuple Example! A string x is recognized.
Finite State Machines Control Circuits Example: Vending Machine Takes only quarters and dollar bills Won't hold more than $1.00 Sodas cost $.75 Possible.
Finite State Machines – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Graphs and Finite State Machines Reading: Kolman, Sections.
Rosen 5th ed., ch. 11 Ref: Wikipedia
Finite-State Machines with No Output Longin Jan Latecki Temple University Based on Slides by Elsa L Gunter, NJIT, and by Costas Busch Costas Busch.
Finite-State Machines with Output
CMPS 3223 Theory of Computation
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
REGULAR LANGUAGES.
ECE2030 Introduction to Computer Engineering Lecture 16: Finite State Machines Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering.
An ordered n-tuple is a set of n objects with an order associated with them. If n objects are represented by x 1, x 2,..., x n, then we write the ordered.
CSE 311 Foundations of Computing I Lecture 21 Finite State Machines Autumn 2011 CSE 3111.
CSE 311 Foundations of Computing I Lecture 21 Finite State Machines Spring
Computabilty Computability Finite State Machine. Regular Languages. Homework: Finish Craps. Next Week: On your own: videos +
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
Copyright © Curt Hill Finite State Machines The Simplest and Least Capable Automaton.
Lesson 5-2 Domain and Range.
Petri Nets Lecturer: Roohollah Abdipour. Agenda Introduction Petri Net Modelling with Petri Net Analysis of Petri net 2.
CS1Q Computer Systems Lecture 11 Simon Gay. Lecture 11CS1Q Computer Systems - Simon Gay 2 The D FlipFlop The RS flipflop stores one bit of information.
Complexity and Computability Theory I Lecture #11 Instructor: Rina Zviel-Girshin Lea Epstein.
CSE 311 Foundations of Computing I Lecture 24 Finite State Machines Autumn 2012 CSE 3111.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
§12.2 – Finite State Machines with Output
Modeling Computation: Finite State Machines without Output
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 10 Automata, Grammars and Languages.
Lecture Notes 
1.2 Three Basic Concepts Languages start variables Grammars Let us see a grammar for English. Typically, we are told “a sentence can Consist.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics.
Lecture 14: Theory of Automata:2014 Finite Automata with Output.
Lecture # 16. Applications of Incrementing and Complementing machines 1’s complementing and incrementing machines which are basically Mealy machines are.
Finite-State Machines (FSM) Chuck Cusack Based partly on Chapter 11 of “Discrete Mathematics and its Applications,” 5 th edition, by Kenneth Rosen.
WELCOME TO A JOURNEY TO CS419 Dr. Hussien Sharaf Dr. Mohammad Nassef Department of Computer Science, Faculty of Computers and Information, Cairo University.
BCT 2083 DISCRETE STRUCTURE AND APPLICATIONS
1.3 Finite State Machines.
Finite State Machines Dr K R Bond 2009
Discrete Mathematics and its Applications
CSE 311 Foundations of Computing I
Discrete Mathematics and its Applications
Some slides by Elsa L Gunter, NJIT, and by Costas Busch
CSE 311 Foundations of Computing I
Discrete Mathematics and its Applications
§11.2 – Finite State Machines with Output
Electronics II Physics 3620 / 6620
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
CSE322 Mealy and Moore Machine
Discrete Mathematics and its Applications
CSC312 Automata Theory Transition Graphs Lecture # 9
Discrete Mathematics and its Applications
Finite-State Machines with No Output
Finite Automata with Output
§11.2 – Finite State Machines with Output
Mealy and Moore Machines
Discrete Mathematics and its Applications
Presentation transcript:

§12.2 – Finite State Machines with Output

Giving credit where credit is due: Most slides based on lecture notes created byMost slides based on lecture notes created by –Michael P. Frank, University of Florida –Longin Jan Latecki, Temple University –Carla Gomes, Cornell University

Remember the general picture of a computer as being a transition function T:S×I→S×O?Remember the general picture of a computer as being a transition function T:S×I→S×O? –If the state set S is finite (not infinite), we call this system a finite state machine. If the domain S×I is reasonably small, then we can specify T explicitly by writing out its complete graph.If the domain S×I is reasonably small, then we can specify T explicitly by writing out its complete graph. –However, this is practical only for machines that have a very small information capacity. Modeling Computation

Applications Finite-State Machines are used in a variety of applications.Finite-State Machines are used in a variety of applications. –Spell checking programs –Grammar checking –Indexing and searching large text files –Speech/Language recognition –Network Protocols

Types of Finite-State Machines Finite-State Machines with OutputFinite-State Machines with Output –Mealy: Output determined by state and input –Moore: Output determined by state alone Finite-State Machines with No OutputFinite-State Machines with No Output –Also known as finite-state automata –There are two types of finite-state automata Deterministic: Each state-input pair dictates a unique transition into another stateDeterministic: Each state-input pair dictates a unique transition into another state Non-deterministic: Each state-input pair can lead to several possible statesNon-deterministic: Each state-input pair can lead to several possible states

Vending Machine Example Suppose a certain vending machine accepts nickels, dimes, and quarters.Suppose a certain vending machine accepts nickels, dimes, and quarters. –If >30¢ is deposited, change is immediately returned. If the “ coke ” button is pressed, the machine drops a coke.If the “ coke ” button is pressed, the machine drops a coke. –It can then accept a new payment. Ignore any other buttons, bills, out of change, etc.

Modeling the Machine Input symbol set: I = {nickel, dime, quarter, button}Input symbol set: I = {nickel, dime, quarter, button} –We could add “ nothing ” or  as an additional input symbol if we want. Representing “ no input at a given time. ”Representing “ no input at a given time. ” Output symbol set: O = { , 5¢, 10¢, 15¢, 20¢, 25¢, coke}.Output symbol set: O = { , 5¢, 10¢, 15¢, 20¢, 25¢, coke}. State set: S = {0, 5, 10, 15, 20, 25, 30}.State set: S = {0, 5, 10, 15, 20, 25, 30}. –Representing how much money has been taken.

Transition Function Table Old state Input New state Output 0n5 0d10 0q25 0b0 5n10 5d15 5q30 5b5 Old state Input New state Output10n15 10d20 10q30 5¢5¢5¢5¢ 10b10 15n20 15d25 15q30 10¢ 15b15

Transition Function Table cont. Old state Input New state Output 20n25 20d30 20q30 15¢ 20b20 25n30 25d305¢ 25q3020¢ 25b25 Old state Input New state Output30n30 5¢5¢5¢5¢ 30d30 10¢ 30q30 25¢ 30b0coke

Another Format: State Table Old state Input Symbol ndqb 0 5,  10,  25,  0,  5 10,  15,  30,  5,  10 15,  20,  30,5¢ 10,  15 20,  25,  30,10¢ 15,  20 25,  30,  30,15¢ 20,  25 30,  30,5¢ 30,20¢ 25,  30 30,5¢ 30,10¢ 30,25¢ 0,coke Each pair shows new state, output symbol

Directed-Graph State Diagram As you can see, these can get kind of busy.As you can see, these can get kind of busy q,5¢ nnn d q d q bbbbbb n nn q,25¢ d,10¢ n,5¢ d d,5¢ q,20¢ q,15¢ q,10¢ b,coke

Formalizing FSMs Just like the general transition-function definition from earlier, but with the output function separated from the transition function, and with the various sets added in, along with an initial state.Just like the general transition-function definition from earlier, but with the output function separated from the transition function, and with the various sets added in, along with an initial state. A finite-state machine M=(S, I, O, f, g, s 0 )A finite-state machine M=(S, I, O, f, g, s 0 ) –S is the state set. –I is the alphabet (vocabulary) of input symbols –O is the alphabet (vocabulary) of output symbols –f is the state transition function –g is the output function –s 0 is the initial state. Our transition function from before is T = (f,g).Our transition function from before is T = (f,g).

Examples