Ee177 Supplement 3

Embed Size (px)

DESCRIPTION

Class slides

Citation preview

  • 9/16/2015

    1

    INTRODUCTION TO DIGITAL LOGIC

    DeMorgansTheorem

    TheoremsofBooleanAlgebra(1)1)A+0=A2)A+1=13)A0=04)A1=A5)A+A=A6)A+A=17)AA=A8)AA=0

    TheoremsofBooleanAlgebra(2)9)A=A

    10)A+AB=A11)A+AB=A+B

    12)(A+B)(A+C)=A+BC13)Commutative:A+B=B+A

    AB=BA14)Associative:A+(B+C)=(A+B)+C

    A(BC)=(AB)C15)Distributive:A(B+C)=AB+AC

    (A+B)(C+D)=AC+AD+BC+BD

  • 9/16/2015

    2

    DeMorgansTheorems

    16)(X+Y)=X.Y17)(X.Y)=X+Y

    Two most important theorems of Boolean Algebra were contributed by De Morgan. Extremely useful in simplifying expression in which product or sum of variables is inverted. The TWO theorems are :

    ImplicationsofDeMorgansTheorem

    (a) Equivalent circuit implied by theorem (16) (b) Negative- AND (c) Truth table that illustrates DeMorgans Theorem

    (a)

    (b)

    Input Output

    X Y X+Y XY

    0 0 1 1

    0 1 0 0

    1 0 0 0

    1 1 0 0

    (c)

    ImplicationsofDeMorgansTheorem

    (a) Equivalent circuit implied by theorem (17) (b) Negative-OR (c) Truth table that illustrates DeMorgans Theorem

    (a)

    (b)

    Input Output

    X Y XY X+Y

    0 0 1 1

    0 1 1 1

    1 0 1 1

    1 1 0 0

    (c)

    DeMorgansTheoremConversion(1)

    Step1:ChangeallORstoANDsandallANDstoOrsStep2:Complementeachindividualvariable(shortoverbar)Step3:Complementtheentirefunction(longoverbars)Step4:EliminateallgroupsofdoubleoverbarsExample:A.B A.B.C =A+B =A+B+C =A+B =A+B+C =A+B =A+B+C =A+B

  • 9/16/2015

    3

    DeMorgansTheoremConversion(2)

    ABC+ABC (A+B+C)D =(A+B+C).(A+B+C) =(A.B.C)+D=(A+B+C).(A+B+C) =(A.B.C)+D=(A+B+C).(A+B+C) =(A.B.C)+D=(A+B+C).(A+B+C) =(A.B.C)+D

    Example:Analyzethecircuitbelow

    Y

    1. Y=??? 2. Simplify the Boolean expression found in 1

    Example:Analyzethecircuitbelow(CONT.)

    Followthestepslistbelow(constructingtruthtable) Listalltheinputvariablecombinationsof1and0inbinarysequentially

    Placetheoutputlogicforeachcombinationofinput

    Baseontheresultfoundwriteoutthebooleanexpression.

    Exercises:

    Simplify the following Boolean expressions 1. (AB(C + BD) + AB)C 2. ABC + ABC + ABC + ABC + ABC

    Write the Boolean expression of the following circuit.

  • 9/16/2015

    4

    Standard Forms of Boolean Expressions (1)

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

    Notes: SOP and POS expression cannot have more than one variable combined in a term with an inversion bar Theres no parentheses in the expression

    Standard Forms of Boolean Expressions (2)

    Converting SOP to Truth Table Examine each of the products to determine where the product is equal to a 1. Set the remaining row outputs to 0.

    Standard Forms of Boolean Expressions (3) Converting POS to Truth Table

    Opposite process from the SOP expressions. Each sum term results in a 0. Set the remaining row outputs to 1.

    Standard Forms of Boolean Expressions (4)

    BCACABCBACBAf ),,(

    632),,( mmmCBAf

    )6,3,2(),,( mCBAf

    The standard SOP Expression All variables appear in each product term. Each of the product term in the expression is called as minterm. Example:

    In compact form, f(A,B,C) may be written as

  • 9/16/2015

    5

    Standard Forms of Boolean Expressions (5)

    )()()(),,( CBACBACBACBAf

    The standard POS Expression All variables appear in each product term. Each of the product term in the expression is called as maxterm. Example:

    541),,( MMMCBAf In compact form, f(A,B,C) may be written as

    )5,4,1(),,( MCBAf

    Standard Forms of Boolean Expressions (6)

    CBACBACABABCCBAf ),,(

    )()()()(),,( CBACBACBACBACBAf

    Example:

    Convert the following SOP expression to an equivalent POS expression:

    Example:

    Develop a truth table for the expression:

    TheKarnaughMAP(KMap)

    K-Map (1)

    Karnaugh Mapping is used to minimize the number of logic gates that are required in a digital circuit.

    This will replace Boolean reduction when the circuit is large.

    Write the Boolean equation in a SOP form first and then place each term on a map.

  • 9/16/2015

    6

    The map is made up of a table of every possible SOP using the number of variables that are being used.

    If 2 variables are used then a 2X2 map is used If 3 variables are used then a 4X2 map is used If 4 variables are used then a 4X4 map is used If 5 Variables are used then a 8X4 map is used

    K-Map (2)

    K-Map SOP Minimization

    A

    A

    B B

    Notice that the map is going false to true, left to right and top to bottom

    The upper right hand cell is A B if X= A B then put an X in that cell

    A

    A

    B B

    1

    This show the expression true when A = 0 and B = 0

    0 1

    2 3

    2 Variables K-Map (1) If X=AB + AB then put an X in both of these cells

    A

    A

    B B

    1

    1

    From Boolean reduction we know that A B + A B = B

    From the Karnaugh map we can circle adjacent cell and find that X = B

    A

    A

    B B

    1

    1

    2 Variables K-Map (2)

  • 9/16/2015

    7

    3 Variables K-Map (1)

    Gray Code

    00 A B

    01 A B

    11 A B

    10 A B

    0 1

    C C

    0 1

    2 3

    6 7

    4 5

    X=ABC+ABC+ABC+ABC

    Gray Code

    00 A B

    01 A B

    11 A B

    10 A B

    0 1

    C C

    Each 3 variable term is one cell on a 4 X 2 Karnaugh map

    1 1

    1 1

    3 Variables K-Map (2)

    X=ABC+ABC+ABC+ABC

    Gray Code

    00 A B

    01 A B

    11 A B

    10 A B

    0 1

    C C One simplification could be

    X = A B + A B

    1 1

    1 1

    3 Variables K-Map (3) X=ABC+ABC+ABC+ABCGray Code

    00 A B

    01 A B

    11 A B

    10 A B

    0 1

    C C Another simplification could be

    X = B C + B C

    A Karnaugh Map does wrap around

    1 1

    1 1

    3 Variables K-Map (4)

  • 9/16/2015

    8

    X=ABC+ABC+ABC+ABC

    Gray Code

    00 A B

    01 A B

    11 A B

    10 A B

    0 1

    C C

    The Best simplification would be

    X = B

    1 1

    1 1

    3 Variables K-Map (4) On a 3 Variables K-Map

    One cell requires 3 Variables Two adjacent cells require 2 variables Four adjacent cells require 1 variable Eight adjacent cells is a 1

    4 Variables K-Map

    Gray Code

    00 A B

    01 A B

    11 A B

    10 A B

    0 0 0 1 1 1 1 0

    C D C D C D C D

    0 1 3 2

    4 5 7 6

    12 13 15 14

    8 9 11 10

    Gray Code

    00 A B

    01 A B

    11 A B

    10 A B

    0 0 0 1 1 1 1 0

    C D C D C D C D

    1

    1

    1

    1

    1

    1

    X = ABD + ABC + CD

    Now try it with Boolean reductions

    Simplify: X = A B C D + A B C D + A B C D + A B C D + A B C D + A B C

    D

  • 9/16/2015

    9

    On a 4 Variables K-Map

    One Cell requires 4 variables Two adjacent cells require 3 variables Four adjacent cells require 2 variables Eight adjacent cells require 1 variable Sixteen adjacent cells give a 1 or true

    Simplify:

    Z=BCD+BCD+CD+BCD+ABC

    Gray Code

    00 A B

    01 A B

    11 A B

    10 A B

    00 01 11 10

    C D C D C D C D

    1 1 1 1

    1 1

    1 1

    1 1

    1

    1

    Z = C + A B + B D

    Simplify using K-Map (1)

    Firstly, change the circuit to an SOP expression

    Y= A + B + B C + ( A + B ) ( C + D)

    Y = A B + B C + A B ( C + D )

    Y = A B + B C + A B C + A B D

    Y = A B + B C + A B C A B D

    Y = A B + B C + (A + B + C ) ( A + B + D)

    Y = A B + B C + A + A B + A D + B + B D + AC + C D

    Simplify using K-Map (2)

    SOP expression

  • 9/16/2015

    10

    Gray Code

    00 A B

    01 A B

    11 A B

    10 A B

    00 01 11 10

    C D C D C D C D

    1 1

    1 1

    1 1 1 1

    Y = 1

    1 1 1 1

    1 1

    1 1

    Simplify using K-Map (3)

    K-Map POS Minimization

    3 Variables K-Map (1)

    Gray Code

    0 0

    0 1

    1 1

    1 0

    0 1 AB C

    0 1

    2 3

    6 7

    4 5

    3 Variables K-Map (2)

  • 9/16/2015

    11

    0 0

    0 1

    1 1

    1 0

    0 0 0 1 1 1 1 0 A B C D

    0 1 3 2

    4 5 7 6

    12 13 15 14

    8 9 11 10

    4 Variables K-Map (1) 4 Variables K-Map (2)

    4 Variables K-Map (3) Mapping a Standard SOP expression Example: Answer:

    Mapping a Standard POS expression Example: Using K-Map, convert the following standard POS expression into a minimum SOP expression Answer: Y = AB + AC or standard SOP:

    K-Map - Examples

    DCBADCBABCDACDBADCBADCBAY CDADBY

    ABCCBACBAY

    )( CBAY

  • 9/16/2015

    12

    K-Map with Dont Care Conditions (1)

    Input Output

    Example :

    3 variables with output dont care (X)

    K-Map with Dont Care Conditions (2)

    4 variables with output dont care (X)

    Dont Care Conditions Example: Determine the minimal SOP using K-Map:

    Answer:

    K-Map with Dont Care Conditions (3)

    DACBCDDCBAF ),,,(

    14,15)D(5,12,13, 9,10)M(0,2,6,8, D)C,B,F(A,

    Solution : 14,15)D(5,12,13, 9,10)M(0,2,6,8, D)C,B,F(A,

    DACBCDDCBAF ),,,(

    AB CD

    00

    01

    11

    10

    00 01 11 10 0 1 1 0

    1 X 1 0

    X X X X

    0 0 1 0

    0 1 3 2

    4 5 7 6

    12 13 15 14

    8 9 11 10

    Minimum SOP expression is CD

    AD BC

  • 9/16/2015

    13

    Exercise

    Minimize this expression with a K-Map ABCD + ACD + BCD + ABCD

    K-map Product of Sums simplification Example: Simplify the Boolean function F(ABCD)=(0,1,2,5,8,9,10) in (a) S-of-P (b) P-of-S

    Using the minterms (1s) F(ABCD)= BD+BC+ACD

    Using the maxterms (0s) and complimenting F Grouping as if they were minterms, then using De- Morgens theorem to get F.

    F(ABCD)= BD+CD+AB F(ABCD)= (B+D)(C+D)(A+B)

    5 variable K-map (1)

    5 variables -> 32 minterms, hence 32 squares required

    5 variable K-map (2) Adjacent squares. E.g. square 15 is adjacent to

    7,14,13,31 and its mirror square 11. The centre line must be considered as the

    centre of a book, each half of the K-map being a page

    The centre line is like a mirror with each square being adjacent not only to its 4 immediate neighbouring squares, but also to its mirror image.

  • 9/16/2015

    14

    5 variable K-Map (3) Example: Simplify the Boolean function F(ABCDE) = (0,2,4,6,11,13,15,17,21,25,27,29,31) Soln: F(ABCDE) = BE+ADE+ABE

    6 variable K-map

    6 variables -> 64 minterms, hence 64 squares required

    End of Chapter 1 - tqvm -