Week 2/3 1.System interconnections (block diagrams) 2.Finite State Machines (Chapter 3)

Slides:



Advertisements
Similar presentations
Learning Objectives for Section 7.2 Sets
Advertisements

CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
1 EE365 Sequential-circuit analysis. 2 Clocked synchronous seq. circuits A.k.a. “state machines” Use edge-triggered flip-flops All flip-flops are triggered.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
EECS 20 Chapter 3 Sections Defining Signals and Systems Last time we Found ways to define functions and systems Defined many example systems Today.
Week 1 Chapter 1 + Appendix A Signals carry information Signals are represented by functions Systems transform signals Systems are represented by functions,
Lexical Analysis III Recognizing Tokens Lecture 4 CS 4318/5331 Apan Qasem Texas State University Spring 2015.
Week Real time state machines 2.LTI systems– the [A,B,C,D] representation 3.Differential equation-approximation by discrete- time system 4.Response–
EECS 20 Chapter 5 Part 11 Linear Infinite State Systems Last time we Looked at state machines with feedback Considered state machines with constant or.
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
EECS 20 Lecture 8 (February 2, 2001) Tom Henzinger State Machines.
EECS 20 Chapter 21 Defining Signals and Systems Last time we Introduced mathematical notation to help define sets Learned the names of commonly used sets.
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
EECS 20 Lecture 9 (February 5, 2001) Tom Henzinger Transition Diagrams.
11/10/2004EE 42 fall 2004 lecture 301 Lecture #30 Finite State Machines Last lecture: –CMOS fabrication –Clocked and latched circuits This lecture: –Finite.
1 Intro to Finite Automata Chapter 2 introduces the concept of a Finite Automata (or FA). An FA has several properties: It is theoretical. It allows computer.
Week 1 1.websitewebsite 2.takehome examtakehome 3.Chapter Appendix A.
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
CSE115/ENGR160 Discrete Mathematics 02/14/12 Ming-Hsuan Yang UC Merced 1.
Costas Busch - RPI1 Turing Machines. Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Week 4 1.More examples 2.Nondeterminism, equivalence, simulation (Ch 3) 3.Composition (Ch 4)
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Week 2 (Chapter 2) 1.Signals are Functions 2.Systems.
EECS 20 Chapter 4 Sections Connecting State Machines Last time we Introduced the nondeterministic state machine Highlighted differences between.
EECS 20 Chapter 3 Sections State Machines Continued Last time we Introduced the deterministic finite state machine Discussed the concept of state.
EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.
1 Learning Objectives for Section 7.2 Sets After today’s lesson, you should be able to Identify and use set properties and set notation. Perform set operations.
Sets.
Set Notation.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
This section will discuss the symbolism and concepts of set theory
Finite-State Machines with No Output
Compiler Phases: Source program Lexical analyzer Syntax analyzer Semantic analyzer Machine-independent code improvement Target code generation Machine-specific.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Definition and Representation A set is a well-defined collection of objects; The objects are called elements or members of the set; A set can be represented.
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.
Chapter 7 Logic, Sets, and Counting Section 2 Sets.
Week 6: Gates and Circuits: PART I READING: Chapter 4.
CSE 522 Model-based Development (1) Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee
Review: Compiler Phases: Source program Lexical analyzer Syntax analyzer Semantic analyzer Intermediate code generator Code optimizer Code generator Symbol.
CompSci 102 Discrete Math for Computer Science
Section 2.1. Section Summary Definition of sets Describing Sets Roster Method Set-Builder Notation Some Important Sets in Mathematics Empty Set and Universal.
Chapter SETS DEFINITION OF SET METHODS FOR SPECIFYING SET SUBSETS VENN DIAGRAM SET IDENTITIES SET OPERATIONS.
CMSC 330: Organization of Programming Languages Theory of Regular Expressions Finite Automata.
Chapter 2 With Question/Answer Animations. Section 2.1.
Finite Automata Chapter 1. Automatic Door Example Top View.
Computing Machinery Chapter 4: Finite State Machines.
Theory of computing, part 4. 1Introduction 2Theoretical background Biochemistry/molecular biology 3Theoretical background computer science 4History of.
Welcome to Form 4 Mathematics Topic for the day SETS.
BİL711 Natural Language Processing1 Regular Expressions & FSAs Any regular expression can be realized as a finite state automaton (FSA) There are two kinds.
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
DISCRETE DYNAMICS EEN 417 Fall Midterm I In class on 10/4 Covered Material will be: Chapter 1 (Introduction) Chapters 2 & 3 (Continuous and Discrete.
© Copyright 2004, Gaetano Borriello and Randy H. Katz
Lexical analysis Finite Automata
Logic Gates.
Turing Machines 2nd 2017 Lecture 9.
Autonomous Cyber-Physical Systems: Synchronous Components: II
Review: Compiler Phases:
4b Lexical analysis Finite Automata
Deterministic Finite Automaton (DFA)
L5 Set Operations.
State Machines EECS 20 Lecture 8 (February 2, 2001) Tom Henzinger.
Chapter 7 Logic, Sets, and Counting
4b Lexical analysis Finite Automata
Lecture 20 Logistics Last lecture Today HW6 due Wednesday
Presentation transcript:

Week 2/3 1.System interconnections (block diagrams) 2.Finite State Machines (Chapter 3)

Recall

A system S is a function : InputSignals  OutputSignals with InputSignals = [D  R], OutputSignals = [D’  R’] S x  InputSignals y = S(x)  OutputSignals

10Evans: [Ints +  {enter, leave}]  [Ints +  Integers + ] 10Evans u = (e,l,l,e,e,… ) y = (6,5,4,5,6,… ) initial number in room 5 InputSignals OutputSignals

The system 10Evans can be specified as follows: y = 10Evans (u), and for all n  Ints +, y(n) is given by where

How do you ‘give’ S? S u  Speeds y=S(u)  Positions Speeds = [[0,5]  Reals], Positions = [[0,5]  Reals] y(0) initial position

Other examples: TopicNotes/Systems/DTMFTopicNotes/Systems/DTMF KeypadSequences Sounds DTMF DTMF: [Nats  KeypadSymbols]  [Time  Pressure]

Interconnecting Systems: Block Diagrams

Voice  [Time  Pressure]; MicOutput  [Time  Volts] Microphone: [Time  Pressure]  [Time  Volts]; AGCSound  [Time  Pressure]; Volume  [Time  Volts] VolumeSensor: [Time  Pressure]  [Time  Volts]; Output  [Time  Volts] AGC: [Time  Volts] x [Time  Volts]  [Time  Pressure] v 1 = Microphone (u) s = AGC (v 1, v 2 ) v 2 = VolumeSensor(s) y = v 2 MicOutput AGCSound Microphone AGC Volume Sensor Voice uv1v1 s v2v2 Output y 4 equations 4 unknowns

Finite State Machines

Recognizer x = (x(0), x(1), x(2), …) y = (y(0), y(1), y(2), …) x  InputSignals = [Nats 0  {0,1}] y  OutputSignals = [Nats 0  {t,f}] x  InputSignals y  OutputSignals Recognizer(x)(n) = t, if (x(n-2),x(n-1),x(n)) = (0,0,0) = f, else Recognizer((0,1,0,0,0,0,1,1, …)) = (f,f,f,f,t,t,f,f, …)

init a b 0/f 0/t 1/f x  InputSignals y  OutputSignals x = (0, 1, 0, 0, 0, 0, 1, 1, …) s = (init, a, init, a, b, b, b, init, …) y = (f, f, f, f, t, t, f, f, …) s(0) = init (s(n+1), y(n)) = update (s(n), x(n)), n = 0,1,…

init a b {0}/f {0}/t {1,2}/f x  [Nats 0  {0,1,2}] y  [Nats 0  {t,f}] x = (0, 2, 0, 0, 0, 0, 1, 2, …) s = (init, a, init, a, b, b, b, init, …) y = (f, f, f, f, f, t, t, f, …) s(0) = init (s(n+1), y(n)) = update (s(n), x(n)), n = 0,1,… guard

What does this machine with 4 states do? ‘1,2’ ‘0’ ’00’ {0}/f {0}/t {1,2}/f y  [Nats 0  {t,f}] init {0}/f {1,2}/f x  [Nats 0  {0,1,2}] It also implements Recognizer Can a machine with 2 states implement Recognizer?

Formal definition of state machine 1.Sets and functions 2.Bubble and arcs 3.Tabular

A state machine is a 5-tuple StateMachine = (States, Inputs, Outputs, update, initialState) States is the state space Inputs is the input alphabet Outputs is the output alphabet initialState  States is the initial state update: States x Inputs  States x Outputs is the update function Sets and function

For Recognizer States = {init, a, b} Inputs = {0,1} Outputs = {t, f} initialState = init update(init, 0) = (0, f) update(init, 1) = (init, f) … update: States x Inputs  States x Outputs is given by: current state current input next state current output (s(n+1), y(n)) = update(s(n), x(n))

It is useful sometimes to express the update function as two functions: update = (nextState, output), nextState: States x Inputs  States output: States x Inputs  Outputs so that update(s(n), x(n)) = (s(n+1), y(n)) nextState(s(n), x(n)) = s(n+1) output(s(n), x(n)) = y(n)

Operation of state machine Given S = (States, Inputs, Outputs, update, initialState) InputSignals = [Nats 0  Inputs] OutputSignals = [Nats 0  Outputs] An input signal x = (x(0), x(1), …, x(n), …) determines the state response s: Nats 0  States and the output signal y: Nats 0  Outputs by the recursion, s(0) = initState, and n  0, (s(n+1), y(n)) = update (s(n), x(n)) Thus S determines an input-output function (system) F: InputSignals  OutputSignals

For Recognizer InputSignals = [Nats 0  {0,1}] OutputSignals = [Nats 0  {t,f}] The input-output function (system) is F:  x  InputSignals,  n  Nats 0 y(n) = F(x)(n) = t, if (x(n-2), x(n-1)), x(0)) = (0,0,0) = f, else

Stuttering

It is useful to introduce a stuttering symbol absent We insist that absent  Inputs and absent  Outputs We require that for all states s  States update(s, absent) = (s, absent)

A modified Recognizer init a b 0/abs 0/t 1/abs x  InputSignals y  OutputSignals x = (0, 1, 0, 0, 0, 0, 1, 1, …) s = (init, a, init, a, b, b, b, init, …) y = (abs, abs, abs, abs, t, t, abs, abs, …)

Bubbles and arcs

Shorthand: the ‘else’ loop init a b {0}/abs else x  [Nats 0  {0,1,2, absent}] y  [Nats 0  {t,absent}] else 0/t

Shorthand: the implicit ‘else’ self loop init a b {0}/abs else x  [Nats 0  {0,1,2, absent}] y  [Nats 0  {t,absent}] else 0/t

Shorthand: the implicit ‘absent’ init a b {0}/ else x  [Nats 0  {0,1,2, absent}] y  [Nats 0  {t,absent}] else 0/t abs

The guards are subsets of Inputs guards on different arcs from same state are disjoint (determinism) union of all guards (from same state) = Inputs; (reactive system) guard on ‘else’ is complement of remaining guards guards may be defined using convenient notation, eg. if Inputs = {a, b, c},  a = {b,c}

Tabular Representation

All information about a state machine is given its update function. If States and Inputs are finite, update can be given as a table (next state, output) if input is current state init a b 01absent (a, f) (b, f) (b, t) (init, f) (init, abs) (a, abs) (b, abs)

System requirements in English System specification as F: InputSignals  OutputSignals System implementation as state machine Described by set-and-functions 5-tuple, transition diagram, or table State machine design process

60-min Parking meter {tick, coin5, coin25, absent} {safe, expired, absent} Parking meter topics/state/parking meter

Answering machine topics/state/answering machine table