eee122a boolean algebra and logic gates

Upload: sayan-kumar-khan

Post on 02-Jun-2018

230 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    1/38

    DIGITAL CIRCUITDIGITAL CIRCUIT

    DESIGNDESIGN

    EEE122 AEEE122 ARef. Morris MANO & Michael D. CILETTIRef. Morris MANO & Michael D. CILETTI

    DIGITAL DESIGN 4DIGITAL DESIGN 4thth editionedition

    Fatih University- Faculty of Engineering- Electric and Electronic Dept.

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    2/38

    Chapter 2Chapter 2

    Boolean Algebra andBoolean Algebra and

    Logic GatesLogic Gates

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    3/38

    Postulates & AxiomsPostulates & AxiomsPostulates form the basic assumptions from which itis possible to deduce the rules, theorems, and

    properties of the system

    DefinitionDefinitionBoolean algebra is an algebraic structure defined by a set of

    elements, , together with two binary operators + and . Providedthat the following postulates are satisfied

    1. x + y B x y B Closure2. x + 0 = x x 1 = x Identity

    3. x + y = y + x x y = y x Commutativity

    4. x(y + z) = xy + xz x + yz = (x + y)(x + z) Distributivity

    5. x + x = 1 x x = 0 Complement6. At least 2 elements: x,y B such that x y Cardinality

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    4/38

    Postulate 1: ClosurePostulate 1: Closure

    A Boolean algebra is a closedA Boolean algebra is a closed

    algebraic system containing a setalgebraic system containing a set of two or more elements and twoof two or more elements and two

    operatorsoperators and

    AND Operator OR Operator

    (Dot/Multiplication) (Plus/Addition)

    ++++

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    5/38

    Postulate 2: Identity PropertyPostulate 2: Identity Property

    There exists unique elements 1 (one)There exists unique elements 1 (one)

    and 0 (zero) such that:and 0 (zero) such that:

    where 0 is the identity element for the OR operator

    and 1 is the identity element for the AND operator.

    (a) x+0=x

    (b) x.1=x

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    6/38

    Postulate 3: CommutativePostulate 3: Commutative

    For every x and y in set

    (a) x+y=y+x(b) x.y=y.x

    Postulate 4: AssociativePostulate 4: Associative

    For every x , y and Z

    (a) x+(y+z)=(x+y)+z

    (b) x.(y.z) =(x.y).z

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    7/38

    Postulate 5: Distributive PropertyPostulate 5: Distributive Property

    (a) x.(y+z)=x.y+x.z

    (b) x+y.z =(x+y).(x+z)

    For every x, y and Z in set

    Postulate 6: Complement PropertyPostulate 6: Complement Property

    For every x in there exists a unique element x such that:x+x=1 x.x =0

    Properties of 0 and 1 elementsProperties of 0 and 1 elements

    1=01=0x.1=xx.1=xx+1=1x+1=1

    0=10=1x.0=0x.0=0x+0=xx+0=x

    ComplementComplementANDANDOROR

    1=01=0x.1=xx.1=xx+1=1x+1=1

    0=10=1x.0=0x.0=0x+0=xx+0=x

    ComplementComplementANDANDOROR

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    8/38

    Duality PropertyDuality PropertyIf a Boolean expression is true, the dual ofthe expression is also true. To find the dual,

    Replace all ORs with ANDs, all ANDs withORs, all ones with zeros and all zeros withones.

    In equation form this can expressed as:

    If f1=F(x1,x2,x3,,0,1,+,)the duality of f1

    is F(x1,x2,x3,.,1,0, ,+)

    Find the dual of: x+yz =(x+y).(x+z)

    Sol. The dual is x.(y+z)=x.y+x.z

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    9/38

    Basic BooleanBasic BooleanTheoremsTheorems

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    10/38

    Theorem 1:Theorem 1:

    ( )( )( )

    1 P2b

    P6a

    P5a

    0 P6b

    P2a

    a a a a

    a a a a

    a aa

    a

    a

    + = += + +

    = +

    = +

    =

    a a a+ =

    ( )( )( )

    ( )

    1 P2b

    P6a

    T1b

    P5b

    0 P6b

    P2a

    aa aa

    aa a a

    a a a

    a aa

    a

    a

    == +

    = +

    = +

    = +

    =

    a.a=a

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    11/38

    Theorem 2: Null elements forTheorem 2: Null elements for

    OR and AND operatorsOR and AND operators

    1 1a + =

    Theorem 3:Theorem 3:

    a.0=0

    a= a

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    12/38

    Theorem 4: AbsorptionTheorem 4: Absorption

    ( )( )

    ( )

    ( )

    1 2

    1 5

    6

    1

    6

    a ab a ab P b

    a b P b

    a b b b P a

    a b b T a

    a P a

    + = +

    = +

    = + +

    = +

    =

    a ab a+ = ( )a a b a+ =

    Theorem 5: AbsorptionTheorem 5: Absorption

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    13/38

    Theorem 6Theorem 6

    ab abc ab ac+ = +

    ab ab a+ = ( )

    ( )a b a b a+ + =

    Theorem 7Theorem 7

    ( ) ( ) ( ) ( )a b a b c a b a c+ + + = + +

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    14/38

    Theorem 8:Theorem 8: DeMorganDeMorganss theoremtheorem

    ab ac bc ab ac+ + = +

    a b a b

    a b a b

    + =

    = +

    Theorem 9: ConsensusTheorem 9: Consensus

    ( ) ( ) ( ) ( ) ( )a b a c b c a b a c+ + + + + = + + +

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    15/38

    Logic SimplificationLogic Simplification

    SimplifySimplify

    ( )( )( )

    F ab ab ab

    a a b ab

    b ab b a b b

    b a

    = + +

    = + +

    = + = + +

    = +

    1

    1

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    16/38

    Boolean FunctionsBoolean Functions

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    17/38

    Boolean FunctionsBoolean FunctionsDefineDefine ( )1 2 3, , , , nf a a a aK

    Where:f = Boolean function with value of 0 or 1

    a1, a2, a3, . = Boolean variables (0 or 1)

    Logical functions can be represented in twoLogical functions can be represented in two

    ways:ways: A finite, but nonA finite, but non--uniqueunique Boolean expressionBoolean expression..

    A uniqueA unique andand finitefinite truth tablestruth tables

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    18/38

    Boolean FunctionsBoolean Functions

    Example of Boolean function or expression:Example of Boolean function or expression:

    f(x,y,z) = (x + yf(x,y,z) = (x + y)z + x)z + x

    Notations:Notations:

    ff is the name of the function.is the name of the function.

    (x,y,z)(x,y,z) are theare the input variablesinput variables, each representing 1 or 0., each representing 1 or 0.Listing the inputs is optional, but sometimes helpful.Listing the inputs is optional, but sometimes helpful.

    AA literalliteral is any occurrence of an input variable or itsis any occurrence of an input variable or its

    complement. The function above has four literals:complement. The function above has four literals: x, yx, y, z, z,, xx..

    Precedence is important,Precedence is important,

    NOT has the highest precedence, followed by AND, andNOT has the highest precedence, followed by AND, and

    then OR.then OR.

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    19/38

    Boolean FunctionsBoolean FunctionsNotes:With n variables there are 2n input combinations.

    1. Recall each function can have two outputs 0 or 1, so thereare different functional combinations22

    n

    00

    11

    F1F1

    11

    00

    F2F2

    00

    00

    F0F0

    11

    00

    a0a0

    11

    11

    F3F3

    0 1 0 2 30, , , 1oF F a F a F = = = =

    ForFor n=3, 2n=3, 233=8=8 input combinput combinationinationssandand 2288=256 output=256 output combcombinationinationss

    For n= 2 there are 4 possiblefunctons

    Possible functions with n= 1.there are 4 possible functons

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    20/38

    Truth tablesTruth tables AA truth tabletruth table shows all possible inputs and outputs of a function.shows all possible inputs and outputs of a function.

    Remember that each input variable represents either 1 or 0.Remember that each input variable represents either 1 or 0.

    Because there are only a finite number of values (1 and 0),Because there are only a finite number of values (1 and 0),

    truth tables themselves are finite.truth tables themselves are finite.

    A function with n variables has 2A function with n variables has 2nnpossible combinations ofpossible combinations of

    inputs.inputs.

    Inputs are listed in binary orderInputs are listed in binary orderin this example, from 000 toin this example, from 000 to

    111.111.

    F A B AC A C = + +

    11

    00

    11

    00

    11

    00

    11

    00

    CC

    11

    11

    00

    00

    00

    00

    00

    00

    ABAB

    00

    00

    00

    00

    11

    00

    11

    00

    11001111

    11111111

    00000011

    11110011

    11

    11

    00

    00

    BB

    110000

    000000

    110000

    000000

    FFAA

    11

    00

    11

    00

    11

    00

    11

    00

    CC

    11

    11

    00

    00

    00

    00

    00

    00

    ABAB

    00

    00

    00

    00

    11

    00

    11

    00

    11001111

    11111111

    00000011

    11110011

    11

    11

    00

    00

    BB

    110000

    000000

    110000

    000000

    FFAA A CAC

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    21/38

    Implementation of Boolean function with GatesImplementation of Boolean function with Gates

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    22/38

    Complement of a functionComplement of a function

    The complement of a function always outputs 0The complement of a function always outputs 0

    whewhenn the original function outputthe original function outputss 1, and 11, and 1 whewhenn

    the original producethe original producess..

    In a truth table, we can just exchange 0s and 1sIn a truth table, we can just exchange 0s and 1s

    in the output column(s)in the output column(s)

    f(x,y,z) = x(yz + yz)

    x y z f(x,y,z)

    0 0 0 00 0 1 0

    0 1 0 00 1 1 01 0 0 11 0 1 01 1 0 01 1 1 1

    x y z f(x,y,z)

    0 0 0 10 0 1 1

    0 1 0 10 1 1 11 0 0 01 0 1 11 1 0 1

    1 1 1 0

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    23/38

    Complementing a function algebraicallyComplementing a function algebraically DeMorganDeMorganss law canlaw can bebe useusedd toto findfind the complementsthe complements of functionsof functions

    You can also take the dual of the function, and then complementYou can also take the dual of the function, and then complement

    each literaleach literal If f(x,y,z) =If f(x,y,z) = x(yx(yzz ++ yzyz))

    the dual of f isthe dual of f is x + (yx + (y + z+ z)(y + z))(y + z)

    then complementing each literal givesthen complementing each literal gives xx + (y + z)(y+ (y + z)(y + z+ z))

    so fso f(x,y,z) = x(x,y,z) = x + (y + z)(y+ (y + z)(y + z+ z))

    f(x,y,z) = x(yz + yz)

    f(x,y,z) = ( x(yz + yz) ) [ complement both sides ]

    = x + (yz + yz) [ because (xy) = x + y ]= x + (yz) (yz) [ because (x + y) = x y ]= x + (y + z)(y + z) [ because (xy) = x + y, twice]

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    24/38

    Canonical and StandardCanonical and StandardFormsForms

    Sum of Products (SOP)Sum of Products (SOP)

    Product of Sums (POS)Product of Sums (POS)

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    25/38

    SOPSOP & POS& POS

    SOPSOP: are Boolean: are Boolean functionsfunctions thatthat formed by SUMMINGformed by SUMMING ANDedANDedterms.terms.

    Example:Example: ( ), , ,F A B C D ABC BD AC D= + +

    literals

    (product terms)

    POSPOS: are Boolean: are Boolean functionsfunctions thatthat formed by taking theformed by taking the PRODUCT ofPRODUCT of

    ORedORed terms.terms.Example:Example:

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    26/38

    Canonical SOP FormCanonical SOP Form MintermMinterm::

    A product term which contains exactly one complemented orA product term which contains exactly one complemented oruncomplementeduncomplemented form of each variable.form of each variable.

    Canonical SOP formCanonical SOP form

    A function which is a sum of onlyA function which is a sum of only mintermsminterms

    Decimal

    No

    a b c minterms Notation

    0 0 0 0abc

    m0

    1 0 0 1abc

    m1

    2 0 1 0abc

    m2

    3 0 1 1abc

    m3

    4 1 0 0abc

    m4

    5 1 0 1abc

    m5

    6 1 1 0abc

    m6

    7 1 1 1 abc m7

    Minterms are equalto 1 when true.

    is the decimal equivalent of binary code (a,b,c)

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    27/38

    Canonical SOP FormCanonical SOP Form:Example:Example

    00111111

    00001111

    11110011

    1100001100111100

    00001100

    11110000

    00000000

    FFCCBBAA

    ( ) ( ), , 1, 4,5F A B C m=

    ( ), ,F A B C ABC ABC ABC = + +

    1m A BC =

    4m A B C =

    5m A B C =

    Truth Table Find F

    All 0s in Truth Table

    This can be expressed as: m1+m4+m5

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    28/38

    ThreeThreeVariableVariable

    MaxtermMaxterm

    a b c Maxterms Notation

    0 0 0 a b c+ + M00 0 1 a b c+ + M1

    0 1 0 a b c+ + M2

    0 1 1 a b c+ + M3

    1 0 0 a b c+ + M4

    1 0 1 a b c+ + M5

    1 1 0 a b c+ + M6

    1 1 1 a b c+ + M7

    Maxterms areequal to 0when true

    MaxtermsMaxterms

    A sum term which contains exactly one complemented orA sum term which contains exactly one complemented or

    uncomplementeduncomplemented form of eachform of each of inputof input variable.variable.

    Canonical POS formCanonical POS form A function which is a product of onlyA function which is a product of only maxtermsmaxterms

    Canonical POS FormCanonical POS Form

    C i lC i l POS E lPOS E l

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    29/38

    CanonicalCanonical POS ExamplePOS Example

    11111111

    00001111

    11110011

    1100001111111100

    00001100

    00110000

    11000000

    FFCCBBAA

    1M A B C= + +

    Truth Table

    ( ) ( ), , 1, 2,6F A B C M =

    ( )( )( )F A B C A B C A B C = + + + + + +

    2M A B C= + +

    M6=A+B+C

    F=M1.M6.M2

    Or shortly as:

    Find F

    1s in the truth table

    GeneralGeneral:: Maxterms are

    complements of minterms

    C i SOP f i f

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    30/38

    Example:Example: Expand the following function to canonical SOP formExpand the following function to canonical SOP form

    ( ) ( ) ( ), ,F A B C A B C C ABC BC A A= + + + +

    ( ), ,F A B C ABC ABC ABC ABC ABC = + + + +

    ( ), ,F A B C A B A B C B C = + +

    11111111

    11001111

    00110011

    0000011

    11111100

    00001100

    11110000

    11000000

    FFCCBBAA

    Converting SOP function from nonConverting SOP function from non--

    canonical to canonical formcanonical to canonical form

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    31/38

    Converting POS function from nonConverting POS function from non--

    canonical to canonical formcanonical to canonical form RecallRecall

    So, to convert functionSo, to convert function

    1.1. SumSum thethe POS literal with missing term(s) in thePOS literal with missing term(s) in theform ofform of

    2.2. ExpandExpand thethe functionfunction

    ( )( ) and 0a bc a b a c aa+ = + + =

    a a

    ( ) ( ) ( ) ( ), ,F A B C A B A B C B C = + + + +

    ( ) ( )( )( ), ,F A B C A B CC A B C AA B C = + + + + + +

    ( )( )( )( ) ( )F A B C A B C A B C A B C A B C = + + + + + + + + + +

    EX:EX: Expand the followingExpand the followingfunction to canonical POSfunction to canonical POS

    0011111100001111

    11110011

    0000011

    11111100

    11001100

    00110000

    00000000

    FFCCBBAA

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    32/38

    Other Logic GatesOther Logic Gates

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    33/38

    Other LogicOther Logic OperationsOperations

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    34/38

    Other Logic GatesOther Logic Gates

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    35/38

    Extension to MultipleExtension to Multiplenputnput

    Nonassociativity of the NOR operator

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    36/38

    Extension to MultipleExtension to Multiplenputnput

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    37/38

    Extension to MultipleExtension to Multiplenputnput

  • 8/10/2019 EEE122A Boolean Algebra and Logic Gates

    38/38

    Positive and Negative LogicPositive and Negative Logic