§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

CS 3240: Languages and Computation
Modeling Computation Chapter 13.
NFA: Vending Machine Simulation
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.
Lecture # 14 Theory Of Automata By Dr. MM Alam 1.
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.
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
Moore machine and Mealy machine (P.274)
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.
Relations & Functions An Introduction for Algebra Students.
Copyright © Curt Hill Finite State Machines The Simplest and Least Capable Automaton.
§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.
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.
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.
Introduction to Automata Theory Theory of Computation Lecture 5 Tasneem Ghnaimat.
Lecture # 16. Applications of Incrementing and Complementing machines 1’s complementing and incrementing machines which are basically Mealy machines are.
Theory of Computation Automata Theory Dr. Ayman Srour.
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
By John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman
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

Introduction Finite-State MachinesFinite-State Machines –mathematical models of computation used to design computer programs

Applications Finite-State MachinesFinite-State Machines –used in a variety of applications such as spell checking programs;spell checking programs; grammar checking;grammar checking; indexing and searching large text files;indexing and searching large text files; speech/language recognition;speech/language recognition; network protocolsnetwork protocols

A computation can be modeled as a transition function T: S×I→S×O?A computation can be modeled as 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. Modeling Computation

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. When there is 30¢ deposited,When there is 30¢ deposited, 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} 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