03 nand nor conversions

Upload: guru-prasad-iyer

Post on 04-Apr-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 03 Nand Nor Conversions

    1/19

    Page 1

    NAND/NOR Only Implementations

    Although we can implement any circuit with AND/OR/NOT, we can also implement

    any circuit with only NAND or NOR gates.

    We might want to do this because of technology considerations; That is, these gates

    might be cheaper to implement in silicon or they might be the only type of gates we

    have available.

    Since we can always use only NAND or NOR gates, these gates are sometimes called

    universal gates.

    The trick (if you want to call it that) is to see that we can implement the three basic

    gates (AND, OR, NOT) in terms of NAND or NOR gates.

    ECE124 Digital Circuits and Systems

  • 7/31/2019 03 Nand Nor Conversions

    2/19

    NOT-gate via NAND

    ECE124 Digital Circuits and Systems Page 2

    We can implement a NOT-gate using a NAND by applying the same signal to

    both inputs.

  • 7/31/2019 03 Nand Nor Conversions

    3/19

    AND-gate via NAND

    ECE124 Digital Circuits and Systems Page 3

    We can implement an AND-gate by using a NAND gate and (then) another NAND gate

    to invert the output.

  • 7/31/2019 03 Nand Nor Conversions

    4/19

    OR-gate via NAND

    ECE124 Digital Circuits and Systems Page 4

    We can implement an OR-gate by using a NAND gate and (then) other NAND gates to invert the

    inputs.

    The ability to implement INV/AND/OR with NAND means we can implement anycircuit using only NANDs (if only my replacing the AND, OR and NOT gates withtheir NAND implementations).

  • 7/31/2019 03 Nand Nor Conversions

    5/19

    Comment

    ECE124 Digital Circuits and Systems Page 5

    Before continuing, we should make note that a NAND gate performs the same function as an OR

    gate with inverts at the inputs. This is useful to remember.

    We can illustrate for a 3-input gate:

  • 7/31/2019 03 Nand Nor Conversions

    6/19

    2-level NAND only implementations (1)

    If we are given a 2-level SOP, obtaining a NAND only implementation is trivial; we

    simply use apply a double inversion and use the DeMorgan theorem being careful ofwhere we leave the inversions in the final expression.

    For example:

    f = x1 !x2 + !x1 x2 + x3

    = !(!f)

    = !( !(x1 !x2 + !x1 x2 + x3) )

    = !( !(x1 !x2) !(!x1 x2) !(x3) )

    ECE124 Digital Circuits and Systems Page 6

  • 7/31/2019 03 Nand Nor Conversions

    7/19

    2-level NAND only implementations (2)

    ECE124 Digital Circuits and Systems Page 7

    We can also make the conversion graphically. Again, given a 2-level SOP the procedure

    is straightforward:

    Insert double inverters at input of OR gate (input will be either from an AND gate, or

    from an input literal).

    Convert OR gate plus one level of inverters to NAND gate.

    Convert AND-gates plus the other level of inverters to NAND gates.

    Some literals might get inverted.

  • 7/31/2019 03 Nand Nor Conversions

    8/19

    2-level NAND only implementations (3)

    ECE124 Digital Circuits and Systems Page 8

  • 7/31/2019 03 Nand Nor Conversions

    9/19

    Multi-level NAND gate implementations (1)

    2x

    1x

    1x

    2x

    3x

    4x

    5x

    ECE124 Digital Circuits and Systems Page 9

    Circuits are not always in 2-level (or SOP) form.

    Example:

    Conversion method is essentially the same:

    Insert double inverters before OR gates. Use one set of inverters plus the OR gates to convert to NAND.

    Use other inverts with AND gates to convert to NAND.

    Occasionally, might need to implement an inverter using NAND.

  • 7/31/2019 03 Nand Nor Conversions

    10/19

    Multi-level NAND gate implementations (2)

    2x

    1x

    1

    x

    2x

    3x

    4x

    5x

    ECE124 Digital Circuits and Systems Page 10

    2x

    1x

    1x

    2x

    3x

    4x

    5x

    Notice the extra inverters

  • 7/31/2019 03 Nand Nor Conversions

    11/19

    NOT-gate via NAND

    ECE124 Digital Circuits and Systems Page 11

    We can implement a NOT-gate using a NOR by applying the same signal to both

    inputs.

  • 7/31/2019 03 Nand Nor Conversions

    12/19

    OR-gate via NOR

    ECE124 Digital Circuits and Systems Page 12

    We can implement an OR-gate using a NOR and (then) another NOR to perform

    inversion.

  • 7/31/2019 03 Nand Nor Conversions

    13/19

    AND-gate via NOR

    ECE124 Digital Circuits and Systems Page 13

    We can implement an AND-gate by using a NOR gate and (then) other NOR gates to invert the

    inputs.

    The ability to implement INV/AND/OR with NOR means we can implement anycircuit using only NORs (if only my replacing the AND, OR and NOT gates withtheir NOR implementations).

  • 7/31/2019 03 Nand Nor Conversions

    14/19

    Comment

    ECE124 Digital Circuits and Systems Page 14

    Before continuing, we should make note that a NOR gate performs the same function as an AND

    gate with inverters at the inputs. This is useful to remember.

    We can illustrate for a 3-input gate:

  • 7/31/2019 03 Nand Nor Conversions

    15/19

    2-level NOR only implementations (1)

    If we are given a 2-level POS, obtaining a NOR only implementation is trivial; we

    simply use apply a double inversion and use the DeMorgan theorem being careful ofwhere we leave the inversions in the final expression.

    For example:

    f = (x1 + x2)(x3 + x4)(x5)

    = !(!f)

    = !( !((x1 + x2)(x3 + x4)(x5)) )

    = !( !(x1 + x2) + !(x3 + x4) + !(x5) )

    ECE124 Digital Circuits and Systems Page 15

  • 7/31/2019 03 Nand Nor Conversions

    16/19

    2-Llevel NOR gate implementations (2)

    ECE124 Digital Circuits and Systems Page 16

    Can also make the conversion graphically and it is straightforward:

    Insert double inverters at input of AND gate (input will be either from an OR gate, or froman input literal).

    Convert AND gate plus one level of inverters to NOR gate.

    Convert OR gates plus the other level of inverters to NOR gates.

    Some literals might get inverted.

  • 7/31/2019 03 Nand Nor Conversions

    17/19

    2-Llevel NOR gate implementations (3)

    ECE124 Digital Circuits and Systems Page 17

  • 7/31/2019 03 Nand Nor Conversions

    18/19

    Multi-level NOR gate implementations (1)

    2x

    1x

    1x

    2x

    3x

    4x

    5x

    ECE124 Digital Circuits and Systems Page 18

    Circuits are not always in 2-level (or POS) form.

    Example:

    Conversion method is essentially the same:

    Insert double inverters before AND gates.

    Use one set of inverters plus the AND gates to convert to NOR.

    Use other inverters with OR gates to convert to NOR.

    Occasionally, might need to implement an inverter using NOR.

  • 7/31/2019 03 Nand Nor Conversions

    19/19

    Multi-level NOR gate implementations (2)

    2x

    1x

    1x

    2x

    3x

    4

    x

    5x

    ECE124 Digital Circuits and Systems Page 19

    2x

    1x

    1x

    2x

    3x

    4x

    5x

    Notice the extra inverters