AS Computer Studies Finite State Machines 1.

Slides:



Advertisements
Similar presentations
Denise Landau Fundamentals of Problem Solving Finite State Machines Denise Landau 2013 AQA Computing COMP1.
Advertisements

Programmable Logic Controller PLC
Finite state machines.
LAB 3 – Review of the Assignment. -- Clarifications Vikram Murali. TA : CSE 140L Prof. CK Cheng.
Basic Register Typically, we store multi-bit items
1 Lecture 14: FSM and Basic CPU Design Today’s topics:  Finite state machines  Single-cycle CPU Reminder: midterm on Tue 10/24  will cover Chapters.
FSM How Finite State Machine is used to design a circuit.
Finite State Machine(FSM)
ELEC 1041 Digital Electronics Tutorial: Word Problems
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Practice Problems to become familiar with circuits and circuit diagrams.
Control Technology and Automation
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.
Problem Class 3 - Slide 1 PYKC 17 Nov 2015 E2.1 Digital Electronics Problem Class 3 State Machines (Problem Sheet 3) Peter Cheung Department of Electrical.
1 ENGG 1015 Tutorial Three Examples of Finite State Machines Supplementary notes Learning Objectives  Learn about Design of Finite State Machines Ack.:
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patterson and Hennessy Text.
Control Technology START What is control technology? What is this diagram called? In which program have you used these before? Lets Go!
Mealy Machines Finite State Machines with Outputs given on the transitions.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Theory of Computation Automata Theory Dr. Ayman Srour.
Finite State Machines ENGR 110 #7 2016
With. Project Overview  Introduction to Factory Automation Numerical Control  Build an autonomous robotic solution  Testing an autonomous robot build.
1 Lecture 13: Sequential Circuits, FSM Today’s topics:  Sequential circuits  Finite state machines  Single-cycle CPU Reminder: midterm on Tue 10/20.
Finite State Machines Mealy machine inputs Outputs next state function
Logic Gates Unit 16.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
VEX IQ Curriculum Smart Machines Lesson 09 Lesson Materials:
Basics of Logic gates - Part 1
Combinational circuits
Sensors Control Systems with Flowol.
Lecture 4. Sequential Logic #2
1.3 Finite State Machines.
Finite State Machines Dr K R Bond 2009
Building with Numbers Module 4: Investigation 3
Topic 6: Totally in control
COMP541 Sequential Logic – 2: Finite State Machines
ECEN 248 Lab 9: Design of a Traffic Light Controller
AS Computer Studies Finite State Machines 2.
Finite Automata a b A simplest computational model
Digital electronics and logic gates
FSM Controllers ENGR 110 #
ELEC 1041 Digital Electronics Tutorial: Word Problems
Sequential Logic and Flip Flops
The Electrical Diagram
Drama At Cornwallis Academy
Evaluation in Engineering Design Process Modeling and FSM
Sequential Logic and Flip Flops
Lecture 13: Sequential Circuits, FSM
Raspberry Pi: External Inputs & Outputs
Traffic light programming challenges
Lecture 13: Sequential Circuits, FSM
All very logical I think!
THEORY OF COMPUTATION Lecture One: Automata Theory Automata Theory.
Hakim Weatherspoon CS 3410 Computer Science Cornell University
Representing Motion Chapter 2.
Raspberry Pi with Pibrella
Explain what touch develop is to your students:
An Introduction to VEX IQ Programming with Modkit
Computers in the real world Objectives
Instructor: Alexander Stoytchev
Recap lecture 19 NFA corresponding to Closure of FA, Examples, Memory required to recognize a language, Example, Distinguishing one string from another,
EGR 2131 Unit 12 Synchronous Sequential Circuits
Logic Gates AIM: To know the different types of logic gate
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Further binary, Logic diagrams and truth tables
ECE 352 Digital System Fundamentals
Finite State Machine Continued
State Machine Design State Machine Design Digital Electronics
Presentation transcript:

AS Computer Studies Finite State Machines 1

Starter Imagine yourself stood at a crossing, at a junction with two directions of traffic. What are the different STATES of the lights (the order, which lights can be on etc). What would cause the lights to change?

Objectives Understand the stages of problem solving. Become familiar with finite state machines and their purpose. Be able to create and construct a finite state machine.

Starter Review The lights you have are: RED AMBER GREEN RED MAN GREEN MAN The process is: RED  RED AMBER  GREEN  AMBER  RED Causes of the lights to change would be: Traffic coming from a different direction. A pedestrian activating the crossing Causing the RED MAN to go off and the GREEN MAN to come on.

Finite State Machines (FSM) I Traffic crossings can be in ONE state at any ONE time. Finite means countable. Traffic crossings have a set number of possible states they can be in. Traffic crossings have five different states: RED  RED AMBER  GREEN  AMBER  RED They have a number of inputs (traffic sensors, crossing button). They have a number of outputs (the different lights)

Finite State Machines (FSM) II For traffic lights to move between states, it needs to ALWAYS know it’s current state. The traffic lights couldn’t move from Red to Green if it was already on green for example. When the pedestrian crossing button is pressed: The lights change from green to amber The logic device records the new state. The lights change from amber to red. The red man turns off The green man turns on

How does this look A diagram of how Traffic Lights Work (at surface level) Logical Device (Traffic Lights) programmed with state transition diagram Memory Inputs (traffic sensor or Pedestrian button) Outputs Actual traffic lights Or Red/Green man Change memory to next state (e.g. Red  Red Amber)

What is a finite state machine (FSM)? A machine that has a fixed set of possible states. It has a set of inputs that can change the state. It has a set of outputs which can reflect the state change. This can range from 2 states to millions!

Quick Task Write down all the different states for a car (keep it simple) Think about what inputs and outputs you would need. Answer: Engine on, Moving Engine on, Slowing Down Engine on, Stationary Engine off, Stationary Inputs: Key to start ignition, Accelerator, brakes Outputs: Motion, Indicator signals

State Transition Diagrams These are a way of explaining a FSM in a graphical way. Each state is represented by a circle. A transition (movement) between each state is shown by an arrow. Labelled with the inputs that causes the transition. Labelled with any outputs which happened because of the transition.

An Example: Showing an FSM in a State Transition Diagram Let’s take the example of a pen as an Finite State Machine It has two finite states. The pen is extended out (i.e. the pen is ON – STATE 1) The pen is retracted (i.e. the pen is OFF – STATE 0) It has allowable inputs: clicking the pen’s button. It has possible outputs: the pen nib extended or retracted. State 0 State 1 Button clicked

Quick Task A light switch is a simple example of a finite state machine. Draw a FSM illustrate this. TIPS: STEP 1: Identify the states STEP 2: Identify the inputs STEP 3: Identify the outputs STEP 4: Identify the transitions

Quick Task Review A light switch is a simple example of a finite state machine. STEP 1: Identify the states: Switch On, Switch Off STEP 2: Identify the inputs: Switching on the switch STEP 3: Identify the outputs: The light is on or off STEP 4: Identify the transitions: S0 (switched off) to S1 (switched on) and vice versa. NOTICE: There is no FINAL or ACCEPTING (finishing) state. State 0 State 1 Light-switch Down Light-switch Up

State Transition: Further Knowledge The combination on my brief case is 249. It will only open when given this sequence. There are no outputs here. The initial start is shown by the arrow. Constantly loops around state S0 (locked) unless 2 is selected. Once 2 is selected, state s1 is reached. This continues to the final state. Double circle = Accepting state – shown in S3

FSM: Mealy Machines So far we have just seen State Transitions which do something. We haven’t seen them output any actual information. To do this, we use a particular type of FSM A Mealy Machine – FSM’s with outputs, have an initial state and no accepting states. Initial states have a labelled arrow called “Start”

Activity: Creating a Mealy Machine We want to develop a machine which converts a set of values into characters. 0 = A 1 = B 2 = ! The system begins at state S0. If the received digit is 0 and the system is in state S0, output the letter A If the received digits is 1 and the system is in state S0 change to state S1 and output letter B. If the received digit is 2 and the system is in state S0 change to S2 and output the letter !. If the received digit is 0 and the system is in state S1, change state to S0 and output the letter A. If the received digit is 1 and the system is in state S1, output the letter B. If the received digit is 2 and the system is in state S1, change state to S2 and output character ! DRAW A STATE TRANSITION DIAGRAM TO SHOW THIS USING THE SHEET PROVIDED.

Conversion Machine: A Solution What would the following sequences produce (you may need to write it down!) 00101102 would produce: AABABBA! 101012 = BABAB! 10010112 = BAABABB! 1110102 = BBBABA! State 0 Start 0, A State1 1, B State2 2, !

Objectives Review Understand the stages of problem solving. Become familiar with finite state machines and their purpose. Be able to create and construct a finite state machine.

Plenary Teach back. Each person will be asked to stand up and suggest one thing they have learnt today. Reflection: What do we need to know more of to deepen our understanding.