§12.2 – Finite State Machines with Output

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

Example: Binary Adder We want to construct a finite state machine that will add two numbers. The input is two binary numbers, (xn…x1x0)2 and (yn…y1y0)2.
Modeling Computation Chapter 13.
NFA: Vending Machine Simulation
Lecture 20 Finite State Machines CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Summer 2011 Wednesday, 07/13. Formal Systems: The ELI System The ELI-system uses only three letters of the alphabet: E, L, I. It has a single axiom, EI,
§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.
Finite state machines.
Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Fall 2008.
Give qualifications of instructors: DAP
Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design Finite State.
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.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
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
Functions Definition & purpose Notation Functions on binary / returning binary values Finite automaton model We haven’t completely left the world of counting.
Finite-State Machines with Output
Finite State Machines Chapter 5. Languages and Machines.
CMPS 3223 Theory of Computation
Deterministic Finite State Machines Chapter 5. Languages and Machines 2.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
REGULAR LANGUAGES.
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.
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
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 +
Computability Review homework. Regular Operations. Nondeterministic machines. NFSM = FSM Homework: By hand, build FSM version of specific NFSM. Try to.
A Universal Turing Machine
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.
DLD Lecture 26 Finite State Machine Design Procedure.
Finite State Machines This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this.
1 Finite State Machines (FSMs) Now that we understand sequential circuits, we can use them to build: Synchronous (Clocked) Finite State Machines Finite.
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.
1 ENGG 1203 Tutorial Combinational Logic (II) and Sequential Logic (I) 8 Feb Learning Objectives  Apply Karnaugh map for logic simplification  Design.
Complexity and Computability Theory I Lecture #11 Instructor: Rina Zviel-Girshin Lea Epstein.
Digital System Design using VHDL
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
September1999 CMSC 203 / 0201 Fall 2002 Week #14 – 25/27 November 2002 Prof. Marie desJardins clip art courtesy of
Modeling Computation: Finite State Machines without Output
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
Overview of Previous Lesson(s) Over View  A token is a pair consisting of a token name and an optional attribute value.  A pattern is a description.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
CS 461 – Oct. 28 TM applications –Recognize a language √ –Arithmetic √ –Enumerate a set –Encode a data structure or problem to solve Two kinds of TMs –Decider:
Nondeterministic Finite State Machines Chapter 5.
Finite State Machines Chapter 5. Languages and Machines.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Lecture # 16. Applications of Incrementing and Complementing machines 1’s complementing and incrementing machines which are basically Mealy machines are.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
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.
Lecture2 Regular Language
Discrete Mathematics and its Applications
Finite Automata a b A simplest computational model
Discrete Mathematics and its Applications
Chapter 9 TURING MACHINES.
Finite State Machines.
Discrete Mathematics and its Applications
§11.2 – Finite State Machines with Output
Discrete Mathematics and its Applications
Discrete Mathematics and its Applications
§11.2 – Finite State Machines with Output
Discrete Mathematics and its Applications
Presentation transcript:

§12.2 – Finite State Machines with Output

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. However, this is practical only for machines that have a very small information capacity.

Size of FSMs The information capacity of an FSM is C = I[S] = log |S|. Thus, if we represent a machine having an information capacity of C bits as an FSM, then its state transition graph will have |S| = 2C nodes. E.g. suppose your desktop computer has a 512MB memory, and 60GB hard drive. Its information capacity, including the hard drive and memory (and ignoring the CPU’s internal state), is then roughly ~512×223 + 60×233 = 519,691,042,816 b. How many states would be needed to write out the machine’s entire transition function graph? 2519,691,042,816 = A number having >1.7 trillion decimal digits!

One Problem with FSMs as Models The FSM diagram of a reasonably-sized computer is more than astronomically huge. Yet, we are able to design and build these computers using only a modest amount of industrial resources. Why is this possible? Answer: A real computer has regularities in its transition function that are not captured if we just write out its FSM transition function explicitly. I.e., a transition function can have a small, simple, regular description, even if its domain is enormous.

Other Problems with FSM Model It ignores many important physical realities: How is the transition function’s structure to be encoded in physical hardware? How much hardware complexity is required to do this? How close in physical space is one bit’s worth of the machine’s information capacity to another? How long does it take to communicate information from one part of the machine to another? How much energy gets dissipated to heat when the machine updates its state? How fast can the heat be removed, and how much does this impact the machine’s performance? Let’s consider a basic example.

Vending Machine Example 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. 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} We could add “nothing” or  as an additional input symbol if we want. Representing “no input at a given time.” Output symbol set: O = {, 5¢, 10¢, 15¢, 20¢, 25¢, coke}. 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 n 5  d 10 q 25 b 15 30 Old state Input New state Output 10 n 15  d 20 q 30 5¢ b 25 10¢ 5

Transition Function Table cont. Old state Input New state Output 20 n 25  d 30 q 15¢ b 5¢ 20¢ Old state Input New state Output 30 n 5¢ d 10¢ q 25¢ b coke

Another Format: State Table Each entry shows new state, output symbol Old state Input Symbol n d q b 5, 10, 25, 0, 5 15, 30, 10 20, 30,5¢ 15 30,10¢ 20 30,15¢ 25 30,20¢ 30 30,25¢ 0,coke

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

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. A finite-state machine M=(S, I, O, f, g, s0) 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 s0 is the initial state. Our transition function from before is T = (f,g).

Construct a state table for the finite-state machine in Fig. 3. Find the output string for the input 101011 Answer: 001000