EECS 20 Lecture 10 (February 7, 2001) Tom Henzinger Product Machines.

Slides:



Advertisements
Similar presentations
Geometry Logic.
Advertisements

Finite State Machines (FSMs)
Software Testing Logic Coverage. Introduction to Software Testing (Ch 3) © Ammann & Offutt 2 Logic Coverage Four Structures for Modeling Software Graphs.
Logic ChAPTER 3 1. Truth Tables and Validity of Arguments
EECS 20 Lecture 14 (February 16, 2001) Tom Henzinger Nondeterminism.
EECS 20 Lecture 11 (February 9, 2001) Tom Henzinger Feedback.
EECS 20 Lecture 38 (April 27, 2001) Tom Henzinger Review.
Hardware Implementations Gates and Circuits. Three Main Gates  AND  OR  NOT.
EECS 20 Lecture 15 (February 21, 2001) Tom Henzinger Simulation.
EECS 20 Lecture 13 (February 14, 2001) Tom Henzinger Minimization.
Gates and Circuits. Three Main Gates  AND  OR  NOT.
General Computer Science for Engineers CISC 106 Lecture 04 Roger Craig Computer and Information Sciences 9/11/2009.
CS61C L21 State Elements : Circuits that Remember (1) Spring 2007 © UCB 161 Exabytes In 2006  In 2006 we created, captured, and replicated 161 exabytes.
EECS 20 Lecture 16 (February 26, 2001) Tom Henzinger Determinization.
CS61C L21 State Elements : Circuits that Remember (1) Garcia, Fall 2006 © UCB One Laptop per Child  The OLPC project has been making news recently with.
EECS 20 Lecture 8 (February 2, 2001) Tom Henzinger State Machines.
CS61C L24 Latches (1) Garcia © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture.
EECS 20 Lecture 9 (February 5, 2001) Tom Henzinger Transition Diagrams.
1 Intro to Probability Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong.
Give qualifications of instructors: DAP
Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design Finite State.
EECS 20 Lecture 7 (January 31, 2001) Tom Henzinger Reactive Systems.
EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language.
CS 61C L21 State Elements: CircuitsThat Remember (1) Garcia, Fall 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS61C L17 Combinational Logic (1) Chae, Summer 2008 © UCB Albert Chae, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #17.
EECS 20 Lecture 4 (January 24, 2001) Tom Henzinger Block Diagrams.
EECS 20 Lecture 36 (April 23, 2001) Tom Henzinger Safety Control.
CS61C L15 Synchronous Digital Systems (1) Beamer, Summer 2007 © UCB Scott Beamer, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture.
EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.
Propositional Logic 7/16/ Propositional Logic A proposition is a statement that is either true or false. We give propositions names such as p, q,
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
BUILDING COMPUTER CIRCUITS prepared by Burak Galip ASLAN September, 2006 BOOLEAN LOGIC AND GATES CONTROL CIRCUITS.
Chapter 1 The Logic of Compound Statements. Section 1.1 Logical Form and Logical Equivalence.
1 EECS 465: Digital Systems Lecture Notes # 8 Sequential Circuit (Finite-State Machine) Design SHANTANU DUTT Department of Electrical and Computer Engineering.
Finite-State Machines with Output
Valid and Invalid Arguments
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
Lecture 18 More Moore/Mealy machines.
3.3: Truth Tables. Types of Statements Negation: ~p Conjunction: p ˄ q (p and q) Disjunction: p V q (p or q, or both) Conditional: p → q (if p, then q)
Let’s Learn About Money!
Name the United States Coins Count the Pennies 10 ¢
Conditional Statements
DLD Lecture 26 Finite State Machine Design Procedure.
Warmup Answer the following True/False questions in your head: I have brown hair AND I am wearing glasses I am male OR I am wearing sneakers I am NOT male.
How do I show that two compound propositions are logically equivalent?
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
If a quadrilateral is a square, then it has 4 right angles. What is p? A quad is a square What is the conclusion? It has 4 right angles What is the converse?
Formal Test for Validity. EVALUATIONS Evaluations An evaluation is an assignment of truth-values to sentence letters. For example: A = T B = T C = F.
Boolean Logic.
Notes - Truth Tables fun, fun, and more fun!!!!. A compound statement is created by combining two or more statements, p and q.
CEC 220 Digital Circuit Design Boolean Algebra I Wed, Sept 2 CEC 220 Digital Circuit Design Slide 1 of 13.
Statement Forms and Material Equivalence Kareem Khalifa Department of Philosophy Middlebury College.
CEC 220 Digital Circuit Design Boolean Algebra Friday, January 17 CEC 220 Digital Circuit Design Slide 1 of 22.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Joan Ridgway. If a proposition is not indeterminate then it is either true (T) or false (F). True and False are complementary events. For two propositions,
CEC 220 Digital Circuit Design Sequence Detector Design Wednesday, April 01 CEC 220 Digital Circuit Design Slide 1 of 11.
MATH 110 Sec 12-1 Lecture: Intro to Counting Introduction to Counting: Just how many are there?
CS61C L24 State Elements : Circuits that Remember (1) Garcia, Fall 2014 © UCB Senior Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
Conditional Statements Lecture 2 Section 1.2 Fri, Jan 20, 2006.
TRUTH TABLES Edited from the original by: Mimi Opkins CECS 100 Fall 2011 Thanks for the ppt.
1 (c) W. J. Dally Digital Design: A Systems Approach Lecture 7: Data Path State Machines.
Section 3.2: Truth Tables for Negation, Conjunction, and Disjunction
Flip Flops Lecture 10 CAP
Boolean logic Taken from notes by Dr. Neil Moore
Name the United States Coins
State Machines EECS 20 Lecture 8 (February 2, 2001) Tom Henzinger.
Boolean logic Taken from notes by Dr. Neil Moore
CSE 140 Lecture 9 Sequential Networks
Mathematical Language
Presentation transcript:

EECS 20 Lecture 10 (February 7, 2001) Tom Henzinger Product Machines

Composition of State Machines

Transition Diagram of the Parity System truefalse true / true true / false false / true false / false States = Bools Inputs = Bools Outputs = Bools

Transition Diagram of the LastThree System States = { 0, 1, 2 } Inputs = Bools Outputs = Bools 0 21 true / false false / false true / true true / false

The Parity System : States [ Parity] = { true, false } initialState [ Parity ] = true nextState [ Parity ] (q,x) = (q  x) output [ Parity ] (q,x) = q The LastThree System : States [ LastThree] = { 0, 1, 2 } initialState [ LastThree ] = 0 nextState [ LastThree ] (q,x) = output [ LastThree ] (q,x) = ( ( q = 2 )  x ) 0 if  x min (q+1, 2) if x {

Nats 0  Bools D true Nats 0  Bools Block Diagram of Parity System nextState output Parity No path without delay from input to output. 

Nats 0  Bools D true Nats 0  Bools Block Diagram of LastThree System nextState output LastThree Path without delay from input to output !

Parity LastThree Nats 0  Bools dependency without delay

Parity LastThree  ParityOrLastThree Nats 0  Bools

Parity LastThree  ParityOrLastThree Nats 0  Bools t, t, t, …t, f, t, …

The ParityOrLastThree System Inputs [ ParityOrLastThree ] = Bools Outputs [ ParityOrLastThree ] = Bools States [ ParityOrLastThree ] = States [ Parity ]  States [ LastThree ] = { true, false }  { 0, 1, 2 } initialState [ ParityOrLastThree ] = ( initialState [ Parity ], initialState [ LastThree ] ) = ( true, 0 )

The ParityOrLastThree System, continued nextState [ ParityOrLastThree ] ( ( q1, q2 ), x ) = ( nextState [ Parity ] (q1, x), nextState [ LastThree ] (q2, x) ) output [ ParityOrLastThree ] ( ( q1, q2 ), x ) = output [ Parity ] (q1, x)  output [ LastThree ] (q2, x)

t, 0 f, 0f, 1f, 2 t, 2 t, 1 f/tf/t t/tt/tt/ft/f f/ff/f t/ft/f f/ff/f t/tt/t f/tf/t t/tt/t f/tf/t t/tt/t f/ff/f

Parity LastThree  ParityAndLastThree Nats 0  Bools

Parity LastThree  ParityAndLastThree Nats 0  Bools t, t, t, …f, f, t, …

The ParityAndLastThree System Inputs [ ParityAndLastThree ] = Bools Outputs [ ParityAndLastThree ] = Bools States [ ParityAndLastThree ] = States [ Parity ]  States [ LastThree ] = { true, false }  { 0, 1, 2 } initialState [ ParityAndLastThree ] = ( initialState [ Parity ], initialState [ LastThree ] ) = ( true, 0 )

The ParityAndLastThree System, continued nextState [ ParityAndLastThree ] ( ( q1, q2 ), x ) = ( nextState [ Parity ] (q1, x), nextState [ LastThree ] (q2, x) ) output [ ParityAndLastThree ] ( ( q1, q2 ), x ) = output [ Parity ] (q1, x)  output [ LastThree ] (q2, x)

t, 0 f, 0f, 1f, 2 t, 2 t, 1 f/ff/f t/ft/ft/ft/f f/ff/f t/ft/f f/ff/f t/ft/f f/ff/f t/tt/t f/ff/f t/ft/f f/ff/f

Parity LastThree  InputPairs Nats 0  Bools 1 2

Parity LastThree  InputPairs Nats 0  Bools t, t, f, … t, t, t, … f, f, t, … 1 2

The InputPairs System Inputs [ InputPairs ] = Bools  Bools Outputs [ InputPairs ] = Bools States [ InputPairs ] = States [ Parity ]  States [ LastThree ] = { true, false }  { 0, 1, 2 } initialState [ InputPairs ] = ( initialState [ Parity ], initialState [ LastThree ] ) = ( true, 0 )

The InputPairs System, continued nextState [ InputPairs ] ( ( q1, q2 ), (x1, x2) ) = ( nextState [ Parity ] (q1, x1), nextState [ LastThree ] (q2, x2) ) output [ InputPairs ] ( ( q1, q2 ), (x1, x2) ) = output [ Parity ] (q1, x1)  output [ LastThree ] (q2, x2)

t, 0 f, 0f, 1f, 2 t, 2 t, 1

t, 0 f, 0f, 1f, 2 t, 2 t, 1 (f,f)/t (t,t)/t

t, 0 f, 0f, 1f, 2 t, 2 t, 1 (f,f)/f (t,t)/f (f,t)/f (t,f)/f

Parity LastThree OutputPairs Nats 0  Bools 1 2

Parity LastThree OutputPairs Nats 0  Bools t, f, t, … Nats 0  Bools f, f, f, … t, f, f, … 1 2

The OutputPairs System Inputs [ OutputPairs ] = Bools Outputs [ OutputPairs ] = Bools  Bools States [ OutputPairs ] = States [ Parity ]  States [ LastThree ] = { true, false }  { 0, 1, 2 } initialState [ OutputPairs ] = ( initialState [ Parity ], initialState [ LastThree ] ) = ( true, 0 )

The OutputPairs System, continued nextState [ OutputPairs ] ( ( q1, q2 ), x ) = ( nextState [ Parity ] (q1, x), nextState [ LastThree ] (q2, x) ) output [ OutputPairs ] ( ( q1, q2 ), x ) = ( output [ Parity ] (q1, x), output [ LastThree ] (q2, x) )

t, 0 f, 0f, 1f, 2 t, 2 t, 1 f/(t,f) t/(t,f) t/(f,f) f/(f,f) t/(f,f) f/(f,f) t/(t,f) f/(t,f) t/(t,t) f/(t,f) t/(f,t) f/(f,f)

Any block diagram of N state machines with the state spaces States1, States2, … StatesN can be implemented by a single state machine with the state space States1  States2  …  StatesN. This is called a “product machine”.

Parity LastThree FeedbackLoop Nats 0  Bools  This block diagram is ok, because every cycle contains a delay.

Parity LastThree FeedbackLoop Nats 0  Bools t, f, t, … Nats 0  Bools t  t

Parity LastThree FeedbackLoop Nats 0  Bools t, f, t, … Nats 0  Bools t  tf

Parity LastThree FeedbackLoop Nats 0  Bools t, f, t, … Nats 0  Bools t  tf f

Parity LastThree FeedbackLoop Nats 0  Bools t, f, t, … Nats 0  Bools t, t  f f

Parity LastThree FeedbackLoop Nats 0  Bools t, f, t, … Nats 0  Bools t, t  f, f f

Parity LastThree FeedbackLoop Nats 0  Bools t, f, t, … Nats 0  Bools t, t  f, f

Parity LastThree FeedbackLoop Nats 0  Bools t, f, t, … Nats 0  Bools t, t, t  f, f

Parity LastThree FeedbackLoop Nats 0  Bools t, f, t, … Nats 0  Bools t, t, t  f, f, t f, f

Parity LastThree FeedbackLoop Nats 0  Bools t, f, t, … Nats 0  Bools t, t, t  f, f, t

Parity LastThree FeedbackLoop Nats 0  Bools t, f, t, … Nats 0  Bools t, t, t, f  t, t, tf, f, t

Example: Vending Machine

Coin Collector CollectNats 0  Coins  Nats 0  Nats 0 Let Coins = { Nickel, Dime, Quarter }. Let Coins  = Coins  {  }. (  stands for “no input.” )

Coin Collector D/0D/0 D/15D/10D/5D/5 D/25D/20 /0/0 /5/5  /10  /15  /20  /25  /30 N/10N/0N/0N/5N/5N/25N/20N/15 Q/0Q/0Q/5Q/5Q/10

Finite-State Coin Collector CollectF Nats 0  {0, … 30 } Nats 0  Coins  1 2

Finite-State Coin Collector D/(0,  )  /(0,  ) N/(0,  ) Q/(0,  )

Finite-State Coin Collector D/(0,  )  /(0,  ) N/(0,  ) Q/(0,  ) D/(25,D)  /(25,  ) N/(25,  ) Q/(25,Q)

Coin Collector with Reset CollectFR Nats 0  {0, … 30 } Nats 0  Coins  1 2 Nats 0  Bools 1 2 reset

Coin Collector with Reset (D,f)/(15,  ) ( ,f)/(15,  ) (N,f)/ (15,  ) ( ,t)/(15,  ) (Q,f)/(15,Q)

Coin Collector with Reset (D,f)/(15,  ) ( ,f)/(15,  ) (N,f)/ (15,  ) ( ,t)/(15,  ) (Q,f)/(15,Q) (Q,t)/(15,  ) (N,t)/(15,  ) (D,t)/ (15,  )

Coin Collector with Reset CollectFR Nats 0  {0, … 30 } Nats 0  Coins  1 2 Nats 0  Bools 1 2

Soda Dispenser Disp Nats 0  Dispense  Nats 0  Select  Nats 0  Bools 1 2 Nats 0  { 0, … 30 } 1 2 Let Select = { selectCoke, selectDiet }. Let Dispense = { dispenseCoke, dispenseDiet }. fundsreset

Soda Dispenser none Diet Coke

Soda Dispenser none Diet Coke {(C,x)|x<25} / ( ,f) {(D,x)|x  20} / (D,t) {(C,x)|x  25} / (C,t) {(D,x)|x<20} / ( ,f) {( ,x)|x  0} / ( ,f)

Soda Dispenser none Diet Coke {( ,x)|x  25} / (C,t) {(C,x)|x<25} / ( ,f) {( ,x)|x<25} / ( ,f) {(C,x)|x  25} / (C,t) {(D,x)|x  20} / (D,t) {(D,x)|x<20} / ( ,f)

Soda Dispenser with Change DispC Nats 0  Dispense  Nats 0  Select  Nats 0  Bools 1 2 Nats 0  { 0, … 30 } 1 2 funds reset 3 Nats 0  Coins  change

Soda Dispenser with Change none Diet Coke {(C,x)|x<25} / ( ,f,  ) (C,25) / (C,t,  ) (C,30) / (C,t,N) (D,20) / (D,t,  ) (D,25) / (D,t,N) (D,30) / (D,t,D) {(C,x)|x<20} / ( ,f,  ) {( ,x)|x  0} / ( ,f,  )

Soda Dispenser with Change DispC Nats 0  Dispense  Nats 0  Select  Nats 0  Bools 1 2 Nats 0  { 0, … 30 } Nats 0  Coins 

Vending Machine DispC Nats 0  Dispense  Nats 0  Select  Nats 0  Bools 1 3 Nats 0  { 0, … 30 } Nats 0  Coins  CollectFR Nats 0  Coins  resetfunds

State Space of Vending Machine { 0, 5, 10, 15, 20, 25, 30 }  { none, Coke, Diet } 21 states