360 likes | 511 Views
x. x. x. f. 1. 2. 3. 0. 0. 0. 0. 0. 0. 1. 0. 0. 1. 0. 0. 0. 1. 1. 0. 1. 0. 0. 0. 1. 0. 1. 1. 1. 1. 0. 1. 1. 1. 1. 1. Boolean Functions. mapping. truth table. x. x. x. f. 1. 2. 3. =. Ú. Ú. f. (. x. ,. x. ,. x. ). x. x. x. x. x. x. x.
E N D
x x x f 1 2 3 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 Boolean Functions mapping truth table
x x x f 1 2 3 = Ú Ú f ( x , x , x ) x x x x x x x x x 1 2 3 1 2 3 1 2 3 1 2 3 = Ú f ( x , x , x ) x x x x 1 2 3 1 3 2 3 Representation of Boolean Functions Example: 0 0 0 0 Disjunctive Normal Form (canonical): 0 0 1 0 0 1 0 0 0 1 1 1 OR of AND terms (not unique): 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1
x x x f 1 2 3 = Ú Ú × Ú Ú × f ( x , x , x ) ( x x x ) ( x x x ) 1 2 3 1 2 3 1 2 3 Ú Ú × Ú Ú × ( x x x ) ( x x x ) 1 2 3 1 2 3 Ú Ú ( x x x ) 1 2 3 = × Ú f ( x , x , x ) ( x ) ( x x ) 1 2 3 3 1 2 Representation of Boolean Functions Example: Conjunctive Normal Form (canonical): 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 AND of OR terms (not unique): 1 1 0 0 1 1 1 1
x x x f 1 2 3 + (only positive literals; represent x as x 1 ) = + + f ( x , x , x ) x x x x x x x 1 2 3 1 3 2 3 1 2 3 Representation of Boolean Functions Example: XOR of AND terms: 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 unique? 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1
Form variables, express a boolean function as the sum of some combination of the product terms: m 2 1 | x , x , x | x x , x x , , x x | | x x x K K K - 1 2 1 2 1 3 1 1 2 3 n n n m 2 2 distinct sums, Representation of Boolean Functions XOR of AND terms: representation is unique. Dependence on variables is explicit.
Logic Circuits Building Block: Logic Gate
feed-forwarddevice Logic Circuits Building Block: Logic Gate
0 0 0 1 1 0 1 1 Logic Circuits Common Gate: “AND” gate 0 0 0 1
Logic Circuits Common Gate: “OR” gate 0 0 0 0 1 1 1 0 1 1 1 1
Logic Circuits Common Gate: “XOR” gate 0 0 0 0 1 1 1 0 1 1 1 0
0 1 Logic Circuits Common Gate: “NOT” gate 1 0
inputs outputs network of logic gates Logic Circuits
inputs outputs network of logic gates gate Logic Circuits
x c y z x z y s Logic Circuits Example
Logic Circuits Example 0 0 1 1 1 1 0 1 1 1 0
Logic Circuits Measures • Size: number of gates. • Depth: longest path from an input to an output. x c y z x z y s size = 5, depth = 3
x x x 1 2 3 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Logic Circuits Why study logic circuits? It all seems simple enough.... Construct XOR from AND/OR/NOT gates. 0 1 3 variables 1 (draw circuit) 0 1 0 0 1
... ... Logic Circuits Construct XOR from AND/OR/NOT gates. x x x x 1 2 3 4 1 0 0 0 1 0 1 0 0 1 4 variables 0 0 1 0 1 (draw circuit) 0 0 0 1 1 1 1 1 0 1 1 0 1 1 1 1 1 0 1 1 0 1 1 1 1 ... ...
Models of Computation Example: Logic Gates
Models of Computation Example: Linear Threshold Gates
Models of Computation Example: Comparators and Balancers min(x, y) x max(x, y) y x y
= + + + f ab de ace dcb Models of Computation Example: Switching Circuits b a c S D d e
Switching Circuits (Shannon, 1938)
Finite State Machine input current state A B next state D F Systems with states analyzed. Example: Encoding FSMs
gates gates ≤ optimal size ≤ Logic Circuits Construct XOR from AND/OR/NOT gates. XOR of nvariables construction: lower bound: For n > 4, optimal size is unknown.
w x 1 1 w x 2 ... 2 w 0 w x n n Linear Threshold Gates
Linear Threshold Gates Useful Model?