 # Chapter 2 Boolean Algebra and Logic Gates

## Presentation on theme: "Chapter 2 Boolean Algebra and Logic Gates"— Presentation transcript:

Chapter 2 Boolean Algebra and Logic Gates
2-1 Basic Definitions 2-2 Axiomatic Definition of Boolean Algebra 2-3 Basic Theorems and Properties of Boolean Algebra 2-4 Boolean Function

Chapter 2 Boolean Algebra and Logic Gates
2-5 Canonical and Standard Forms 2-6 Other Logic Operations 2-7 Digital Logic Gates 2-8 Integrated Circuits

2-1 Basic Definitions 1. Closure. 2. Associative Law
The most common postulates used to formulate various algebraic structures are: A binary operator * on a set S is said to be commutative whenever x*y =y*x for all x,y∈S 1. Closure. A set S is closed with respect to a binary operator if, for every pair of elements of S, the binary operator specifies a rule for obtaining a unique element of S. 2. Associative Law A binary operator * on a set S is said to be associative whenever (x*y)*z =x*(y*z) for all x,y,z∈S 3. Commutative Law

2-1 Basic Definitions 4. Identity Element 5. Inverse
If ﹡ and · are two binary operator on a set S, ﹡is said to be distributive over whenever x ﹡(y · z)=(x ﹡y) ·(x ﹡z) A set S is said to have an identity element with respect to a binary operator * on S if there exists an element e ∈S with property x*e = e*x = x for every x∈S 5. Inverse A set S having an identity element with respect to a binary operator * is said to have an inverse whenever, for every x∈S, there exists an element y ∈S such that x*y = e for every x∈S 6. Distributive Law

2-2 Axiomatic Definition of Boolean Algebra
Boolean algebra is an algebraic structure defined by a set of elements, B, together with two binary operators, + and · , provided that the following (Huntington) postulates are satisfied: 1. (a)Closure with respect to operator +. (b) Closure with respect to operator · .

2-2 Axiomatic Definition of Boolean Algebra
2. (a)An identity element with respect to +, designated by 0: x+0=0+x=x. (b) An identity element with respect to ·, designated by 0: x ·1 = 1·x = x. 3. (a) Commutative with respect to +: x+y = y+x (b) Commutative with respect to · : x · y = y · x

2-2 Axiomatic Definition of Boolean Algebra
4. (a) · is distributive over +: x · (y+z) =(x · y) + (x · z). (b) + is distributive over · : x + (y · z) =(x + y) · (x + z). For every element x ∈B, there exists x' ∈B, such that (a) x+x'=1 and x · x'=0 The distributive law of + over · , i.e., x+(y · z) = (x +y) · (x +z), is valid for Boolean algebra, but not for ordinary algebra. 6. There exists at least two elements x,y ∈B such that x≠y.

2-2 Axiomatic Definition of Boolean Algebra
The differences between Boolean algebra and ordinary algebra: Huntington postulates do not include the associative law. However, this law can be derived (for both operators) from the other postulates. The distributive law of + over · , i.e., x+(y · z) = (x +y) · (x +z), is valid for Boolean algebra, but not for ordinary algebra.

2-2 Axiomatic Definition of Boolean Algebra
The differences between Boolean algebra and ordinary algebra: Boolean algebra does not have addictive or multiplicative inverse; therefore, there are no subtraction or division operations. Postulate 5 defines an operator called complement that is not available in ordinary algebra.

2-2 Axiomatic Definition of Boolean Algebra
The differences between Boolean algebra and ordinary algebra: 5. Boolean algebra deals with the as yet undefined set of elements, B, but in the two-valued Boolean algebra, B is defined as a set with only two elements, 0 and 1.

2-2 Axiomatic Definition of Boolean Algebra
These rules are exactly the same as the AND, OR and NOT operations. Two-Valued Boolean Algebra The rule of a Two-Valued Boolean Algebra is shown in the following table: x y x · y 1 x y x +y 1 x x' 1

2-2 Axiomatic Definition of Boolean Algebra
Huntington postulates are valid for the set of B={ 0, 1 } and the two binary operators( + and · ). 1. Closure is obvious since the result of each operation is either 1 or 0 and 1, 0∈B 2. Two identity elements, 0 for + and 1 for · 3. The commutative laws are obvious from the symmetry of the binary operator tables.

2-2 Axiomatic Definition of Boolean Algebra
4. The distributive law of + over · and · over + can be shown to hold true. 5. About the complement, it is obvious that (a) x+x'=1 (b) x · x'=0 6. Postulate 6 is satisfied because the two-valued Boolean algebra has two distinct elements.

2-3 Basic Theorems and Properties of Boolean Algebra
 Duality： Every algebraic expression deducible from the postulate of Boolean algebra remains valid if the operator and identity elements are interchanged. replace “.” with “+”, and “+” with “.”; replace “0” with “1”, and “1” with “0”；

2-3 Basic Theorems and Properties of Boolean Algebra
Theorem 1(a): x + x = x Theorem 1(b): x · x = x Theorem 2(a): x + 1 = 1 Theorem 2(b): x · 0 = 0 Theorem 3: (x')' = x Theorem 6(a): x +xy = x Theorem 6(b): x(x + y) = x

2-3 Basic Theorems and Properties of Boolean Algebra
 Operator Precedence： The operator precedence for evaluating Boolean expressions is : 1. parentheses 2. NOT 3. AND 4. OR

2-4 Boolean Function Logic Function F = f（A、B、C、...） Output Variable
Input Variables Logic Function is a tool to describe the relationship between a logic circuit’s output(s) and its input(s): F = f（A、B、C、...） Two possible values：Logic 0 and Logic 1.Logic 0 and Logic 1 do not present actual numbers but present two states that are contradictory to each other

2-4 Boolean Function C on，either A or B or both A and B are on F on
C off F off A B C F Off On 1 C on，A、B off F off

2-4 Boolean Function Boolean Expression: F= ABC+ABC+ABC A B C F
 Find out all the terms where the outputs are “1” An algebraic equation to describe the relationship between a logic circuits’ output(s) and its inputs.  Write the AND term for each case where the output is a “1”  Write the sum-of-products expression for the output F= ABC+ABC+ABC

Logic Circuit F= ABC+ABC+ABC Waveform 1 1 1
The sums are implemented with OR gates and the products are implemented with AND gates. Waveform 1 1 1

2-5 Canonical and Standard Forms Also called standard product
Minterms and Maxterms An n-variable minterm is a normal product term with n literals. There are 2n such product terms which can be written as m i . Also called standard product Also called standard sum An n-variable maxterm is a normal sum term with n literals. There are 2n such sum terms which can be written as M i p108 i denotes the decimal equivalent of the binary number of the miniterm designated. A literal is a variable or the complement of a variable.

2-5 Canonical and Standard Forms
Example: There are 23（8）minterms in a 3-variable expression Minterms Binary code Decimal number mi m2 m3 m4 m5 m6 m7 010 011 100 101 110 111 2 3 4 5 6 7 000 001 p108 1 m0 m1

2-5 Canonical and Standard Forms
Minterms and Maxterms for a 3-Variable logic function X Y Z Minterm Maxterm Term Designation 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 X’•Y’•Z’ X’•Y’•Z X’•Y•Z’ X’•Y•Z X•Y’•Z’ X•Y’•Z X•Y•Z’ X•Y•Z m0 m1 m2 m3 m4 m5 m6 m7 X+Y+Z X+Y+Z’ X+Y’+Z X+Y’+Z’ X’+Y+Z X’+Y+Z’ X’+Y’+Z X’+Y’+Z’ M0 M1 M2 M3 M4 M5 M6 M7

2-5 Canonical and Standard Forms
Example: from the following truth table, determine the sum of minterms expression. x y z Function f1 Function f2 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1 f1=x'y'z+ xy'z'+xyz =m1+m4 +m7 f1=(x+y+z) (x+y'+z) (x+y'+z') (x'+y+z') (x'+y'+z) =M0 M2 M3 M5 M6 f2= (x+y+z) (x+y+z') (x+y'+z) (x'+y+z) =M0 M1 M2 M4 f2=x'yz+ xy'z+xyz' +xyz =m3+m5+m6 +m7

2-5 Canonical and Standard Forms
Sum of minterms The procedure of converting the Boolean function into Sum of minterms Step1: multiply each nonstandard product term by a term made up of the sum of a missing variable and its complement. This results in two product terms. As you know, you can multiply anything by 1 without changing its value. Step2: repeat step1 until all resulting product terms contain all variables in the domain to standard form, the number of product terms is doubled for each missing variable.

2-5 Canonical and Standard Forms
Sum of minterms Example: express the Boolean function F=A+B'C in sum of minterms. A=A(B+B')=AB+AB'=AB(C+C') + AB'(C+C') =ABC+ABC' + AB'C+ AB' C' B'C= B'C(A+A')= AB'C+ A'B'C F=A+B'C = ABC + ABC' + AB'C + AB'C' + A'B'C =m1 + m4 + m5 + m6 + m7 In short, F(A, B, C) =(1,4,5,6,7)

2-5 Canonical and Standard Forms
product of maxterms The procedure of converting the Boolean function into product of maxterms form Step1: bring the Boolean function into a form of OR terms. This may be done by using the distributive law, x+yz=(x+y)(x+z). Step2: any missing variable x in each OR term is Ored with xx'. Then repeat step1 until all resulting sum terms contain all variables in the domain to standard form, the number of sum terms is doubled for each missing variable.

2-5 Canonical and Standard Forms
Product of maxterms Example: express the Boolean function F= xy+x'z in product of maxterms. F= xy + x'z = ( xy + x' ) ( xy + z ) = ( x + x' ) ( y + x' ) ( x + z ) ( y + z ) = ( x' + y ) ( x + z ) ( y + z ) distributive law x+yz=(x+y)(x+z) ( x' + y ) = x' + y + zz' = ( x' + y + z ) ( x' + y + z' ) ( x + z ) = x + z + yy' = ( x + z + y ) ( x + z + y' ) ( y + z ) = y + z + xx' = ( y + z + x ) ( y + z + x' ) F= ( x + y + z ) ( x + y' + z ) ( x' + y + z ) ( x' + y + z' ) =M0 M2 M4 M5= ∏ (0,2,4,5)

2-5 Canonical and Standard Forms
Conversion between Canonical Forms Based on the correspondence between the truth table and canonical form, we can easily create an algebraic representation of a logic function from its truth table. Boolean function expressed as a sum of minterms or product of maxterms

2-5 Canonical and Standard Forms
Standard Sum-of-Product (minimum term) Expression F(A、B、C、D) All the product terms in the expression are expressed by minimum terms. Example： F(A、B、C、D) F(A、B、C、D)

2-5 Canonical and Standard Forms “AND―OR or Sum-of-Product”
 Five Expressions F(A、B、C) “AND―OR or Sum-of-Product” “OR―AND” “NAND―NAND” “NOR―NOR” “AND―OR―NOT”  Conversions between Different Expressions

2-6 Other Logic Operations
There are 22n functions for n binary function. For two variables, the number of possible Boolean functions is 16. Truth Table for the 16 Functions of Two Binary Variables. x y F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 0 0 0 1 1 0 1 1

2-6 Other Logic Operations
Boolean function Operator symbol Name comments F0 = 0 F1 = xy F2 = xy' F3 = x F4 = x'y F5 = y F6=xy'+x'y F7=x+y x • y x / y y / x x  y x+y Null AND Inhibition Transfer Exclusive-OR OR Binary constant 0 x and y x, but not y x y, but not x y x or y, but not both x or y

2-6 Other Logic Operations
Boolean function Operator symbol Name comments F8 =(x+y)' F9=xy+x'y' F10 = y' F11 = x+y' F12 = x' F13 = x'+y F14 =(xy)' F15 = 1 x y (x  y)' y' x y x' NOR Equivalence complement Implication NAND Identity Not-OR x equals y Not y If y, then x Not x If x, then y Not-AND Binary constant 1 U U

2-7 Digital Logic Gates Basic Logic Operations AND Operation
OR Operation NOR Operation

2-7 Digital Logic Gates A B F 0 0 0 1 1 1 1 A B F 0 0 0 1 1 1 1
XOR Operation A B F 1 Logic Expression: F=AB = AB+AB Logic Symbol XNOR Operation A B F 1 Logic Expression: F=A⊙B = AB Logic Symbol

A B F 0 0 0 1 1 0 1 1 1 F= A  B = AB F off off off on on off off
AND OPERATION The AND operation is performed by the AND gate, whose output will be 1 only for the case when all inputs are 1; for all other cases the output will be 0. Logic Relationship Truth Table Switch A Switch B F A B F off off off on on off off on on on 1 Boolean Expression F= A  B = AB AND gate symbol

Sometimes we also use “∨”、“∪”
The output of OR operation is a logic 1 for every combination of input levels where one or more inputs are 1. OR OPERATION Truth Table Logic Symbol A B F 1 1 1 Boolean Expression F= A + B Sometimes we also use “∨”、“∪” N Inputs： F= A + B N

The output of the NOT operation is opposite to its input.
Truth Table Boolean Expression F= A Logic Symbol A F 1 1 Combinational Logic Operation NOR Operation NAND Operation F1=AB F2=A+B

Positive Logic（AND Gate） Negative Logic（OR Gate）
Positive Logic and Negative Logic Logic 0 is used to represent higher voltage value and Logic 1 is used to represent lower voltage value . Voltage Levels Positive Logic（AND Gate） Negative Logic（OR Gate） Logic 1 is used to represent higher voltage value and Logic 0 is used to represent lower voltage value . A B F 1 A B F A B F 1 VL VL VL VL VH VL VH VL VL VH VH VH Relationship between Positive Logic And Negative Logic Equivalent Logic Symbols  Adding bubbles on input and output lines that do not have bubbles and removing bubbles that are already there. Positive OR = Negative AND Positive AND = Negative OR  Changing the operation symbol from AND to OR, or from OR to AND, or NOR to NAND, or NAND to NOR. Positive NOR = Negative NAND Positive NAND = Negative NOR

2-8 Integrated Circuits Basic Logic Operations
Small-scale integration (SSI) : Several independent gates Medium-scale integration(MSI): gates Large-scale integration (LSI) : Thousands of gates Very Large-scale integration (VLSI) : Hundred of Thousands of gates

High component density It is considered as standard.
2-8 Integrated Circuits Digital Logic Family TTL transistor-transistor logic High component density It is considered as standard. ECL emitter-coupled logic Low power consumption High speed MOS metal-oxide semiconductor CMOS complementary MOS

2-8 Integrated Circuits Computer-Aided Design (CAD)
The design of VLSI circuits containing millions of transistors is a formidable task. Systems of this complexity are usually impossible to develop and verify without the assistance of computer-aided design tools. An important development in the design of digital system is the use of a hardware description language (HDL).