09.Combinatorial.pdf

download 09.Combinatorial.pdf

of 44

Transcript of 09.Combinatorial.pdf

  • 8/9/2019 09.Combinatorial.pdf

    1/44

    LOGIC GATES AND BOOLEAN ALGEBRA

    Digital (logic) circuits operate in the binary mode

    when each input and output voltage is either a 0or 1.

    0 and 1 represent predefined voltage ranges.

    For example, for the TTL (Transistor Transistor

    Logic), have

    Logic Input Range Output Range

    0 0-0.8 V 0-0.4 V

    1 2-5 V 2.4-5V

    Note that the output range is tighterthan the input range

    to ensure reliability

  • 8/9/2019 09.Combinatorial.pdf

    2/44

    Combinatorial Circuits designed/analyzed usingBoolean Algebra,

    In Boolean Algebra, variables can only take onthe logical values 0 (FALSE) or 1 (TRUE)

    The Basic Functions in Boolean Algebra are

    NOT, OR and AND defined as follows

    NOT

    OR

    AND

    B=A (NOT) A B=1 if A=0 or B=0 if A=1

    C=A+B C=0 only if A=B=0; else C=1

    C=AB C=1 if A=B=1; else C=0

    In Boolean Algebra, 1 and 0 are NOT NUMBERS. They merely

    represent the logical variables TRUE and FALSE

  • 8/9/2019 09.Combinatorial.pdf

    3/44

    Logic Gates

    Digital circuits called logic gates can be

    constructed from diodes, transistors, and

    resistors in such a way that the circuit

    output is the result of a basic logicoperation (OR, AND, NOT) performed on

    the circuits.

    Logic Gates which do more complicated logical

    operations are also widely available, e.g. NOR,

    NAND, Ex-OR etc..

  • 8/9/2019 09.Combinatorial.pdf

    4/44

    Q1Q2

    Q3

    Q4

    A

    B

    Inputs

    Y=AB

    Output

    +5 V

    GND

    R1

    4 K

    R2

    1.6 K

    R3

    1 K

    R4

    130

    D

    TTL NAND Gate

    Totem Pole or

    Active Pull-Up

    Output

  • 8/9/2019 09.Combinatorial.pdf

    5/44

    Truth Table

    A truth table is a tabular representation for

    describing how a logic circuits output

    depends on the logic levels present at thecircuits inputs

  • 8/9/2019 09.Combinatorial.pdf

    6/44

    A

    B

    X

    A B X

    0

    0

    11

    0

    1

    01

    0

    1

    11

    Binary Counting

    Sequence

    No. of input combinations= 2Nfor N- Inputs

    Truth Table

  • 8/9/2019 09.Combinatorial.pdf

    7/44

    NOT Operation

    Called NOT A

    or Complement of A

    or Inverse of A

    AX =

    A 0 X=A 1

    A 1 X=A 0

    = =

    = =

    Function of

    only one

    variable

  • 8/9/2019 09.Combinatorial.pdf

    8/44

    NOT gate or Inverter

    A AX =

    A

    0 1

    1 0

    A0

    1

    1

    0

    AX =

    Truth Table

  • 8/9/2019 09.Combinatorial.pdf

    9/44

    Function of Two Binary Variables

    X = f(A,B)

    Examples: OR, AND

    NOR (Not-OR)

    NAND (Not-AND)

    Ex-OR

  • 8/9/2019 09.Combinatorial.pdf

    10/44

    A

    BX=A+B

    A B X

    0

    01

    1

    0

    10

    1

    0

    11

    1

    OR gate

    OR operation X = A+B

    Truth Table

  • 8/9/2019 09.Combinatorial.pdf

    11/44

    A B C X

    0

    0

    0

    01

    1

    11

    0

    0

    1

    10

    0

    11

    0

    1

    0

    10

    1

    01

    0

    1

    1

    11

    1

    11

    X=A+B+CABC

    Truth Table

  • 8/9/2019 09.Combinatorial.pdf

    12/44

    1

    A

    01

    B 0

    1C

    0

    1X

    0

    timeOR Operation

  • 8/9/2019 09.Combinatorial.pdf

    13/44

    AND Operation X = AB

    AND gate

    AB

    X = AB

  • 8/9/2019 09.Combinatorial.pdf

    14/44

    A B X

    0

    0

    1

    1

    0

    1

    0

    1

    0

    0

    0

    1

    Truth Table

  • 8/9/2019 09.Combinatorial.pdf

    15/44

    1

    A01

    B 0

    1

    X 0

    AND Operation

  • 8/9/2019 09.Combinatorial.pdf

    16/44

    NOR and NAND gates

    NOR - NOT-OR

    Combination of NOT and OR

    OR followed by NOT

    NAND NOT-AND

    Combination of NOT and AND

    AND followed by NOT

  • 8/9/2019 09.Combinatorial.pdf

    17/44

    X=A+BA

    B

    NOR gate

    A B A+B A+B0

    0

    1

    1

    0

    1

    0

    1

    0

    1

    1

    1

    1

    0

    0

    0

    X= A+BA

    B

    A+B

    Truth Table for NOR Gate

  • 8/9/2019 09.Combinatorial.pdf

    18/44

    NAND gate

    A

    BABX =

    ABX = AB

    A

    B

  • 8/9/2019 09.Combinatorial.pdf

    19/44

    A B AB AB

    0

    0

    11

    0

    1

    01

    0

    0

    01

    1

    1

    10

    Truth Table for NAND Gate

  • 8/9/2019 09.Combinatorial.pdf

    20/44

    Ex-OR GateA

    B

    Y

    Y=A B

    =AB+AB

    Comparator: Output is LOW

    if both the inputs are identical;

    else output is HIGH

    Half-Adder: Y is the sum of

    A and B (in binary) ignoring

    the carry out that will begenerated by 1+1

    Symbol

    A B Y

    0 0 0

    0 1 1

    1 0 1

    1 1 0

    Truth Table

  • 8/9/2019 09.Combinatorial.pdf

    21/44

    Describing Logic Circuits Algebraically

    A

    X= ?B

    C

    X=AB+C

    A

    X= ?BC

    X=(A+B)C

    A

    X= ?B

    BAX +=

    A

    X= ?B)BA(X +=

  • 8/9/2019 09.Combinatorial.pdf

    22/44

    A

    BY

    A

    B

    YAB

    AB

    AB

  • 8/9/2019 09.Combinatorial.pdf

    23/44

    A

    D

    B

    C

    X= ?

    )DABC(AX +=

  • 8/9/2019 09.Combinatorial.pdf

    24/44

    A

    B

    C

    D

    E

    X = ?

    B)C(A +DB)C(A ++

    A+B (A+B)C

    ( )EDB)C(AX ++=

  • 8/9/2019 09.Combinatorial.pdf

    25/44

  • 8/9/2019 09.Combinatorial.pdf

    26/44

    Boolean Algebraic Theorems : Useful in simplifyingexpression of logic variables

    A variable can have only two values, A = 1 or A= 0

    (1)AA =

    Also,

    )(51AA

    (4)AAA

    (3)11A

    (2)A0A

    =+

    =+

    =+

    =+

    DualsInterchange + and .

    Interchange 0 and 1

    )(90A.A

    (8)AA.A

    (7)00.A

    (6)A1.A

    =

    =

    =

    =

  • 8/9/2019 09.Combinatorial.pdf

    27/44

    ( ) (10)ACABCBA +=+ Distributive Law

    Dual (11)C)B)(A(ABCA ++=+Proof : RHS=

    LHS

    BCABCC)A(1

    BCCAA

    BCCAB)A(1BCCAABA

    BCCAABAA

    C)B)(A(A

    =

    +=

    ++=

    ++=

    +++=

    +++=

    +++=

    ++

  • 8/9/2019 09.Combinatorial.pdf

    28/44

    Duals

    (16)CAABBCCAAB

    (15)B)AC)((ACAAB(14)ABAAB

    (13)BABAA

    (12)AABA

    +=++

    ++=+

    =+

    +=+

    =+

    A.(A B) A (17)

    A.(A B) A.B (18)

    (A B).(A B) A (19)(A B).(A C) AC AB (20)

    (A B).(A C).(B C) (A B).(A C) (21)

    + =

    + =

    + + =

    + + = +

    + + + = + +

  • 8/9/2019 09.Combinatorial.pdf

    29/44

    (13) A AB A(B 1) AB AB A AB A B(A A) A B+ = + + = + + = + + = +

    A1.A)BA(BBAAB(14) ==+=+

    (12) A AB A(1+B) A.1 A+ = = =

    Some sample proofs

    De Morgans Theorem:

    (22)................CBA......A.B.C..... +++=

    (23)................C.B.A..C.........BA =++

  • 8/9/2019 09.Combinatorial.pdf

    30/44

    Ex. Simplify ( )( )

    ( ) ( )

    ( )DBCA

    D.BC.A

    DBCA

    DB.CAZ

    +=

    +=

    +++=

    ++=

    Using De Morgans Theorem

    Ex. Simplify

    ( )

    B)(CDACB

    )CB(CDACB

    DCBADCAA)AC(B0

    CBADCBADCACBACAA

    CBADCBADBACA

    CBADCBA)DBAC(ACBADCBA)BDAC(AZ

    ++=

    ++=

    ++++=

    ++++=

    ++++=

    ++++=

    ++=

  • 8/9/2019 09.Combinatorial.pdf

    31/44

  • 8/9/2019 09.Combinatorial.pdf

    32/44

    Using NAND Gates

    NOT A

    A

    B AND

    A

    B OR

    Using NAND Gates

    AA.AX ==

    ABABAB.ABX ===AB

    A

    B

    BABAB.AX +=+==

  • 8/9/2019 09.Combinatorial.pdf

    33/44

    Using NOR Gates

    NOT A

    A

    B

    OR

    A

    B

    AND

    Using NOR

    AAAX =+=

    BA +

    BABABABAX +=+=+++=

    A.BB.ABAX ==+=

    A

    B

  • 8/9/2019 09.Combinatorial.pdf

    34/44

    COMBINATIONAL LOGIC CIRCUITS

    orCOMBINATORIAL CIRCUITS

    The circuits made up of combination of logic

    gates discussed earlier can be classified as

    combinational logic circuits because at any

    time, the logic level at the output depends onthe combination of logic levels present at the

    inputs.

    A combinational circuit has no memory, so its

    output depends only on the current value of

    its inputs.

  • 8/9/2019 09.Combinatorial.pdf

    35/44

    Standard Forms For Logical Expression

    For Logic circuit simplification and design, wetry to express the logical expression in one of

    two standard forms -

    Sum-of-Products Form

    or Product-of-Sums Form

  • 8/9/2019 09.Combinatorial.pdf

    36/44

    Sum-of-Products (SOP)

    Examples: (i) (ii)

    Note that each expression consists of two or moreAND

    terms that areORed together and that -

    (i) The same variable used never appears twice in a

    product. (Because A.A=A and )

    ABC+ABC AB+ABC+CD+D

    AA=0

    (ii) One complement sign can not cover more than

    one variable in a term (e.g. we can not have ABC

    as we can then use De Morgans Law to simplify)

  • 8/9/2019 09.Combinatorial.pdf

    37/44

  • 8/9/2019 09.Combinatorial.pdf

    38/44

  • 8/9/2019 09.Combinatorial.pdf

    39/44

    Standard SOP Form

    A SOP Form in which each product terminvolves all the variables (complemented or

    uncomplemented).

    Each individual term is referred to as a minterm.

    Example Z=ABC+ABC+ABC

  • 8/9/2019 09.Combinatorial.pdf

    40/44

    Express in the standard SOP form

    Z=A+BC

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

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

    =ABC+ABC+ABC+ABC+ABC

  • 8/9/2019 09.Combinatorial.pdf

    41/44

    Product of Sum (POS)

    It consists of two or more OR terms (Sums) that

    are ANDed together. Each OR term contains oneor more variables in complemented or

    uncomplemented form.

    e.g. (A+B+C)(A+C)Standard POS : When a function is expressed as

    a POS, where each term consists of a sum, the

    sum involving all of the variables in either

    complemented or uncomplemented form.

    e.g. Z=(A+B+C)(A+B+C)

  • 8/9/2019 09.Combinatorial.pdf

    42/44

    B C

    ABCA +

    BCAABX +=

    AB

    XAB

    C

    Simplifying Logic Circuits

  • 8/9/2019 09.Combinatorial.pdf

    43/44

    X = AB(A + BC)

    = AB(A . BC)

    = AB[ A . (B + C)]

    = AB A(B + C)

    = AB(B + C)= ABB + ABC =ABC

  • 8/9/2019 09.Combinatorial.pdf

    44/44