Вы находитесь на странице: 1из 16

Chapter 2 : Boolean Algebra and Logic Gates

By Dr. Ridha Jemal


Electrical Engineering Department College of Engineering King Saud University 1431-1432
2.1. Basic Definitions 2.2. Basic Theorems and Properties of Boolean Algebra 2.3. Boolean Function Examples 2.4. Canonical and Standard Forms 2.5. Example of three variables functions 2.6. SOP and POS Conversion 2.7. SOP and POS Forms
Dr. Ridha Jemal EE208: Logic Design 1431-1432 Chapter 2 page: 1

Basic Definitions
The Boolean Algebra may be defined with a set of elements, a set of operators and a number of postulates to deduce rules, theorems and properties of the system. The most common postulates used to formulate various algebraic structure are:

o Closure: Given a binary operators * and a set of elements S. S is closed to the binary operator (*) if for any a, b S we obtain a unique c by the operation a*b =c o 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 o Commutative law: A binary operator * on a set S is said to be commutative whenever : x*y = y*z for all x,y S o Identity Element: A set S is said to have an identity element with respect to a binary operation * if there exists an element e S with the property: e*x = x*e = x for every S o Inverse: A set S having the identity element e with respect to a binary operator * is said to have an inverse, for every S, there exists an element y S such that x*y = e o Distributive law: If * and : are two binary operators on a set S, * is said to be distributive over whenever : x*(y z) = (x*y) (x*z)
Dr. Ridha Jemal EE208: Logic Design 1431-1432 Chapter 2 page: 2

Basic Definitions
Boolean Algebra is an algebraic structure defined by a set of elements B, with two operators + and , provided that the following postulates are satisfied:

o Closure with respect to the operator + Closure with respect to the operator

o An identity element with respect to + designated by 0


An identity element with respect to designated by 1 o Commutative with respect to + : x+y=y+x

Commutative with respect to : x y=y x


o Distributive over + : x (y+z) = (x y)+(x z) o + Distributive over : x + (y z) = (x + y) (x + z)

o For every element x B, there exists an element x B called the complement of x such that x+x=1 and x x=0
Dr. Ridha Jemal EE208: Logic Design 1431-1432 Chapter 2 page: 3

Basic Theorems and Properties of Boolean Algebra


Note that every law has two expressions, (a) and (b). This is known as duality. These are obtained by changing every AND(.) to OR(+), every OR(+) to AND(.) and all 1's to 0's and vice-versa. It has become conventional to drop the . (AND symbol) i.e. A.B is written as AB.

o Identity Law 1(a): 1(b):


o Commutative Law 2(a): 2(b):

X+X =X X.X = X
X+Y= Y+X X.Y =Y.X

o Associative Law 3(a): 3(b):


o Distributive Law 4(a): 4(b): o Rule 4(a):
Dr. Ridha Jemal

X+(Y+Z) = (X+Y)+Z X.(Y.Z) =(X.Y).Z


X.(Y+Z) = XY +XZ X+(Y.Z) =(X+Y).(X+Z)
Chapter 2 page: 4

(X)=X
EE208: Logic Design 1431-1432

Basic Theorems and Properties of Boolean Algebra


Theorems
o Theorem 1(a): 1(b): o Theorem 2(a): 2(b): o Theorem 3(a): 3(b): o Theorem 4(a): 4(b): X+1=1 X.0=0 (X+Y) = XY (X.Y) =X+Y X+XY = X X.(X+Y) =X X+XY = X+Y X.(X+Y) = XY

By duality DeMorgan Absorption

Dr. Ridha Jemal

EE208: Logic Design 1431-1432

Chapter 2 page: 5

Boolean Functions Examples


1. Prove the Rule Rx Algebraically: A + AB = A+B A+ AB = = = = = A.1 + AB A.(1 + B) +AB A .1+ AB + AB A. + B(A + A) A+B

2. Simplify the function: F(A,B,C) = (A + B + C)(A + BC) using only rules and Theorems

F(A,B,C) = = = =
Dr. Ridha Jemal

(A + B + C)(A + BC) AA + ABC + BA + BBC + CA + CBC A(1+ BC + B + C) + BC + BCC A + BC


EE208: Logic Design 1431-1432 Chapter 2 page: 6

Boolean Functions Examples


A Boolean function described by an algebraic expression consists of binary variables, the constants 0 and 1, and the logic operation symbols. F1=x+xy

F2=xyz + xyz + xy Simplify the Boolean functions:


1. 2. 3. 4. x(x+y) x+xy (x+y)(x+y ) xy+ xz +yz

Find the complement of the functions F1 and F2:


1. 2.
Dr. Ridha Jemal

F1= (xyz +xyz) F2= x(yz+yz)


EE208: Logic Design 1431-1432 Chapter 2 page: 7

Canonical and Standard Forms


Minterms and Maxterms
Definition: a minterm of n variables is a product of the variables in which each appears exactly once in true or complemented form. e.g.: minterms of 3 variables: Each minterm = 1 for only one combination of values of the variables, = 0 otherwise Definition: a maxterm of n variables is a sum of the variables in which each appears exactly once in true or complemented form. e.g.: maxterm of 3 variables: Each maxterm = 0 for only one combination of values of the variables, = 1 otherwise
Dr. Ridha Jemal EE208: Logic Design 1431-1432 Chapter 2 page: 8

Canonical and Standard Forms


Minterms and Maxterms
Consider 2 binary variables, there are 4 possible configurations: xy, xy, xy and xy Each of these four AND terms is called minterm or standard product. F(a,b,c) = mi
Where mi represent all minterms for which F(a,bc,)=1

In a similar manner, n variables can be combined to form 2n minterms represented by a symbol mj Similarly, n variables forming 2n possible combinations of an OR terms called Maxterms or standard sums represented by Mj

F(a,b,c) = Mj
Where Mj represent all minterms for which F(a,bc,)=0
Dr. Ridha Jemal EE208: Logic Design 1431-1432 Chapter 2 page: 9

Canonical and Standard Forms


SOP and POS Forms
All possible minterms and maxterms are obtained from the truth table: Every function can be written as a sum of minterms, which is a special kind of Sum Of Products form (SOP). The sum of minterms form for any function is unique A Boolean function can be expressed algebraically from a given truth table by forming a minterm for each combination of the variables that produces 1 in the function, and then taking the OR of all those terms.

Every function can be written as a unique product of maxterms (POS).


If you have a truth table for a function, you can write a product of maxterms (POS) expression by picking out the rows of the table where the function output is 0. (Be careful if youre writing the actual literals!)
Dr. Ridha Jemal EE208: Logic Design 1431-1432 Chapter 2 page: 10

Canonical and Standard Forms


Minterms and Maxterms for Three variables
Minterms x y z Term Design. Maxterms Term Desig.

0 0 0 0 1 1 1 1
Dr. Ridha Jemal

0 0 1 1 0 0 1 1

0 1 0 1 0 1 0 1

xyz xyz xyz xyz xyz xyz xyz xyz

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
Chapter 2 page: 11

EE208: Logic Design 1431-1432

Canonical and Standard Forms


If you have a truth table for a function, you can write a sum of minterms expression just by picking out the rows of the table where the function output is 1. Express F1 and F2 as a SOP form and its equivalent form using Maxterms.
x y z F1 F2

0 0 0 0 1 1 1 1
Dr. Ridha Jemal

0 0 1 1 0 0 1 1

0 1 0 1 0 1 0 1

0 1 0 0 1 0 0 1

0 0 0 1 0 1 1 1

F1=m1+m4+m7 = m(1,4,7) F2=m3+m5+m6+m7 = m(3,5,6,7)

F1=M0.M2.M3.M5.M6
F2=M0.M1.M2.M4
Chapter 2 page: 12

EE208: Logic Design 1431-1432

Example of three variables functions


Express F and F as a SOP form.
x
0 0 0 0

y
0 0 1 1

z
0 1 0 1

F
1 1 1 1

F
0 0 0 0

F=m0+m1+m2+m3+m6

= m(0,1,2,3,6)

F=m4+m5+m7 = m(4,5,7)

1
1 1 1

0
0 1 1

0
1 0 1

0
0 1 0

1
1 0 1

F contains all the minterms not in F.


Dr. Ridha Jemal EE208: Logic Design 1431-1432 Chapter 2 page: 13

Example of three variables functions


Express F and F as a POS form (using Maxterms). If you have a truth table for a function, you can write a product of maxterms (POS) expression by picking out the rows of the table where the function output is 0. (Be careful if youre writing the actual literals!)
x
0 0 0 0 1 1 1 1
Dr. Ridha Jemal

y
0 0 1 1 0 0 1 1

z
0 1 0 1 0 1 0 1

F
1 1 1 1 0 0 1 0

F
0 0 0 0 1 1 0 1

F = M4+M5+M7 = M(4,5,7) F = M0+M1+M2+M3+M6

= M (0,1,2,3,6)

F contains all the maxterms not in F.


Chapter 2 page: 14

EE208: Logic Design 1431-1432

SOP and POS Conversion


We can convert a sum of minterms to a product of maxterms Consider F(A,B,C)= m(1,3,5,7) And F(A,B,C) = m(0,2,4,6) = m0 + m2+m4+m6 Complementing (F) = (m0 + m2+m4+m6) So F = m0. m2. m4 . m6 = M0.M2.M4.M6 = M (0,2,4,6) In general, just replace the minterms with maxterms, using maxterm numbers that dont appear in the sum of minterms: F(A,B,C)= m(1,3,5,7) = M (0,2,4,6) The same thing works for converting from a product of maxterms to a sum of

minterms.
Dr. Ridha Jemal EE208: Logic Design 1431-1432 Chapter 2 page: 15

SOP and POS Forms


Sum of Minterms
Sometimes, its convenient to express a Boolean function in its sum-of-minterms form. If the function is not in this form, it can be made by first expanding the expression into a sum of AND terms. Each term is then inspected to see if it contains all the variables. If it misses one or more, it is ANDed with an expression such as x+x, where x is the missing variable.

Example: Express F=A+BC as a sum of minterms or a SOP.


Then first term A is missing 2 variables B and C A= A(B+B) = AB + AB AB = AB(C+C) = ABC + ABC AB =AB(C+C) =ABC+ABC Then second term BC is missing one variables A BC = BC(A+A) =BCA+BCA F(A,B,C)=ABC + ABC+ABC+ABC+ABC= m(1,4,5,6,7)
Dr. Ridha Jemal EE208: Logic Design 1431-1432 Chapter 2 page: 16

Вам также может понравиться