580 likes | 663 Views
Block Diagrams. EECS 20 Lecture 4 (January 24, 2001) Tom Henzinger . 1 Systems are functions 2 Signals are functions . Systems as Functions. Input. Output. Domain: set of possible inputs Range: set of possible outputs Graph: set of pairs ( input, output ).
E N D
Block Diagrams EECS 20 Lecture 4 (January 24, 2001) Tom Henzinger
1 Systems are functions 2 Signals are functions
Systems as Functions Input Output Domain: set of possible inputs Range: set of possible outputs Graph: set of pairs ( input, output )
Factorial System Nats Nats !
Factorial System Nats Nats 3 ! 6
Factorial System Nats Nats 4 ! 24
Factorial System Nats Nats 4 ! 24 Domain: Nats Range: Nats Graph: {( 1, 1 ), ( 2, 2 ), ( 3, 6), ( 4, 24 ), … }
Inverter System Bools Bools
Inverter System Bools Bools true false
Inverter System Bools Bools false true
Inverter System Bools Bools false true Domain: Bools Range: Bools Graph: {( true, false ), ( false, true ) }
Composition of Systems Bools Bools Bools true true false
Composition of Systems Bools Bools Bools false false true
This is again a system ! Bools Bools
The Identity System Bools Bools id Domain: Bools Range: Bools Graph: { ( x, y ) Bools2 | x = y }
System Composition is Function Composition = id because domain ( ) = domain (id) range ( ) = range (id) x Bools, ( x ) = id (x)
And System Bools
And System Bools2 Bools
And System Bools2 Bools (true, false) false
And System Bools Bools Bools
And System Bools true Bools false false Bools
- Exponentiation System Nats 2 Nats exp ? 3 Nats graph (exp) = { ( (x,y), z ) Nats2 Nats | z = xy }
Exponentiation System Nats 2 Nats 1 exp 8 3 2 Nats graph (exp) = { ( (x,y), z ) Nats2 Nats | z = xy }
Exponentiation System Nats 2 Nats 2 exp 9 3 1 Nats graph (exp) = { ( (x,y), z ) Nats2 Nats | z = xy }
Block Diagram Bools Bools Bools Bools Bools Bools This cannot be written easily using .
Block Diagram Bools true Bools false Bools
Block Diagram Bools false true Bools false true Bools
Block Diagram Bools false true false Bools false true Bools
Block Diagram Bools false true false Bools true false true Bools
Or System Bools Bools Bools domain () = Bools2 range () = Bools graph () = { ( (x,y), z ) Bools2 Bools | z = x y }
- Or System Bools Bools Bools domain () = Bools2 range () = Bools graph () = { ( (x,y), z ) Bools2 Bools | z = x y }
Block Diagrams with Forks
Block Diagrams with Forks true false
Block Diagrams with Forks f true false
Block Diagrams with Forks f t true false f
Block Diagrams with Forks f t true true false f
Joins are illegal
Joins are illegal true false
Joins are illegal f true ? false t
Multiple Outputs Nats Nats0 f Nats0 Nats f: Nats2 Nats02 such that x,yNats, f (x,y) = { (q,r)Nats02 | x = q· y + r r < y }
Division System Nats Nats0 quotient 1 1 divide 2 remainder 2 Nats0 Nats divide: Nats2 Nats02 such that x,yNats, divide (x,y) = { (q,r)Nats02 | x = q· y + r r < y }
Division System Nats Nats0 7 1 1 divide 3 2 2 Nats0 Nats divide: Nats2 Nats02 such that x,yNats, divide (x,y) = { (q,r)Nats02 | x = q· y + r r < y }
Division System Nats Nats0 7 2 1 1 divide 3 2 1 2 Nats0 Nats divide: Nats2 Nats02 such that x,yNats, divide (x,y) = { (q,r)Nats02 | x = q· y + r r < y }
Division System Nats Nats0 3 1 1 divide 7 2 2 Nats0 Nats divide: Nats2 Nats02 such that x,yNats, divide (x,y) = { (q,r)Nats02 | x = q· y + r r < y }
Division System Nats Nats0 3 0 1 1 divide 7 2 3 2 Nats0 Nats divide: Nats2 Nats02 such that x,yNats, divide (x,y) = { (q,r)Nats02 | x = q· y + r r < y }
Division System Nats Nats0 9 3 1 1 divide 3 2 0 2 Nats0 Nats divide: Nats2 Nats02 such that x,yNats, divide (x,y) = { (q,r)Nats02 | x = q· y + r r < y }
Many possible implementations divide Nats Nats0 1 1 C program for Euclid’s algorithm 2 2 Nats0 Nats divide: Nats2 Nats02 such that x,yNats, divide (x,y) = { (q,r)Nats02 | x = q· y + r r < y }
Many possible implementations divide Nats Nats0 1 1 circuit 2 2 Nats0 Nats divide: Nats2 Nats02 such that x,yNats, divide (x,y) = { (q,r)Nats02 | x = q· y + r r < y }
Block diagrams can hide outputs Nats 1 1 divide Bools 2 2 zerocheck Nats zerocheck: Nats0 Bools such that xNats, zerocheck (x) x = 0 .
Block Diagrams can hide outputs Nats 1 1 divide Bools 2 2 zerocheck Nats zerocheck: Nats0 Bools such that xNats, zerocheck (x) x = 0 .