Denise Landau 2013 3.1.1 Fundamentals of Problem Solving Finite State Machines Denise Landau 2013 AQA Computing COMP1.

Slides:



Advertisements
Similar presentations
Modeling Computation Chapter 13.
Advertisements

Sequential Logic Circuits. Set-Reset Latch The Set-Reset latch or bistable is a simple sequential logic circuit that remembers what has happened to the.
Finite State Machines (FSMs)
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
Circuits require memory to store intermediate data
Lecture 22: Sequential Circuits Today’s topic –Clocks and sequential circuits –Finite state machines 1.
Chapter 3 Digital Logic Structures
Flow and Error Control. Flow Control Flow control coordinates the amount of data that can be sent before receiving acknowledgement It is one of the most.
Finite state machines.
ECE 331 – Digital System Design
Give qualifications of instructors: DAP
1 COMP541 State Machines Montek Singh Feb 6, 2007.
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
Finite State Machine(FSM)
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
Rosen 5th ed., ch. 11 Ref: Wikipedia
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Unit 14 Derivation of State Graphs
CMPS 3223 Theory of Computation
Sequential Logic Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer Organization and.
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
CSC 311 Chapter Eight FLOW CONTROL TECHNIQUES. CSC 311 Chapter Eight How do we manage the large amount of data on the network? How do we react to a damaged.
1 Lecture 22 Sequential Circuits Analysis. 2 Combinational vs. Sequential  Combinational Logic Circuit  Output is a function only of the present inputs.
Introduction to State Machine
© BYU 16 FSM Page 1 ECEn 224 Finite State Machines.
Lecture 5. Sequential Logic 2 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
FINITE STATE MACHINES (FSMs)
DLD Lecture 26 Finite State Machine Design Procedure.
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.
State Table Problem #1 An electronic lock is controlled by a keypad, which has three buttons labeled A, B, and R. The keypad is restricted such that, at.
1 ENGG 1203 Tutorial Combinational Logic (II) and Sequential Logic (I) 8 Feb Learning Objectives  Apply Karnaugh map for logic simplification  Design.
Lecture 8 Theory of AUTOMATA
Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP
SM2220 – Class 06 Finite Automata. SM2220 – Class 06 Topic in theoretical computing. A subset of computation machines. Closely related to formal language.
1 ENGG 1015 Tutorial Three Examples of Finite State Machines Supplementary notes Learning Objectives  Learn about Design of Finite State Machines Ack.:
Digital System Design using VHDL

1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patterson and Hennessy Text.
4–1. BSCS 5 th Semester Introduction Logic diagram: a graphical representation of a circuit –Each type of gate is represented by a specific graphical.
COMBINATIONAL AND SEQUENTIAL CIRCUITS Guided By: Prof. P. B. Swadas Prepared By: BIRLA VISHVAKARMA MAHAVDYALAYA.
1 Binary Signals Logic gate circuits are designed to input and output only two types of signals: “high” (1) and “low” (0), as represented by a variable.
Mealy Machines Finite State Machines with Outputs given on the transitions.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Finite Automata (FA) with Output FA discussed so far, is just associated with R.Es or language. Is there exist an FA which generates an output string corresponding.
Combinational circuits
AS Computer Studies Finite State Machines 1.
1.3 Finite State Machines.
Finite State Machines Dr K R Bond 2009
COMP541 Sequential Logic – 2: Finite State Machines
What Are They? Who Needs ‘em? An Example: Scoring in Tennis
Protocol Basics.
3.4 Computer systems Boolean logic Lesson 2.
Electronics II Physics 3620 / 6620
What Are They? Who Needs ‘em? An Example: Scoring in Tennis
CSCI1600: Embedded and Real Time Software
CSE 370 – Winter Sequential Logic-2 - 1
Chapter 3: Selection Structures: Making Decisions
ECE 352 Digital System Fundamentals
Chapter 3: Selection Structures: Making Decisions
Finite Automata with Output
ECE 352 Digital System Fundamentals
Finite Automaton with output
Logically, the output will be 1
ECE 352 Digital System Fundamentals
Finite State Machine Continued
Presentation transcript:

Denise Landau Fundamentals of Problem Solving Finite State Machines Denise Landau 2013 AQA Computing COMP1

Denise Landau 2013 What is a Finite State Machine? A state machine is any device that stores the status of something at a given time, and can operate on input to change the status and/or cause to take place for any given change. It consists of: states, input, and outputs Suitable for controlling processes that react to local conditions only. The machine is in only one state at a time – the current state. It can change from one state to another when initiated by a triggering event or condition – the transition. Have limited memory – which is limited by the number of states.

Denise Landau 2013 Mealy Machine Mealy machine is a finite-state machine whose output values are determined both by its current state and the current inputs The Mealy machine is named after George H. Mealy, who presented the concept in a 1955 paper, “A Method for Synthesizing Sequential Circuits”. This is in contrast to a Moore machine, which is an FSM whose output values are determined solely by its current state.

Denise Landau 2013 Mealy Machine A simple Mealy machine has one input and one output. More complex Mealy machines can have multiple inputs as well as multiple outputs. Mealy machines provide a rudimentary mathematical model for cipher machines - a Mealy machine can be designed that given a string of letters (a sequence of inputs) can process it into a ciphered string (a sequence of outputs

Denise Landau 2013 Examples of FSM Vending machines (dispense products when the proper combination of coins is deposited) Lifts (stop at the upper floors before going down) Traffic lights (change sequence when cars are waiting) Combination locks (numbers must be input in the right order) Protocols and communication systems (WLAN, Bluetooth, 3G, 4G) Satellites critical systems – modelled, implemented or tested using FSM KEYWORD: Automation

Denise Landau 2013 Finite State Machines with Outputs When an FSM produces a response when making a transition, this is an output.

Denise Landau 2013 Finite State Machines without Outputs An FSM without outputs is called a Finite State Automaton (FSA)

Denise Landau 2013 Extension – Stretch and Challenge TCP has been modelled using an Extended FSM 1- Always remembers the current state in the variable (CurrState) and the previous state in the variable (PrevState) 2- The TCP endpoint has unlimited buffer space (e.g., buffer space to queue SENDs and RECEIVEs is always available) 3- In any state, whenever a segment is sent, the segment is added to the Retransmission Queue (Rexmt Queue) and the retransmission timer (REXMT) is started. 4- The (REXMT TIMEOUT) event has been modeled in all states except (FIN-WAIT-2, TIME-WAIT, CLOSED), since in these states the endpoint have already received an ACK of its FIN segment (i.e., will not transmit any segments afterwards). 5- The (TIMEWAIT TIMEOUT) event has been modeled in (TIME-WAIT) state only. In all other states, this timer is irrelevant. Follow this link for more information:

Denise Landau 2013 State Transition Diagrams You must be able to draw and interpret simple state transition diagrams A finite state machine expressed visually is a State transition diagram Shows all the states, inputs and outputs. Not all FSMs will have an accept states and it is possible they could run for ever 1. Each state is represented with a circle 2. Each transition is shown with an arrow. Transitions are labelled with an input that causes a transition and possibly an output that results from it. 3. Double circle signifies the accept state.

Denise Landau 2013 State Transition Diagrams In this diagram we can see that it starts in state S1 An input of 1 will keep it in state one An input of 0 will move it to state S2 Once in S2 an input of 1 will keep it there, and an input of 0 will switch it back to S1. This means that the following inputs are valid: A finite state automaton (no outputs) accepting binary input

Denise Landau 2013 State Transition Diagrams It might appear to accept any binary value, but this isn't true. The only state it can accept in is state S1. This places the following rule on all accepted inputs: "A combination of binary digits involving an even number of zeros". This is useful for parity checks.

Denise Landau 2013 State Transition Diagrams Try: You will be stuck in state S2 and the FSM has not accepted The rules: An input of 1 will keep it in state one An input of 0 will move it to state S2 Once in S2 an input of 1 will keep it there, and an input of 0 will switch it back to S1.

Denise Landau 2013 State Transition Diagrams- Exercise Which of these inputs are valid: 1.aaacdb 2.ababacdaaac 3.abcdb 4.acda 5.acdbdb

Denise Landau 2013 Exercise Answer Answer : 1.aaacdb (CORRECT) 2.ababacdaaac(CORRECT) 3.abcdb (ERROR no input that accepts b then c) 4.acda (ERROR S1 is not a accepting state) 5.ac (CORRECT)

Denise Landau 2013 State Transition Tables You must be able to draw and interpret simple state transition tables A state transition table is a table showing what state (or states ) finite state machine will move to, based on the current state and other inputs. It is essentially a truth table in which some of the inputs are the current state, and the outputs include the next state, along with other outputs.

Denise Landau 2013 Exercise Create a state transition table for the following FSM:

Denise Landau 2013 Exercise Answer

Denise Landau 2013 Example: Turnstile State diagram for a turnstile A turnstile, used to control access to subways and amusement park rides, is a gate with three rotating arms at waist height, one across the entryway. Initially the arms are locked, barring the entry, preventing customers from passing through. Depositing a coin or token in a slot on the turnstile unlocks the arms, allowing a single customer to push through.token After the customer passes through, the arms are locked again until another coin is inserted. Considered as a state machine, the turnstile has two states: Locked and Unlocked. [2] [2]

Denise Landau 2013 Example: Turnstile There are two inputs that affect its state: putting a coin in the slot (coin) and pushing the arm (push). In the locked state, pushing on the arm has no effect; no matter how many times the input push is given, it stays in the locked state. Putting a coin in – that is, giving the machine a coin input – shifts the state from Locked to Unlocked. In the unlocked state, putting additional coins in has no effect; that is, giving additional coin inputs does not change the state. However, a customer pushing through the arms, giving a push input, shifts the state back to Locked.

Denise Landau 2013 Example: Turnstile The turnstile state machine can be represented by a state transition table, showing for each state the new state and the output (action) resulting from each input

Denise Landau 2013 References _general_education.pdf level_Computing/AQA/Problem_Solving,_Programming,_Data_Represe ntation_and_Practical_Exercise/Problem_Solving/Finite_state_machine s