UNIT 2 BOOLEN LGEBR Spring 2
2 Contents Introduction Basic operations Boolean expressions and truth tables Theorems and laws Basic theorems Commutative, associative, and distributive laws Simplification theorems Multiplying out and factoring DeMorgan s laws Reading Unit 2
Introduction 3 Boolean algebra Is the basic mathematics for logic design of digital systems Differs from ordinary algebra in the values, operations, and laws History George Boole developed Boolean algebra in 847 and used it to solve problems in mathematical logic British mathematician and philosopher Claude Shannon first applied Boolean algebra to the design of switching circuits in 939 merican electrical engineer and mathematician Master's thesis (2 years-old) In this unit, you will learn how to Use a truth table Manipulate basic operations and apply laws of Boolean algebra Relate Boolean expressions to basic logic gates
Switching Circuit & Boolean Variables 4 switching circuit has one or more inputs and one or more outputs that take on discrete values (two-value in general) Inputs X X 2 X m... Switching circuit... Z Z 2 Z n Outputs We usually use a Boolean variable, such as X, Y, Z, to represent an input or output of a switching circuit Usually take on only two different values / for High/Low or True/False or Yes/No Just symbols, NO numeric values two-value Boolean variable is also called a switching variable Boolean algebra differs from ordinary algebra in values, operations, laws
Boolean algebra differs from ordinary algebra in values, operations, laws 5 Basic Operations NOT, ND, OR
Operation -- Logic NOT 6 Complement = Inverse = Negate = NOT (' ; ; ~; ) '=, '= Symbol X X' Basic switch = switch open = switch closed NOT gate Inverter Inputs Truth table X X Outputs X' X = switch closed X = switch open Input combinations Output values
Operation -- Logic ND 7 ND (; ) =, =, =, = Symbol B ND gate Switch (in series) C= B B 2 T = B Truth table B C = B Omit T = 2 open T = 2 closed If one input is output is Switch closed and switch B closed
Operation -- Logic OR 8 OR (+; ) + =, + =, + =, + = Symbol B + C = + B OR gate Switch (in parallel) Truth table B C = +B If one input is output is B 2 T = 2 open T = 2 closed T = + B Switch closed or switch B closed
9 Boolean Expressions and Truth Tables Boolean expression Logic gates Truth table
Boolean Expressions vs. Logic Gates C D Boolean expression is formed by basic operations on variables or constants, e.g., the simplest one:,, X, Y' Realize a Boolean expression by a circuit of logic gates Perform operations in order: Parentheses NOT ND OR e.g., B' + C e.g., [(C + D)]' + BE + B (C + D) B' B E B' C (C + D). B' 2. B' 3. B' + C + (B' + C). C + D 2. (C + D) 3. [(C + D)]' 4. BE 5. [(C + D)]' + BE [(C + D)]' BE + [(C + D)]' + BE
B Boolean Expressions vs. Truth Tables truth table specifies the output values of a Boolean expression for all possible combinations of input values Check the equivalence between two expressions e.g., B'+ C = ( + C)(B'+ C) B' Expressions show the condition to make output == B' C + B C B B B + C (B' + C) +C B +C (+C)(B +C) n variables 2 n rows One function has different expressions
Example: F = ' + B 2 Boolean expression F = ' + B B ' + Logic gates F = ' + B Truth table B +B
Boolean algebra differs from ordinary algebra in values, operations, laws 3 Theorems and Laws
Basic Theorems (/3) 4 Operations with and X + = X X = X X + = X = e.g., (B' + D)E + = The variable X can be substituted by any expression X = X X X + = X = X + =
Basic Theorems (2/3) 5 Idempotent laws X + X = X X X = X X X = X + X = X X X X = X X X = X
Basic Theorems (3/3) 6 Involution law (X')' = X Laws of complementarity X + X' = X X' = e.g., (B' + D)(B' + D)' = X X' = X X' X + X' = = X X' =
7 Commutative/ssociative Laws B B Commutative laws for ND and OR XY = YX X + Y = Y + X ssociative laws for ND and OR (XY)Z = X(YZ) = XYZ (X + Y) + Z = X + (Y + Z) = X + Y + Z e.g., 2-input gates multiple-input gates + C C (B)C = BC = B C + = B + ( + B) + C = + B + C C
8 Distributive Laws (/2) Ordinary distributive law X(Y + Z) = XY + XZ Second distributive law (Important!) X + YZ = (X + Y)(X + Z) Only valid for Boolean algebra Proof?
Distributive Laws (2/2) 9 Prove a Boolean theorem/law by:. Truth table X + YZ = (X + Y)(X + Z) =? 2. Basic theorems (X + Y)(X + Z) X Y Z YZ X+YZ X+Y X+Z (X+Y)(X+Z) = X(X + Z) + Y(X + Z) = XX + XZ + YX + YZ = X + XZ + XY + YZ = X + XZ + XY + YZ = X(+Z+Y) + YZ = X + YZ = X + YZ
Simplification Theorems 2 Useful simplification theorems XY + XY' = X X + XY = X (X+Y') Y = XY Proof: X + XY = X + XY = X(+Y) = X = X X(X+Y) = XX + XY = X + XY = X XY' + Y = Y + XY' = (Y+X)(Y+Y') = (Y+X) = Y + X Use switches duality (X+Y)(X+Y') = X X(X+Y) = X XY' + Y = X + Y Y Y X 2 Y' = X If switch Y open switch Y' closed
Simplification Examples 2. ('+B) = B B + F = B F 2. Z = [ + B'C + D + EF][ + B'C+ (D + EF)' ] = [ + B'C + D + EF][ + B'C + (D + EF)' ] = [ X + Y ][ X + Y' ] = X = + B'C 3. Z = (B + C)(B'D + C'E')+(B + C)' = (B + C)(B'D + C'E')+(B + C)' ll roads lead to Rome = X Y + X' = XY + X' = XY + X'(+Y) = XY + X' + X'Y = (X+X')Y + X' = Y + X' = B'D + C'E'+(B + C)'
22 Multiplying Out Use the ordinary distributive law X(Y + Z) = XY + XZ to multiply out an expression to obtain a sum-of-products form e.g., B' + CD'E + C'E' (V) + B' + C + D'E (V) ( + B)CD + EF (X) SOP: Sum of products of only single variables
Example: Multiplying Out (+BC)(+D+E) 23. Multiply out completely and then eliminate redundant terms (+BC)(+D+E) = +D+E+BC+BCD+BCE = (+D+E+BC)+BCD+BCE = +BCD+BCE 2. Or, apply 2 nd distributive law first: (X+Y)(X+Z)=X+YZ (+BC)(+D+E) = +BC(D+E) = +BCD+BCE 2 nd distributed law saves your time!
24 Factoring Use the second distributive law X + YZ = (X + Y)(X + Z) to factor an expression to obtain a product-of-sums form e.g., ( + B')(C + D + E)( + C' + E') (V) ( + B)(C + D + E)F (V) B'C(D' + E) (V) ( + B)(C + D) + EF (X) POS: Products of sums of only single variables
25 Example: Factoring. Factor + B'CD + B'CD = ( + B')( + CD) = ( + B')( + C)( + D) 2. Factor B'+ C'D B' + C'D = (B' + C')(B' + D) = ( + C')(B' + C')( + D)(B' + D) 3. DIY: Factor C'D + C'E' + G'H Iteratively apply 2 nd distributed law
SOP vs. Logic Gates 26 Realize SOPs by two-level circuits (ND-OR) B' + CD'E + C'E' + B' + C + D'E ND OR ND OR B' C D' E + D' E B' C + C' E'
POS vs. Logic Gates 27 Realize POSs by two-level circuits (OR-ND) ( + B')(C + D + E)( + C' + E') B'C(D' + E) OR ND OR ND B' C D' E + + D' E + B' C C' E' +
DeMorgan s Laws 28 Complement a Boolean expression by DeMorgan s laws (X + Y)' = X'Y' (XY)' = X' + Y' Proof: By truth table Generalize to n variables: (X +X 2 + +X n )' = X 'X 2 '... X n ' One-step rule: [f(x,x 2,,x n,,,+,)]' = f(x ', x 2 ',,x n ',,,,+) x x'; + ; X Y X' Y' X+Y (X+Y) X Y XY (XY) X +Y (X X 2 X n )' = X '+X 2 '+...+ X n '
Example: Complementing (B' + C)D' + E 29. Iteratively apply DeMorgan s laws: [(B' + C)D' + E]' = [(B' + C)D' ]'E' = [(B' + C)'+D]E' = [(B')'C'+D]E' = [('+B)C'+D]E' 2. Or, use one-step rule: [(B' + C)D' + E]' = [((( B')+C) D')+ E]' = ((('+B) C') +D ) E' NOT is applied only to single variables
3 Duality Dual: [f(x,x 2,,x n,,,+,)] D = f(x,x 2,,x n,,,,+) + ; Cf. DeMorgan s laws: [f(x,x 2,,x n,,,+,)]' = f(x ',x 2 ',,x n ',,,,+) x x'; + ; Find the dual of an expression: Complement the entire expression Complement each individual variable e.g., (XYZ ) D = X + Y + Z + e.g., (B' + C) D =? (B' + C)' = ('+B)C' (B' + C) D = (+B')C pplication: F = G F D = G D