Fachgebiet Rechnersysteme Technische Universität Verification Technology Darmstadt 1. Boolean Algebra Fachgebiet Rechnersysteme 1 1. Boolean Algebra 3 1.1 Boolean algebra basics 1. Boolean Algebra 1.1 Boolean Algebra Basics Verification Technology AND-operation (conjunction) Gate representation Content Content a b a b 1.1 Boolean algebra basics (recap) a German (old) 0 0 0 b 1.2 Reasoning about Boolean expressions 0 1 0 1 0 0 a & & IEEE- IEEE 1 1 1 b standard a 0-dominance US-standard b (old) 1. Boolean Algebra 2 1. Boolean Algebra 4 1.1 Boolean algebra basics The problem of logic verification: Show that two circuits OR-operation (disjunction) Gate representation implement the same boolean function, or: Show that a circuit correctly implements a specification a a b a b a b a b German (old) b 0 0 0 g a 0 1 1 =1 1 b a IEEE- 1 0 1 standard b 1 1 1 a a & a g a 1-dominance US-standard & & b b (old) & b
Fachgebiet Rechnersysteme Technische Universität Verification Technology Darmstadt 1. Boolean Algebra 5 1. Boolean Algebra 7 1.1 Boolean algebra basics 1.1 Boolean algebra basics NOT-operation (negation, complement) More operations: (E)XOR (exclusive-or, unequal, addition modulo 2) Gate representation Gate representation Gate representation a D fi iti Definition: a b b a b b a b b German (old) a a a 0 1 a b a b German (old) b IEEE- a 1 0 0 0 1 0 Standard 0 1 1 a a =1 1 IEEE IEEE- 1 0 1 b standard a 1 1 0 US-standard (old) a US-standard b (old) 1. Boolean Algebra 6 1. Boolean Algebra 8 1.1 Boolean algebra basics 1.1 Boolean algebra basics More notations ... NAND Gate representation a b a • b a & b a b a + b a | b a a b (a b) German (old) b a a a' 0 0 1 0 1 1 a & 1 0 1 Propositional Calculus IEEE- b b standard standard 1 1 0 a US-standard b (old)
Fachgebiet Rechnersysteme Technische Universität Verification Technology Darmstadt 1. Boolean Algebra 9 1. Boolean Algebra 11 1.1 Boolean algebra basics 1.1 Boolean algebra basics Boolean functions NOR — Traffic-light checker: inputs: r red, g green, e Gate representation yellow r e g p? r e g p? a 0 0 0 a b (a b) German (old) b 0 0 1 0 0 1 0 1 0 0 1 0 0 1 1 2 3 = 8 cases 1 a 1 0 0 1 0 0 IEEE- 1 0 1 b b standard standard 1 1 0 1 1 0 1 1 1 a US-standard r b Traffic- (old) e p Light Checker g 1. Boolean Algebra 10 1. Boolean Algebra 12 1.1 Boolean algebra basics 1.1 Boolean algebra basics r, e, g are Boolean variables Implikation : B = {0, 1} is the set of Boolean values a b a b A Boolean function in n variables is a mapping pp g Equivalence (equality): F: B n B a b a b a b Such a function models a circuit with n inputs — The equivalence-function equals one iff the arguments have equal values and one output, in the example we have B 3 B — The exor-function equals one iff the arguments have unequal values — Generally: a b = (a b) r Traffic- e p Light Checker g
Fachgebiet Rechnersysteme Technische Universität Verification Technology Darmstadt 1. Boolean Algebra 13 1. Boolean Algebra 15 1.1 Boolean algebra basics 1.1 Boolean algebra basics 3 2 1 0 2 2 2 2 Representation of Boolean Product-terms (products, cubes) are conjunctions of functions by means of x x x x 0 f literals 3 2 1 function tables and Veitch- 0 0 0 0 0 0 Each variable occurs only once (Karnaugh-) maps 0 0 0 1 0 0 0 1 1 1 1 1 x x 3 — Example: x•y•z or xyz for short 2 0 0 1 0 0 0 0 1 1 0 Special case: Minterm (product-term in all variables) 3 0 1 1 0 4 0 1 0 0 1 12 Sum-terms (clauses) are disjunctions of literals 0 4 8 0 1 0 1 1 5 1 Special case: Maxterm (sum-term in all variables) 6 0 1 1 0 0 1 1 1 1 5 13 x 0 9 7 0 1 1 1 1 1 0 0 0 0 1 0 8 0 1 7 7 15 15 1 0 0 1 1 0 0 1 1 1 3 3 11 11 9 x 1 1 0 1 0 0 10 0 0 0 0 1 0 1 1 0 2 6 14 10 11 1 1 0 0 1 12 1 1 0 1 1 x 2 13 1 1 1 0 0 14 1 1 1 1 1 15 1. Boolean Algebra 14 1. Boolean Algebra 16 1.1 Boolean algebra basics 1.1 Boolean algebra basics Boolean terms are textual representations of Boolean A Sum-of-Products (sop) (also called a disjunctive normal functions, e.g., form, dnf) is a disjunction of products — Example: cyz + d + ax a a b b c c + c c a a (e (e + b) b) The syntax of Boolean terms: A Product-of-Sums (pos) (also called a conjunctive normal The constants 0 and 1 are Boolean terms form, cnf) is a conjunction of sums Literals (variables and complemented variables) are — Example: (c + x + b)(s + x)(a + x) Boolean terms, for instance, a and a If a and b are Boolean terms then so are (a b), (a + b), a
Fachgebiet Rechnersysteme Technische Universität Verification Technology Darmstadt 1. Boolean Algebra 17 1. Boolean Algebra 19 1.1 Boolean algebra basics 1.1 Boolean algebra basics The Rules of Boolean Algebra: (T11) x + x•y = x + y (T11') x•(x + y) = x•y Absorption (T12) x + x•y = x (T12) x + x•y = x (T12 ) x•(x + y) = x (T12') x•(x + y) = x (T1) x + 0 = x (T1') x • 1 = x Identity Very important for the simplification of terms (T2) x + 1 = 1 (T2') x • 0 = 0 0/1-Element and circuits! Example: (T3) x + x = x (T3') x • x = x Idempotence x 1 x (T4) x x (T4) x = x (T4 ) 1 0 (T4') 1 = 0 Involution Involution 1 1 x & (T5) x + x = 1 (T5') x • x = 0 Complement y y 1. Boolean Algebra 18 1. Boolean Algebra 20 1.1 Boolean algebra basics 1.1 Boolean algebra basics Boole's Expansion Theorem (1849) also attributed to Shannon (T6) x + y = y + x (T6') x • y = y • x Commutativity (T7) (x + y) + z = x + (y + z) = x + y + z (T7) (x + y) + z = x + (y + z) = x + y + z Associativity Associativity (T7') (x • y) • z = x • (y • z) = x • y • z (T8) x•y + x•z = x•(y + z) Distributivity (T8') (x + y)•(x + z) = x + y•z (T9) (x + y) = x • y (T9') (x • y) = x + y De Morgan's Law Law (T10) (x 1 +...+ x n )= x 1 •...• x n Generalized De Morgan's (T10') (x 1 •...• x n )= x 1 +...+ x n Law
Fachgebiet Rechnersysteme Technische Universität Verification Technology Darmstadt 1. Boolean Algebra 21 1. Boolean Algebra 23 1.1 Boolean algebra basics 1.1 Boolean algebra basics x x x x f 1 2 3 4 Idea: Decompose a — Illustration in the Veitch-diagram: function into two sub- 0 0 0 0 0 0 0 0 1 1 functions which do not b 0 0 1 0 0 0 0 1 0 0 depend on some variable depend on some variable, e.g., x 1 0 0 1 1 0 1 f a 1 1 f(0, x , x , x ) 0 1 0 0 1 2 3 4 0 1 0 1 1 1 1 1 f a a 0 1 1 0 0 0 1 1 1 1 f 1 0 0 0 0 c 1 0 0 1 1 1 0 0 1 1 1 0 1 0 0 f c a b ab 1 0 1 1 0 f(1, x , x , x ) 1 1 0 0 1 2 3 4 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 1. Boolean Algebra 22 1. Boolean Algebra 24 1.1 Boolean algebra basics 1.1 Boolean algebra basics Expansion Theorem: a Boolean Function f can be — Illustration in the Veitch-diagram: decomposed according to a variable x as follows b f x f x f x x 1 f a 1 1 f , f are called the Positive (1-) and Negative (0-) 1 1 1 f a a x x Cofactors of f with respect to x The cofactors can be calculated by replacing the f c variable x by the constants 0 and 1, respectively y , p y f c a b ab f a f a f a a
Fachgebiet Rechnersysteme Technische Universität Verification Technology Darmstadt 1. Boolean Algebra 25 1. Boolean Algebra 27 1.1 Boolean algebra basics 1.1 Boolean algebra basics — Circuit realization: The cofactors are calculated by replacing a by 0 and 1, respectively plus simplifications: b b 1 1 c c f & & a f b a 1 f a 1 f a 1 1 1 1 1 1 f f 1 1 1 1 f a 1 1 1 f a c a a & & f a b f a f f c c a a a a f c a b ab f = c + a b + a b , f a f a f f = c + 1 b + 1 b = c + b , a a a f = c + 0 b + 0 b = c + b , a f = a (c + b ) + a (c + b ) 1. Boolean Algebra 26 1. Boolean Algebra 28 1.1 Boolean algebra basics 1.1 Boolean algebra basics The cofactors are calculated by replacing a by 0 and 1, The circuit used above is called a 2:1-Multiplexor respectively: b Symbol: f & a a 1 f a & 1 1 1 f a 0 1 1 1 1 f a a & f a & b b 1 f c a a x x f = c + a b + ab, Depending on x, the output is either equal f = c + 1 b + 1b = c + b, a to a or equal to b f = c + 0 b + 0b = c + b , a f = a (c + b ) + a (c + b )
Recommend
More recommend