EECS 20 Lecture 4 (January 24, 2001) Tom Henzinger Block Diagrams

Download EECS 20 Lecture 4 (January 24, 2001) Tom Henzinger Block Diagrams

Post on 22-Dec-2015

213 views

Category:

Documents

1 download

Embed Size (px)

TRANSCRIPT

<ul><li> Slide 1 </li> <li> EECS 20 Lecture 4 (January 24, 2001) Tom Henzinger Block Diagrams </li> <li> Slide 2 </li> <li> 1 Systems are functions 2 Signals are functions </li> <li> Slide 3 </li> <li> Systems as Functions InputOutput Domain: set of possible inputs Range: set of possible outputs Graph: set of pairs ( input, output ) </li> <li> Slide 4 </li> <li> Factorial System ! Nats </li> <li> Slide 5 </li> <li> Factorial System ! Nats 36 </li> <li> Slide 6 </li> <li> Factorial System ! Nats 424 </li> <li> Slide 7 </li> <li> Factorial System ! Nats 424 Domain: Nats Range: Nats Graph: { ( 1, 1 ), ( 2, 2 ), ( 3, 6), ( 4, 24 ), } </li> <li> Slide 8 </li> <li> Inverter System Bools </li> <li> Slide 9 </li> <li> Inverter System Bools truefalse </li> <li> Slide 10 </li> <li> Inverter System Bools falsetrue </li> <li> Slide 11 </li> <li> Inverter System Bools falsetrue Domain: Bools Range: Bools Graph: { ( true, false ), ( false, true ) } </li> <li> Slide 12 </li> <li> Composition of Systems Bools true false </li> <li> Slide 13 </li> <li> Composition of Systems Bools false true </li> <li> Slide 14 </li> <li> This is again a system ! Bools </li> <li> Slide 15 </li> <li> The Identity System Bools id Domain: Bools Range: Bools Graph: { ( x, y ) Bools 2 | x = y } </li> <li> Slide 16 </li> <li> System Composition is Function Composition = id because domain ( ) = domain (id) range ( ) = range (id) x Bools, ( x ) = id (x) </li> <li> Slide 17 </li> <li> And System Bools </li> <li> Slide 18 </li> <li> And System Bools 2 Bools </li> <li> Slide 19 </li> <li> And System Bools (true, false)false Bools 2 </li> <li> Slide 20 </li> <li> And System Bools </li> <li> Slide 21 </li> <li> And System Bools true false </li> <li> Slide 22 </li> <li> Exponentiation System Nats exp Nats 2 3 ? - graph (exp) = { ( (x,y), z ) Nats 2 Nats | z = x y } </li> <li> Slide 23 </li> <li> Exponentiation System Nats exp Nats 2 3 8 2 1 graph (exp) = { ( (x,y), z ) Nats 2 Nats | z = x y } </li> <li> Slide 24 </li> <li> Nats exp Nats 2 3 9 1 2 Exponentiation System graph (exp) = { ( (x,y), z ) Nats 2 Nats | z = x y } </li> <li> Slide 25 </li> <li> Bools Block Diagram This cannot be written easily using . </li> <li> Slide 26 </li> <li> Bools Block Diagram true false </li> <li> Slide 27 </li> <li> Bools Block Diagram true false true false </li> <li> Slide 28 </li> <li> Bools Block Diagram true false true false </li> <li> Slide 29 </li> <li> Bools Block Diagram true false true false </li> <li> Slide 30 </li> <li> Bools Or System domain ( ) = Bools 2 range ( ) = Bools graph ( ) = { ( (x,y), z ) Bools 2 Bools | z = x y } </li> <li> Slide 31 </li> <li> Bools Or System domain ( ) = Bools 2 range ( ) = Bools graph ( ) = { ( (x,y), z ) Bools 2 Bools | z = x y } - </li> <li> Slide 32 </li> <li> Block Diagrams with Forks </li> <li> Slide 33 </li> <li> true false </li> <li> Slide 34 </li> <li> Block Diagrams with Forks true false f </li> <li> Slide 35 </li> <li> Block Diagrams with Forks true false f f t </li> <li> Slide 36 </li> <li> Block Diagrams with Forks true false f f t true </li> <li> Slide 37 </li> <li> Joins are illegal </li> <li> Slide 38 </li> <li> true false </li> <li> Slide 39 </li> <li> Joins are illegal true false f t ? </li> <li> Slide 40 </li> <li> Multiple Outputs Nats Nats 0 f f: Nats 2 Nats 0 2 such that x,y Nats, f (x,y) = { (q,r) Nats 0 2 | x = q y + r r &lt; y } </li> <li> Slide 41 </li> <li> Division System Nats divide divide: Nats 2 Nats 0 2 such that x,y Nats, divide (x,y) = { (q,r) Nats 0 2 | x = q y + r r &lt; y } 1 2 1 2 quotient remainder Nats 0 </li> <li> Slide 42 </li> <li> Division System Nats divide 7 3 1 2 1 2 divide: Nats 2 Nats 0 2 such that x,y Nats, divide (x,y) = { (q,r) Nats 0 2 | x = q y + r r &lt; y } Nats 0 </li> <li> Slide 43 </li> <li> Division System Nats divide 7 3 1 2 1 2 2 1 divide: Nats 2 Nats 0 2 such that x,y Nats, divide (x,y) = { (q,r) Nats 0 2 | x = q y + r r &lt; y } Nats 0 </li> <li> Slide 44 </li> <li> Division System Nats divide 3 7 1 2 1 2 divide: Nats 2 Nats 0 2 such that x,y Nats, divide (x,y) = { (q,r) Nats 0 2 | x = q y + r r &lt; y } Nats 0 </li> <li> Slide 45 </li> <li> Division System Nats divide 3 7 1 2 1 2 0 3 divide: Nats 2 Nats 0 2 such that x,y Nats, divide (x,y) = { (q,r) Nats 0 2 | x = q y + r r &lt; y } Nats 0 </li> <li> Slide 46 </li> <li> Division System Nats divide 9 3 1 2 1 2 3 0 divide: Nats 2 Nats 0 2 such that x,y Nats, divide (x,y) = { (q,r) Nats 0 2 | x = q y + r r &lt; y } Nats 0 </li> <li> Slide 47 </li> <li> Many possible implementations Nats 1 2 1 2 C program for Euclids algorithm divide divide: Nats 2 Nats 0 2 such that x,y Nats, divide (x,y) = { (q,r) Nats 0 2 | x = q y + r r &lt; y } Nats 0 </li> <li> Slide 48 </li> <li> Many possible implementations Nats Nats 0 1 2 1 2 circuit divide divide: Nats 2 Nats 0 2 such that x,y Nats, divide (x,y) = { (q,r) Nats 0 2 | x = q y + r r &lt; y } </li> <li> Slide 49 </li> <li> Block diagrams can hide outputs divide 22 11 zerocheck zerocheck: Nats 0 Bools such that x Nats, zerocheck (x) x = 0. Nats Bools </li> <li> Slide 50 </li> <li> Block Diagrams can hide outputs divide 22 11 zerocheck zerocheck: Nats 0 Bools such that x Nats, zerocheck (x) x = 0. Nats Bools </li> <li> Slide 51 </li> <li> Block Diagrams can hide outputs 2 1 Nats Bools divisible divisible: Nats 2 Bools such that x,y Nats, divisible (x,y) ( q Nats, x = q y ). </li> <li> Slide 52 </li> <li> Hidden inputs are illegal, for now </li> <li> Slide 53 </li> <li> true ? </li> <li> Slide 54 </li> <li> Constant functions have no inputs true </li> <li> Slide 55 </li> <li> Constant function true </li> <li> Slide 56 </li> <li> Cycles are illegal, for now divide </li> <li> Slide 57 </li> <li> Block Diagrams -are nested, directed, acyclic graphs -allow compositional, hierarchical system description </li> <li> Slide 58 </li> <li> Quiz 1. set x, x P(x) 2. function f, { x domain (f) | x = f(x) } 3. n Nats, n = 2 ( n, n+1 ) { 1, 2, 3 } 2 4. f [Nats Nats], f(x) = x 2 </li> </ul>