EE208Chap2-2.0

Embed Size (px)

Citation preview

  • 7/28/2019 EE208Chap2-2.0

    1/16

    Chapter 2 : Boolean Algebra and Logic Gates

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

    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

  • 7/28/2019 EE208Chap2-2.0

    2/16

    Basic Definitions

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

    The Boolean Algebra may be defined with a set of elements, a set of operators and a

    number ofpostulates to deduce rules, theorems andproperties of the system. Themost common postulates used to formulate various algebraic structure are:

    o Closure: Given a binary operators * and a set of elements S. S is closed tothe binary operator (*) if for any a, b S we obtain a unique c by theoperation a*b =c

    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 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 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)

    o Identity Element: A set S is said to have an identity element with respectto a binary operation * if there exists an element e S with the property:

    e*x = x*e = x for every So 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

  • 7/28/2019 EE208Chap2-2.0

    3/16

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

    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 Commutative with respect to + : x+y=y+x

    Commutative with respect to : x y=y x

    o An identity element with respect to + designated by 0

    An identity element with respect to designated by 1

    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

    Basic Definitions

  • 7/28/2019 EE208Chap2-2.0

    4/16

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

    o Identity Law 1(a): X+X =X

    1(b): X.X = X

    o Rule 4(a): (X)=X

    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(.) andall 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 Associative Law 3(a): X+(Y+Z) = (X+Y)+Z

    3(b): X.(Y.Z) =(X.Y).Z

    o Distributive Law 4(a): X.(Y+Z) = XY +XZ

    4(b): X+(Y.Z) =(X+Y).(X+Z)

    o Commutative Law 2(a): X+Y= Y+X

    2(b): X.Y =Y.X

  • 7/28/2019 EE208Chap2-2.0

    5/16

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

    o

    Theorem 2(a): (X+Y) = XY DeMorgan2(b): (X.Y) =X+Y

    o Theorem 3(a): X+XY = X Absorption

    3(b): X.(X+Y) =X

    o Theorem 4(a): X+XY = X+Y

    4(b): X.(X+Y) = XY

    Basic Theorems and Properties of Boolean Algebra

    o Theorem 1(a): X+1=1

    1(b): X.0=0 By duality

    Theorems

  • 7/28/2019 EE208Chap2-2.0

    6/16

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

    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

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

    F(A,B,C) = (A + B + C)(A + BC)= AA + ABC + BA + BBC + CA + CBC

    = A(1+ BC + B + C) + BC + BCC

    = A + BC

    Boolean Functions Examples

  • 7/28/2019 EE208Chap2-2.0

    7/16

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

    A Boolean function described by an algebraic expression consists of

    binary variables, the constants 0 and 1, and the logic operation symbols.

    F2=xyz + xyz + xy

    Simplify the Boolean functions:

    1. x(x+y)

    2. x+xy

    3. (x+y)(x+y)

    4. xy+ xz +yz

    Find the complement of the functions F1 and F2:

    1. F1= (xyz +xyz)

    2. F2= x(yz+yz)

    Boolean Functions Examples

    F1=x+xy

  • 7/28/2019 EE208Chap2-2.0

    8/16

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

    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 ofvalues of the variables,= 0 otherwise

    Canonical and Standard Forms

    Definition: a maxterm of n variables is a sum of the variables

    in which each appears exactlyonce in true or complemented form.

    e.g.: maxterm of 3 variables:

    Each maxterm = 0for only one combination of values of the variables,

    = 1 otherwise

  • 7/28/2019 EE208Chap2-2.0

    9/16

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

    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.

    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 ORterms called Maxterms or standard sums represented by Mj

    Canonical and Standard Forms

    F(a,b,c) = miWhere mi represent all minterms for which F(a,bc,)=1

    F(a,b,c) = MjWhere Mj represent all minterms for which F(a,bc,)=0

  • 7/28/2019 EE208Chap2-2.0

    10/16

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

    SOP and POS Forms

    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.

    Canonical and Standard Forms

    All possible minterms and maxterms are obtained from the truth table:

    Every function can be written as a sum ofminterms, which is a special

    kind ofSum Of Products form (SOP).

    The sum ofminterms form for any function is unique

    Every function can be written as a unique product ofmaxterms (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 ifyoure writing the actual literals!)

  • 7/28/2019 EE208Chap2-2.0

    11/16

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

    Minterms Maxterms

    x y z Term Design. Term Desig.

    0 0 0 xyz m0 x+y+z M0

    0 0 1 xyz m1 x+y+z M1

    0 1 0 xyz m2 x+y+z M2

    0 1 1 xyz m3 x+y+z M3

    1 0 0 xyz m4 x+y+z M4

    1 0 1 xyz m5 x+y+z M5

    1 1 0 xyz m6 x+y+z M6

    1 1 1 xyz m7 x+y+z M7

    Canonical and Standard Forms

    Minterms and Maxterms for Three variables

  • 7/28/2019 EE208Chap2-2.0

    12/16

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

    x y z F1 F2

    0 0 0 0 0

    0 0 1 1 0

    0 1 0 0 0

    0 1 1 0 1

    1 0 0 1 0

    1 0 1 0 1

    1 1 0 0 1

    1 1 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

    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.

  • 7/28/2019 EE208Chap2-2.0

    13/16

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

    x y z F F

    0 0 0 1 0

    0 0 1 1 0

    0 1 0 1 0

    0 1 1 1 0

    1 0 0 0 1

    1 0 1 0 1

    1 1 0 1 0

    1 1 1 0 1

    F=m0+m1+m2+m3+m6

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

    F=m4+m5+m7

    =m(4,5,7)

    Example of three variables functions

    F contains all the minterms not in F.

    Express F and F as a SOP form.

  • 7/28/2019 EE208Chap2-2.0

    14/16

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

    x y z F F

    0 0 0 1 0

    0 0 1 1 0

    0 1 0 1 0

    0 1 1 1 0

    1 0 0 0 1

    1 0 1 0 1

    1 1 0 1 0

    1 1 1 0 1

    F = M4+M5+M7

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

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

    Express F and F as a POS form (using Maxterms).

    If you have a truth table for a function, you can write a product ofmaxterms (POS) expression by picking out the rows of the table where the

    function output is 0. (Be careful ifyoure writing the actual literals!)

    F contains all the maxterms not in F.

    Example of three variables functions

  • 7/28/2019 EE208Chap2-2.0

    15/16

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

    We can convert a sum ofminterms to a product ofmaxterms

    Consider F(A,B,C)=m(1,3,5,7)

    And F(A,B,C) = m(0,2,4,6)

    = m0 + m2+m4+m6Complementing (F) = (m0 + m2+m4+m6)

    So F = m0. m2. m4 . m6

    = M0.M2.M4.M6=M (0,2,4,6)

    SOP and POS Conversion

    In general, just replace the minterms with maxterms, using maxterm numbers

    that dont appear in the sum ofminterms:

    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.

  • 7/28/2019 EE208Chap2-2.0

    16/16

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

    Sum of Minterms

    Sometimes, its convenient to express a Boolean function in its sum-of-mintermsform. If the function is not in this form, it can be made by first expanding the

    expression into a sum ofAND 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+BCas a sum of minterms or a SOP.

    Then first term A is missing 2 variables B and C

    A=A(B+B) = A B +AB

    AB =AB(C+C)

    = ABC +ABC

    AB =AB(C+C)=ABC+ABC

    Then second term BCis missing one variables A

    BC = BC(A+A) =BCA+BCA

    SOP and POS Forms

    F(A,B,C)=ABC + ABC+ABC+ABC+ABC= m(1,4,5,6,7)