 Download Download Presentation Boolean Functions

# Boolean Functions

Télécharger la présentation ## Boolean Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
##### Presentation Transcript

1. 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

2. 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

3. 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

4. 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

5. 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.

6. Logic Circuits Building Block: Logic Gate

7. feed-forwarddevice Logic Circuits Building Block: Logic Gate

8. 0 0 0 1 1 0 1 1 Logic Circuits Common Gate: “AND” gate 0 0 0 1

9. Logic Circuits Common Gate: “OR” gate 0 0 0 0 1 1 1 0 1 1 1 1

10. Logic Circuits Common Gate: “XOR” gate 0 0 0 0 1 1 1 0 1 1 1 0

11. 0 1 Logic Circuits Common Gate: “NOT” gate 1 0

12. inputs outputs network of logic gates Logic Circuits

13. inputs outputs network of logic gates gate Logic Circuits

14. x c y z x z y s Logic Circuits Example

15. Logic Circuits Example 0 0 1 1 1 1 0 1 1 1 0

16. 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

17. 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

18. ... ... 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 ... ...

19. Models of Computation Example: Logic Gates

20. Models of Computation Example: Linear Threshold Gates

21. Models of Computation Example: Comparators and Balancers min(x, y) x max(x, y) y x y

22. = + + + f ab de ace dcb Models of Computation Example: Switching Circuits b a c S D d e

23. Switching Circuits (Shannon, 1938)

24. Finite State Machine input current state A B next state D F Systems with states analyzed. Example: Encoding FSMs

25. 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.

26. w x 1 1 w x 2 ... 2 w 0 w x n n Linear Threshold Gates

27. Linear Threshold Gates Useful Model?