43
UNIT 7 MULTI-LEVEL GATE CIRCUITS Spring 2011

UNIT 7tiger.ee.nctu.edu.tw › course › LogicDesign2017Fall › lec7.pdf · Karnaugh map (Unit 5) Quine-McCluskey (Unit 6) … etc 3. Realize it using available logic gates AND-OR,

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

  • UNIT 7

    MULTI-LEVEL GATE CIRCUITS

    Spring 2011

  • © Iris H.-R. Jiang

    Multi-Level Gate Circuits

    Contents

    Multi-level gate circuits

    NAND and NOR gates

    Two-level NAND- and NOR-gate circuits

    Multi-level NAND- and NOR-gate circuits

    Circuit conversion using alternative gate symbols

    Design of two-level, multiple-output circuits

    Multiple-output NAND and NOR circuits

    Reading

    Unit 7

    Multi-level gate circuits

    2

  • © Iris H.-R. Jiang

    Objectives

    Recap logic design steps:

    1. Translate the word description into a switching function (Unit 4)

    2. Simplify the function

    Boolean algebra (Units 2&3)

    Karnaugh map (Unit 5)

    Quine-McCluskey (Unit 6)

    … etc

    3. Realize it using available logic gates

    AND-OR, OR-AND (Unit 2)

    NAND-NAND, NOR-NOR (Unit 7)

    … etc

    Design/convert two-/multi-level single-/multiple-output circuits

    using Karnaugh maps and NAND/NOR/AND/OR gates

    Multi-level gate circuits

    3

  • © Iris H.-R. Jiang

    AND-OR & OR-AND Circuits

    The # of levels of gates =

    the maximum # of gates cascaded

    in series between an input & the output

    Do NOT count inverters at inputs

    Count from the output

    Two-level circuits learned so far:

    AND-OR circuit = SOP form

    One level of AND gates

    + one OR gate

    OR-AND circuit = POS form

    One level of OR gates

    + one AND gate

    Multi-level gate circuits

    4

    d

    a'c'

    d

    b

    c'

    d'

    b

    c

    d'

    ac

    f

    d

    c

    c

    c'

    a'

    d'

    b

    c'

    ab

    f

    Level 2 Level 1

  • © Iris H.-R. Jiang

    OR-AND-OR & AND-OR-AND Circuits

    Three-level circuits:

    OR-AND-OR circuit

    AND-OR-AND circuit

    Multi-level gate circuits

    5

    d'

    a

    c'

    d'

    a'

    d

    b

    d

    bc

    f

    a'

    dc'

    d'

    b

    c

    f

    a

    b

    Level 2 Level 1Level 3

  • © Iris H.-R. Jiang

    One More Example (1/2)

    How to count the # of level?

    By inspection

    e.g.,

    4 levels

    6 gates

    13 gate inputs

    Multi-level gate circuits

    6

    A

    H

    EDC

    B F G

    Z

    Z = (AB + C)(D + E + FG) + H

    Level 4

    Level 3

    Level 2

    Level 1

    2 2

    2 3

    2

    2

    gate#inputs

  • © Iris H.-R. Jiang

    One More Example (2/2)

    Same function in another realization

    3 levels

    6 gates

    19 gate inputs

    Multi-level gate circuits

    7

    5

    D

    H

    C

    E

    Z

    Level 3

    Level 2

    Level 1

    BA ABFG GFC

    3423

    2 2

    Z = AB(D + E) + C(D + E) + ABFG + CFG + H

    Use one gate for both

  • © Iris H.-R. Jiang

    Multi-Level Gate Circuits

    Q1: Why does the # of level matter?

    A1: The # of level affects cost and delay (Trade-off!)

    Cost depends on # of gates & # of gate inputs

    Delay depends on # of level & # of inputs for a single gate

    # of level cost (maybe), circuit delay (maybe)

    e.g.,

    Z = (AB + C)(D + E + FG) + H

    4 levels/6 gates/13 gate inputs

    Z = AB(D + E) + C(D + E) + ABFG + CFG + H

    3 levels/6 gates/19 gate inputs

    Q2: How to change the # of levels?

    A2: Factoring or multiplying out (see the next example)

    Multi-level gate circuits

    8

    faster vs. slower

  • © Iris H.-R. Jiang

    Multi-Level Design using AND & OR (1/4)

    e.g., find a circuit of AND and OR gates to realize

    f(a, b, c, d) = m(1, 5, 6, 10, 13, 14)

    Sol 1: try two-level AND-OR circuit first!

    1. Simplify f by K-map (circle 1’s)

    2. Realize it

    Multi-level gate circuits

    9

    abcd 00 01 11 10

    00

    01

    11

    10

    1 1

    0

    1

    0

    1

    0

    1 1

    000

    0 0

    0

    0

    d

    a'c'

    d

    b

    c'

    d'

    b

    c

    d'

    ac

    f

    5 gates

    16 gate inputs

    Level 2 Level 1

    f = a'c'd + bc'd + bcd' + acd'

  • © Iris H.-R. Jiang

    Multi-Level Design using AND & OR (2/4)

    From Sol 1, f(a, b, c, d) = a'c'd + bc'd + bcd' + acd'

    Sol 2:

    1. Factoring it yields f(a, b, c, d) = (a' + b)c'd + (b + a)cd'

    Sharing!

    2. Lead to a three-level OR-AND-OR circuit

    Gate inputs ; cost ; delay

    Multi-level gate circuits

    10

    a'

    dc'

    d'

    b

    c

    f

    a

    b

    5 gates

    12 gate inputs

    Level 2 Level 1Level 3

  • © Iris H.-R. Jiang

    Multi-Level Design using AND & OR (3/4)

    e.g., find a circuit of AND and OR gates to realize

    f(a, b, c, d) = m(1, 5, 6, 10, 13, 14)

    Sol 3: try two-level OR-AND circuit

    1. Simplify f by K-map (circle 0’s)

    2. Realize it

    Multi-level gate circuits

    11

    abcd 00 01 11 10

    00

    01

    11

    10

    1 1

    0

    1

    0

    1

    0

    1 1

    000

    0 0

    0

    0

    Level 2 Level 1

    f' = c'd' + ab'c' + cd + a'b'c

    f = (c + d)(a' + b + c)(c' + d')(a + b + c')

    d

    c

    c

    c'

    a'

    d'

    b

    c'

    ab

    f

    5 gates

    14 gate inputs

  • © Iris H.-R. Jiang

    Multi-Level Design using AND & OR (4/4)

    From Sol 3, f(a, b, c, d) = (c + d)(a' + b + c)(c' + d')(a + b + c')

    Sol 4:

    1. Multiplying it out yields

    f = [c + d(a' + b)][c' + d'(a + b)] (4-level)

    2. Partially multiplying out d(a' + b) and d'(a + b)

    f = (c + a'd + bd)(c' + ad' + bd')

    3. Lead to a three-level AND-OR-AND circuit

    For this case, best solutions:

    Two-level: OR-AND

    Three-level: OR-AND-OR

    Multi-level gate circuits

    12

    Level 2 Level 1Level 3

    d'

    a

    c'

    d'

    a'

    d

    b

    d

    bc

    f

    7 gates

    16 gate inputs

  • DeMorgan’s law

    Double inversions

    NAND & NOR Gates13

    Multi-level gate circuits

  • © Iris H.-R. Jiang

    NAND Gate

    NAND AND-NOT

    F = (ABC)' = A' + B' + C' (DeMorgan’s law)

    General: F = (X1X2…Xn)' = X1' + X2' + … + Xn'

    Symbol

    Bubble NOT

    Multi-level gate circuits

    14

    Double inversions

    = 2 cascaded bubbles

    = do nothing, (X')' = X

    C

    A

    B F

    C

    A

    B F

    X1

    FX2

    Xn

    DeMorgan’s law

    C

    A

    B F

  • © Iris H.-R. Jiang

    NOR Gate

    NOR OR-NOT

    F = (A + B + C)' = A'B'C' (DeMorgan’s law)

    General: F = (X1 + X2 + … + Xn)' = X1'X2'…Xn'

    Symbol

    Bubble NOT

    Multi-level gate circuits

    15

    DeMorgan’s law

    C

    A

    B F

    C

    A

    B F

    X1

    FX2

    Xn

    C

    A

    B F

    Actually, NAND & NOR are implemented by

    fewer switch devices and operate faster than

    AND & OR gates Low cost, small delay

  • © Iris H.-R. Jiang

    Functionally Complete Set (1/2)

    A set of logic operations is functionally complete if any Boolean

    function can be expressed by this set

    e.g., f = a'b + b'c + c'a

    Q: {AND, OR, NOT} A: Of course, yes!

    Q: {AND, NOT}? OR? A: Yes! (Why?)

    (X + Y) = [X'•Y']' = X + Y (DeMorgan’s law)

    Multi-level gate circuits

    16

    (X'Y')' = X + YX'Y'

    X'

    Y'

    X

    Y

  • © Iris H.-R. Jiang

    Functionally Complete Set (2/2)

    Q: {NAND}?

    Q: {OR, NOT}?

    Q: {NOR}?

    Q: {AND, OR}?

    NOT is MUST!

    Multi-level gate circuits

    17

    OR

    ANDNOT

    X

    X'

    (A'B')'

    = A + B

    A

    B

    A'

    B'

    A

    ABB

    (AB)'

  • Two-Level NAND-/NOR-Gate Circuits18

    Multi-level gate circuits

  • © Iris H.-R. Jiang

    DeMorgan’s Law Is the Key of Conversion

    General:

    (X1 + X2 + … + Xn)' = X1'X2'…Xn'

    (X1X2…Xn)' = X1' + X2' + … + Xn'

    One-step rule:

    [f(x1,x2,…,xn,0,1,+,)]' = f(x1', x2',…,xn',1,0,,+)

    x x'; + ; 0 1

    Idea: introduce 2 cascaded bubbles into an intermediate line

    Multi-level gate circuits

    19

    X1

    FX2

    Xn

    X1FX2

    Xn

    … ……

    X1

    FX2

    Xn

    X1

    FX2

    Xn

    …… …

  • © Iris H.-R. Jiang

    Eight Basic Forms for Two-Level CKTs (1/2)

    Multi-level gate circuits

    20

    AND-

    OR

    OR-

    NAND

    NOR-

    OR

    NAND-

    NAND

    B

    AC'

    FB'CD

    F = A + BC'+ B'CD

    B'

    AC

    FBC'D'

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

    B

    A'C'

    FB'CD

    F = [A' • (BC')' • (B'CD)']'

    B'

    A'C

    FBC'D'F = [A' • (B' + C) • (B + C' + D')]'

  • © Iris H.-R. Jiang

    8 Forms (2/2)

    Multi-level gate circuits

    21

    OR-

    AND

    AND-

    NOR

    NAND-

    AND

    NOR-

    NOR

    D'

    FAB'C'

    ABC

    AC'D

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

    + (A + C' + D)']'

    FA'BC

    A'B'C'

    A'CD'F = (A'B'C' + A'BC + A'CD')'

    FA'BC

    A'B'C'

    A'C

    F = (A'B'C')' • (A'BC)' • (A'CD')'

    FAB'C'

    ABC

    AC'D

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

  • © Iris H.-R. Jiang

    Other Forms

    AND-AND, OR-OR, OR-NOR, AND-NAND, NAND-NOR, NOR-

    NAND are degenerated

    Cannot realize all switching functions

    e.g., NAND-NOR can realize only a product of literals and not a

    SOP

    Multi-level gate circuits

    22

    F = [(ab)' + (cd)' + e]' = abcde'e

    ab

    cd

  • © Iris H.-R. Jiang

    Minimum 2-Level NAND-NAND Circuits

    Procedure for designing a min 2-level NAND-NAND circuit:

    1. Find a minimum SOP

    2. Draw AND-OR (2-level) circuit

    3. Convert into NAND-NAND circuit

    Multi-level gate circuits

    23

    l1l2

    y1y2

    F

    x1x2

    P1

    P2

    ……

    ……

    l1'l2'

    y1y2

    F

    x1x2

    P1'

    P2'…

    ……

    Introduce 2 bubbles into

    each intermediate line

    l1l2

    y1y2

    F

    x1x2

    P1

    P2…

    ……

  • © Iris H.-R. Jiang

    Minimum 2-Level NOR-NOR Circuits

    Procedure for designing a min 2-level NOR-NOR circuit:

    1. Find a minimum POS

    2. Draw OR-AND (2-level) circuit

    3. Convert into NOR-NOR circuit

    Multi-level gate circuits

    24

    l1l2

    y1y2

    F

    x1x2

    P1

    P2

    … ………

    Introduce 2 bubbles into

    each intermediate line

    l1l2

    y1y2

    F

    x1x2

    P1

    P2… …

    ……

    l1'l2'

    y1y2

    F

    x1x2

    P1'

    P2'…

    ……

  • © Iris H.-R. Jiang

    Example: NAND-NAND & NOR-NOR

    DIY!

    F = A + BC' + B'CD

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

    Multi-level gate circuits

    25

    B

    AC'

    FB'CD

    FAB'C'

    ABC

    D

  • © Iris H.-R. Jiang

    Summary: Two-Level Logic Minimization

    Start with minimum SOP (AND-OR) or minimum POS (OR-AND)

    Simplified: cost = (# of terms, # of literals) (Units 2—5)

    Real: cost = (# of gates, # of gate inputs)

    # of gates # of terms +1

    # of gate inputs # of literals + # of terms

  • Multi-Level NAND-/NOR-Gate Circuits27

    Multi-level gate circuits

  • © Iris H.-R. Jiang

    Multi-Level NAND-Gate Circuits

    Procedure for designing a multi-level NAND circuit:

    1. Simplify the switching function

    2. Draw its multi-level AND-OR ckt

    3. Replace all gates with NANDs and number all levels (starting

    with output gate as level 1)

    4. Invert inputs at levels 1, 3, 5, …

    e.g., F = a'[b'+ c(d + e') + f'g'] + hi'j + k

    Multi-level gate circuits

    28

    Add 2 bubbles into an

    intermediate line …

    Level 5 Level 4 Level 3 Level 2 Level 1d

    ce'

    f'g'

    b' k

    a'

    hi'j

    F1

    d'

    ce

    f'g'

    b k'

    a'

    hi'j

    F1

  • Circuit Conversion29

    Multi-level gate circuits

  • © Iris H.-R. Jiang

    Alternative Gate Symbols

    Please do NOT memorize these gate symbols

    DeMorgan’s law is the key of conversion

    Use bubbles adequately

    Multi-level gate circuits

    30

    or

    NOT

    NAND NOR

    ORAND

    A A' A A'

    A

    BAB

    A

    BA + B

    A

    B(AB)'

    A

    B(A + B)'

  • © Iris H.-R. Jiang

    Conversion from NAND to AND-OR Gates

    Multi-level gate circuits

    31

    A

    B'C

    D

    E

    F Z

    12

    3

    4

    A

    B'C

    D

    E

    F Z = (A' + B)C + F' + DE2

    3

    1

    4

    A' + B [(A' + B)C]'

    (DE)'

    A'

    BC

    D

    E

    F' Z2

    3

    1

    4

    Cancel double inversions

    Process single bubbles

    DeMorganDeMorgan

  • © Iris H.-R. Jiang

    Conversion from OR-AND to NOR Gates

    Multi-level gate circuits

    32

    ZGD

    E

    F

    C

    A

    B'

    ZGD

    E

    F

    C

    A

    B'

    ZG'D

    E

    F

    C'

    A

    B'

    Inverted input cancels inversion

    Add 2 bubbles if necessary

  • © Iris H.-R. Jiang

    From a General AND-OR to NAND Network

    Multi-level gate circuits

    33

    A

    B'C

    DE

    F

    A

    B'C D'

    E'F

    A

    B'C

    DE

    F

    1. Inverted input cancels inversion

    2. Add inverters for remaining bubbles

    Add 2 bubbles if necessary

  • Two-Level Multiple-Output Circuits34

    Multi-level gate circuits

  • © Iris H.-R. Jiang

    Case 1: 4 Inputs and 3 Outputs (1/2)

    e.g.,

    F1(A, B, C, D) = m(11, 12, 13, 14, 15)

    F2(A, B, C, D) = m(3, 7, 11, 12, 13, 15)

    F3(A, B, C, D) = m(3, 7, 12, 13, 14, 15)

    Multi-level gate circuits

    35

    1

    ABCD 00 01 11 10

    00

    01

    11

    10

    F1

    ABCD 00 01 11 10

    00

    01

    11

    10

    F2

    ABCD 00 01 11 10

    00

    01

    11

    10

    F3

    1

    1

    1

    1 1 1 1 1

    1

    1 1

    1

    1

    1

    1 1

    F1=AB + ACD F2=ABC' + CD F3=A'CD + AB

  • © Iris H.-R. Jiang

    Case 1: 4 Inputs and 3 Outputs (2/2)

    9 gates; 21 gate inputs 7 gates; 18 gate inputs

    Direct implementation After sharing

    Multi-level gate circuits

    36

    F1=

    AB + ACD

    ACD

    ABC'

    A'CD

    D

    C

    B

    A

    B

    A

    F2=

    ABC' + CD

    F3=

    A'CD + AB

    ACD

    ABC'

    A'CD

    B

    A

    F1

    F2

    F3

    AB is shared (F1 &F3)

    CD = A'CD + ACD (F1 & F3 F2)

  • © Iris H.-R. Jiang

    Case 2: 4 Inputs and 3 Outputs (1/2)

    e.g.,

    f1(a, b, c, d) = m(2, 3, 5, 7, 8, 9, 10, 11, 13, 15)

    f2(a, b, c, d) = m(2, 3, 5, 6, 7, 10, 11, 14, 15)

    f3(a, b, c, d) = m(6, 7, 8, 9, 13, 14, 15)

    If each function is minimized separately

    10 gates; 25 gate inputs

    Multi-level gate circuits

    37

    1

    11

    1

    abcd 00 01 11 10

    00

    01

    11

    10

    abcd 00 01 11 10

    00

    01

    11

    101

    1 1 1 1

    11

    11

    1 1 1 1 1

    abcd 00 01 11 10

    00

    01

    11

    10

    1

    1

    1

    11

    1

    1

    1

    f1 = bd + b'c + ab' f2= c + a'bd f3= bc + ab'c' + abd'

    (ac'd)

  • © Iris H.-R. Jiang

    Case 2: 4 Inputs and 3 Outputs (2/2)

    Find common minterms from K-map

    f1 = abd + a'bd + b'c + ab'c'

    f2= c + a'bd 8 gates; 22 gate inputs

    f3= bc + ab'c' + abd'

    Multi-level gate circuits

    38

    abcd 00 01 11 10

    00

    01

    11

    10

    abcd 00 01 11 10

    00

    01

    11

    10

    1

    1

    1 1 1 1

    11

    1

    1

    1

    1 1 1 1 1

    abcd 00 01 11 10

    00

    01

    11

    10

    1

    1

    1

    11

    11

    1

    1

    1

    abd

    a'bd

    ab'c'

    bd (f1) a'bd (f2) + abd (f3) (combine)

    ab'c' (f1) covered by ab'c' (f3) (share)

    f1 f2 f3

  • © Iris H.-R. Jiang

    Case 3: Essential Prime Implicants

    Best

    One more gate

    Multi-level gate circuits

    39

    abcd 00 01 11 10

    00

    01

    11

    10

    abcd 00 10

    00

    01

    11

    10

    f1

    1 11 1

    1

    1 1

    1 1

    1

    01 11

    f2

    abcd 00 01 11 10

    00

    01

    11

    10

    f1

    1 11 1

    1 1

    1 1

    abcd 00 10

    00

    01

    10

    01 11

    1 111

    f2

    abd

    c'd

    Essential for multi-output:

    Only check 1’s which do

    not appear in other maps

    e.g,

    c'd is essential

    abd is not

  • © Iris H.-R. Jiang

    Case 4

    Most common terms

    8 gates; 26 inputs

    Best

    7 gates; 18 inputs

    No common terms

    Multi-level gate circuits

    40

    Who is essential?

    abcd 00 01 11 10

    00

    01

    11

    10

    f1

    1

    1

    abcd 00 10

    00

    01

    10

    01 11

    11

    f2

    1

    1

    1 1

    1 111

    1 1

    cd 11 10

    00

    01

    11

    10

    1

    1

    abcd 00 10

    00

    01

    10

    11

    1

    1

    1 1

    1 111

    1 1

    ab00 01

    f1 f2

    01 11

  • © Iris H.-R. Jiang

    Summary: 2-Level Multiple-Output Circuits

    Cost = (total # of gates, total # of gate inputs)

    Think in a global way

    A min SOP for each cannot guarantee min cost for all

    Common and essential terms may help

    Sometimes, we do not need to make circles that large

    ‘Essential’ is defined in a different way

    Very difficult to find global optimal solution

    Boolean algebra is very useful in more sophisticated techniques

    (Units 2&3) (later courses)

    Multi-level gate circuits

    41

  • Multiple-Output NAND & NOR Circuits42

    Multi-level gate circuits

  • © Iris H.-R. Jiang

    Multiple-Output NAND & NOR Circuits

    If all of the output gates are OR/AND gates, direct conversion to

    a NAND-/NOR-gate circuit is possible

    Multi-level gate circuits

    43

    Level 4 Level 3 Level 2 Level 1

    a

    cb'

    d

    h

    e'

    F1

    F2

    f

    g'

    a

    c'b'

    d

    h'

    e'

    F1

    F2

    f

    g'

    Sol 1: apply the procedure

    Sol 2: use bubbles

    F1 = [(a + b')c + d](e' + f)

    F2 = [(a + b')c + g'](e' + f)h