--Your friends at LectureNotes


  • Note
  • Computer Science Engineering
  • 4 Topics
  • 101 Offline Downloads
  • Uploaded 6 months ago
Manjula Poojary
Manjula Poojary
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-3

or A Finite State Machine is a model of computation based on a hypothetical machine made of one or more states. Only one single state of this machine can be active at the same time. It means the machine has to transition from one state to another in to perform different actions. or A Finite State Machine is any device storing the state of something at a given time. The state will change based on inputs, providing the resulting output for the implemented changes. Finite State Machines come from a branch of Computer Science called “automata theory”. The family of data structure belonging to this domain also includes the Turing Machine. The important points here are the following:  We have a fixed set of states that the machine can be in  The machine can only be in one state at a time  A sequence of inputs is sent to the machine  Every state has a set of transitions and every transition is associated with an input and pointing to a state Representation of Finite state automata: Finite state machine can be represented in two ways. 1.state diagram 2.state transition table State diagram: FSM models the behaviour of a system by representing it in different states it can be in and the transition between each state. A state is simply a specific action. Example for action is waiting for button 1 is to be pressed, or rotating the dc motor to any direction etc. State diagram consists of a set of states (represented by circles) and transitions (represented by arrows connecting states). One state is designated as the initial state, via an arrow pointing to a state. And states can be designated as final states, via a doubled circle. State transition tables: A state transition table follows every state and input. Inputs are usually placed on the left, and separated from the outputs, which are on the right. How to design FSM: To design any FSM machine first we have to identify the set of states,state transition on each input and output. Example:Design a FSM for traffic Light  States: Red, Yellow, Green

Text from page-4

 Transitions: After a given time, Red will change to Green, Green to Yellow, and Yellow to Red The light is initially red then after certain time it becomes green or yellow based on some input signal. Considering the input signal t, the transition diagram for traffic signal will be as shown in fig: Here the transition is based on two input parameter 1 and 0. If t = 1 then it jumps to the next state or continue in the same state for t = 0. Transition table for above example is Input input input state 0 1 red red green green green yello w yellow yello red w that is on input 0 state of red does not change on input 1 on Red goes to Green 0 on Green goes to Green o input 1 on Green goes to Yellow 0 on Yellow goes to Yellow 1 on Yellow goes to Red Components or elements of Finite State Automata(FSM): 1.input tape 2.reading head 3.finite control. Fig shows the diagramitical representation Finite state automata:-

Text from page-5

Input tape: The input tape has the left end and extends to the right end. It is divided into squares and each square containing a single symbol from the input alphabet ∑. The end squares of the tape contain the end markers ₵ at the left end and the end marker $ at the right end. The absence of endmarkers indicates that the tape is of infinite length. The left-to-right sequence of symbols between the two endmarkers in the input string to be processed. Read only Head: The tape has a read only head that examines only one square at a time and can move one square either to the left or to the right. At the beginning of the operation the head is always at the leftmost square of the input tape. For further analysis, machine restrict the moment of the read only head from left to right direction only and one square every time when it reads a symbols. Note: The read head never moves to the left direction. When it there is not more symbol in the next right move of the input tape, at this state the machine stops proceeding and automaton terminates its operation. Finite control: There is a finite control which determines the state of the automaton and also controls the movement of the head. The input to the finite control will usually be the symbol under the read head (assumed a) and the present state of the machine (assumed q) to give the following outputs; 1. A motion of Read head along the tape to the next square. 2. The next state of the finite state machine given by δ(q, a). Mathematical representation of FSM(finite automata) A finite-state machine is formally defined as a 5-tuple (Q, I, Z, ∂, W) such that:  Q = finite set of states

Text from page-6

 I = finite set of input symbols  Z = finite set of output symbols  ∂ = mapping of I x Q into Q called the state transition function, i.e. I x Q → Q  W = mapping W of I x Q onto Z, called the output function  A = set of accept states where F is a subset of Q From the mathematical interpretation above, it can be said that a finite-state machine contains a finite number of states. Each state accepts a finite number of inputs, and each state has rules that describe the action of the machine forever input, represented in the state transition mapping function. At the same time, an input may cause the machine to change states. For every input symbol, there is exactly one transition out of each state. In addition, any 5-tuple set that is accepted by nondeterministic finite automata is also accepted by deterministic finite automata. Finite state machine classification: An FSM is defined by a list of its states, its initial state, and the conditions for each transition. Finite state machines are of two types – 1.deterministic finite state machines: Deterministic refers to the uniqueness of the computation.Deterministic Finite Automaton (DFA) In DFA, for each input symbol, one can determine the state to which the machine will move. Hence, it is called Deterministic Automaton. As it has a finite number of states, the machine is called Deterministic Finite Machine or Deterministic Finite Automaton. 2. non-deterministic finite state machines. In NDFA, for a particular input symbol, the machine can move to any combination of the states in the machine. ... Hence, it is called Non-deterministic Automaton. As it has finite number of states, the machine is called Non-deterministic Finite Machine or Non-deterministic Finite Automaton. What are the application of finite automata? Finite Automata are a useful model for many important kinds of hardware and software. 1. Software for designing and checking the behavior of digital circuits 2. The “Lexical analyzer” of a typical compiler , that is , the compiler component that breaks the input text into logical units, such as identifiers, keywords, and punctuation. 3. Software for scanning large bodies of text, such as collections of Web pages, to find occurrences of words, phrases, or other patterns. 4. Software for verifying systems of all types that have a finite number of distinct states, such as communications protocols or protocols for secure exchange of information. 5. FSM can model a huge no. of problems like automata, gesture recognition, networking design and artificial intelligence. Basics of Theory of computation:

Lecture Notes