Boolean Algebra & Logic Circuits Management Information Systems (MIS) K.S. School of Business Management Samit Tibrewala
The premise of Boolean Algebra Binary Definition
Boolean Algebra to Logic Gates Logic circuits are built from components called logic gates. The logic gates correspond to Boolean operations + , * , ’ OR + AND * NOT ’
AND A Logic Gate: A*B Truth Table: B A B A*B 1 A B Series Circuit: A*B
OR A Logic Gate: A+B Truth Table: B A B A+B 1 A Parallel Circuit: B 1 A Parallel Circuit: B A+B
NOT Logic Gate: A A’ Truth Table: a A 1 Single-throw Double-pole (also called an inverter) A A’ Truth Table: a A 1 Single-throw Double-pole Switch: A A’
N-Input Gates Because + and * are binary operations, they can be cascaded together to OR or AND multiple inputs. A A B A+B+C ABC B C A A B A+B+C ABC B C C
Binary Digits – With Input Gates It is sometimes useful to think of the logic gates processing n-bits at a time. 1101100101 1101110111 0100110111 10001111 00001100 00111100 110001 001110
Logic Circuits and Boolean Expressions All logic circuits are equivalent to Boolean expressions and any boolean expression can be rendered as a logic circuit. A y=aB+Bc abc B C A B C y aBc y Ab y=abc+aBc+Ab
Let’s practice… x+y (x+y)y y What is the output of the following circuit? x+y (x+y)y y
Some more practice… x x y x y y Find the output of the following circuit: x x y x y y
The other way round ! x+y x x+y Prepare a circuit diagram for the following: __ x+y x x+y
The other way round ! (x+y)x x+y (x+y)x x+y Prepare a circuit diagram for the following: ______ (x+y)x x+y (x+y)x x+y
Truth Tables A mathematical table used in logic. Combines all possible values of logical variables as input, applies the function and generates and output. Number of combinations = 2n (n = # of variables)
Truth Tables – Hungry / Thirsty Problem
Some more gates NAND: “If either A or B is NOT true, then Q is true”
Some more gates NOR: “If either A or B is true, then Q is false”
Some more gates XOR: “If only one of A or B is true, then Q is true” A ⊕ B
Some more gates XNOR: “If both A and B are either true or false, then Q is true” X ʘ Y
Universality of NAND gates
Universality of NOR gates
Primary Laws of Boolean Algebra Commutative Laws Associative Laws Distributive Laws
Commutative Laws
Associative Laws
Distributive Laws
Distributive Laws – Truth Table C B+C A(B+C) AB AC AB+AC 1
DeMorgan’s Laws Very useful in digital circuit design. It allows ANDs to be exchanged by ORs by using inverters. This theorem can be extended to ANY number of variables.
DeMorgan’s Theorem – Truth Table X Y X.Y (X.Y)' X' Y' X' + Y' 1
DeMorgan’s Laws – n Variables We can extend DeMorgan’s laws to 3 variables by applying the laws for two variables. (X + Y + Z ) = (X + (Y + Z )) - by associative law = X ×(Y + Z ) - by DeMorgan’s law = X ×(Y ×Z ) - by DeMorgan’s law = X ×Y ×Z - by associative law (X×Y×Z) = (X×(Y×Z )) - by associative law = X + (Y×Z ) - by DeMorgan’s law = X + (Y + Z ) - by DeMorgan’s law = X + Y + Z - by associative law Generalization to n variables. (X1 + X2 + × × × + Xn) = X 1×X 2 × × × X n (X1×X2 × × × Xn) = X 1 + X 2 + × × × + X n
The Duality Principle The dual of a Boolean expression is obtained by interchanging all ANDs and ORs, and all 0s and 1s. Example: The dual of A+(B×C )+0 is A×(B+C )×1 The duality principle states that if E1 and E2 are Boolean expressions then E1= E2 dual (E1)=dual (E2) where dual(E) is the dual of E. For example, A+(B×C )+0 = (B ×C )+D A×(B+C )×1 = (B +C )×D
The Consensus Theorem Theorem. XY + X Z +YZ = XY + X Z Proof. XY + X Z +YZ = XY + X Z + YZ(X + X ) = XY + X Z + XYZ + X YZ = XY + XYZ + X Z + X YZ = XY(1 + Z ) + X Z(1 + Y ) = XY + X Z Example. (A + B )(A + C ) = AA + AC + AB + BC = AC + AB + BC = AC + AB Dual. (X + Y )(X + Z )(Y + Z ) = (X + Y )(X + Z )
Complement of a Function Method 1. Apply DeMorgan’s Theorem repeatedly. (X(Y Z + YZ )) = X + (Y Z + YZ ) = X + (Y Z )(YZ ) = X + (Y + Z )(Y + Z ) Method 2. Complement literals and take dual (X (Y Z + YZ ))= dual (X (YZ + Y Z ))
Thank You Questions?