This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: DISCRETE MATHEMATICS W W L CHEN c W W L Chen, 1991, 2008. This chapter is available free to all individuals, on the understanding that it is not to be used for financial gain, and may be downloaded and/or photocopied, with or without permission from the author. However, this document may not be kept on any information storage and retrieval system without permission from the author, unless such system is not accessible to any individuals other than its owners. Chapter 6 FINITE STATE MACHINES 6.1. Introduction Example 6.1.1. Imagine that we have a very simple machine which will perform addition and multi plication of numbers from the set { 1 , 2 } and give us the answer, and suppose that we ask the machine to calculate 1 + 2. The table below gives an indication of the order of events: TIME t 1 t 2 t 3 t 4 STATE (1) s 1 (4) s 2 [1] (7) s 3 [1 , 2] (10) s 1 INPUT (2) 1 (5) 2 (8) + OUTPUT (3) nothing (6) nothing (9) 3 Here t 1 < t 2 < t 3 < t 4 denotes time. We explain the table a little further: (1) The machine is in a state s 1 of readiness. (2) We input the number 1. (3) There is as yet no output. (4) The machine is in a state s 2 (it has stored the number 1). (5) We input the number 2. (6) There is as yet no output. (7) The machine is in a state s 3 (it has stored the numbers 1 and 2). (8) We input the operation +. (9) The machine gives the answer 3. (10) The machine returns to the state s 1 of readiness. Note that this machine has only a finite number of possible states. It is either in the state s 1 of readiness, or in a state where it has some, but not all, of the necessary information for it to perform its task. On the other hand, there are only a finite number of possible inputs, namely the numbers 1, 2 and the operations + and × . Also, there are only a finite number of outputs, namely nothing, “junk” (when Chapter 6 : Finite State Machines page 1 of 21 Discrete Mathematics c W W L Chen, 1991, 2008 incorrect input is made) or the right answers. If we investigate this simple machine a little further, then we will note that there are two little tasks that it performs every time we input some information: Depending on the state of the machine and the input, the machine gives an output. Depending on the state of the machine and the input, the machine moves to the next state. Definition. A finite state machine is a 6tuple M = ( S , I , O ,ω,ν,s 1 ), where (a) S is the finite set of states for M ; (b) I is the finite input alphabet for M ; (c) O is the finite output alphabet for M ; (d) ω : S × I → O is the output function; (e) ν : S × I → S is the nextstate function; and (f) s 1 ∈ S is the starting state. Example 6.1.2. Consider again our simple finite state machine described earlier. Suppose that when the machine recognizes incorrect input ( e.g. three numbers or two operations), it gives the output “junk” and then returns to the initial state s 1 . It is clear that I = { 1 , 2 , + , ×} and O = { j,n, 1 , 2 , 3 , 4 } , where...
View
Full
Document
This note was uploaded on 12/20/2009 for the course MATH 245 taught by Professor ramaswamy during the Spring '08 term at San Diego State.
 Spring '08
 RAMASWAMY
 Math

Click to edit the document details