Download presentation
Presentation is loading. Please wait.
1
EECS 20 Lecture 4 (January 24, 2001) Tom Henzinger Block Diagrams
2
1 Systems are functions 2 Signals are functions
3
Systems as Functions InputOutput Domain: set of possible inputs Range: set of possible outputs Graph: set of pairs ( input, output )
4
Factorial System ! Nats
5
Factorial System ! Nats 36
6
Factorial System ! Nats 424
7
Factorial System ! Nats 424 Domain: Nats Range: Nats Graph: { ( 1, 1 ), ( 2, 2 ), ( 3, 6), ( 4, 24 ), … }
8
Inverter System Bools
9
Inverter System Bools truefalse
10
Inverter System Bools falsetrue
11
Inverter System Bools falsetrue Domain: Bools Range: Bools Graph: { ( true, false ), ( false, true ) }
12
Composition of Systems Bools true false
13
Composition of Systems Bools false true
14
This is again a system ! Bools
15
The Identity System Bools id Domain: Bools Range: Bools Graph: { ( x, y ) Bools 2 | x = y }
16
System Composition is Function Composition = id because domain ( ) = domain (id) range ( ) = range (id) x Bools, ( x ) = id (x)
17
And System Bools
18
And System Bools 2 Bools
19
And System Bools (true, false)false Bools 2
20
And System Bools
21
And System Bools true false
22
Exponentiation System Nats exp Nats 2 3 ? - graph (exp) = { ( (x,y), z ) Nats 2 Nats | z = x y }
23
Exponentiation System Nats exp Nats 2 3 8 2 1 graph (exp) = { ( (x,y), z ) Nats 2 Nats | z = x y }
24
Nats exp Nats 2 3 9 1 2 Exponentiation System graph (exp) = { ( (x,y), z ) Nats 2 Nats | z = x y }
25
Bools Block Diagram This cannot be written easily using .
26
Bools Block Diagram true false
27
Bools Block Diagram true false true false
28
Bools Block Diagram true false true false
29
Bools Block Diagram true false true false
30
Bools Or System domain ( ) = Bools 2 range ( ) = Bools graph ( ) = { ( (x,y), z ) Bools 2 Bools | z = x y }
31
Bools Or System domain ( ) = Bools 2 range ( ) = Bools graph ( ) = { ( (x,y), z ) Bools 2 Bools | z = x y } -
32
Block Diagrams with Forks
33
true false
34
Block Diagrams with Forks true false f
35
Block Diagrams with Forks true false f f t
36
Block Diagrams with Forks true false f f t true
37
Joins are illegal
38
true false
39
Joins are illegal true false f t ?
40
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 < y }
41
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 < y } 1 2 1 2 quotient remainder Nats 0
42
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 < y } Nats 0
43
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 < y } Nats 0
44
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 < y } Nats 0
45
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 < y } Nats 0
46
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 < y } Nats 0
47
Many possible implementations Nats 1 2 1 2 C program for Euclid’s 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 < y } Nats 0
48
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 < y }
49
Block diagrams can hide outputs divide 22 11 zerocheck zerocheck: Nats 0 Bools such that x Nats, zerocheck (x) x = 0. Nats Bools
50
Block Diagrams can hide outputs divide 22 11 zerocheck zerocheck: Nats 0 Bools such that x Nats, zerocheck (x) x = 0. Nats Bools
51
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 ).
52
Hidden inputs are illegal, for now
53
true ?
54
Constant functions have no inputs true
55
Constant function true
56
Cycles are illegal, for now divide
57
Block Diagrams -are nested, directed, acyclic graphs -allow compositional, hierarchical system description
58
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.