MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

download MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

of 294

Transcript of MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    1/294

    MELJUN CORTES,BSCS,ACS

    Department of ICTFaculty of Information Technology

    Digital Logic Design

    MELJUNELJUN

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    2/294

    Page 2

    About

    Author: MELJUN CORTES,BSCS,ACS Office:

    Department of Computer Science

    Faculty of Information Technology

    SAINT COLUMBAN COLLEGE Mobile: 09295141799

    Email:

    [email protected]

    *** WEBSITE: http://meljuncortes.blogspot.com

    http://meljun.ning.com

    http://www.meljun2010.multiply.com

    MELJUNELJUN

    mailto:[email protected]://meljuncortes.blogspot.com/http://meljun.ning.com/http://meljun.ning.com/http://meljuncortes.blogspot.com/mailto:[email protected]
  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    3/294

    Page 3

    Content

    1. Introduction2. Function Minimization Methods

    3. Larger Combinational Systems

    4. Sequential Systems

    5. Hardware Design Languages

    MELJUNELJUN

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    4/294

    Page 4

    1. Introduction

    1.1. Review of Number Systems1.2. Switching Algebra and Logic Circuits

    MELJUNELJUN

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    5/294

    Page 5

    Chapter 1. Introduction

    MELJUNELJUN

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    6/294

    Page 6

    1.1. Review of Number Systems

    1.1.1 Number Representation1.1.2 Binary Addition

    1.1.3 Signed Numbers

    1.1.4 Binary Subtraction1.1.5 Binary Coded Decimal (BCD)

    1.1.6 Other Codes

    MELJUNELJUN

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    7/294

    Page 7

    1.1. Review of Number Systems

    1.1.1 Number Representation1.1.2 Binary Addition

    1.1.3 Signed Numbers

    1.1.4 Binary Subtraction1.1.5 Binary Coded Decimal (BCD)

    1.1.6 Other Codes

    MELJUNELJUN

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    8/294

    Page 8

    1.1.1. Number Representation

    Numbers are normally written using a positional number system:

    Base/radix: b (the number of digits) Digits: 0..(b-1)

    0 ai (b-1)

    Binary: b=2, digits:0,1 Decimal: b=10, digits: 0,1,2,3,4,5,6,7,8,9

    Octal: b=8, digits: 0,1,2,3,4,5,6,7

    Hexadecimal: b=16, digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

    mnnnbaaaaaaaaN = ....... 210121)(

    MELJUNELJUN

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    9/294

    Page 9

    1.1.1. Number Representation

    mnnnbaaaaaaaaN = ....... 210121)(

    m

    m

    n

    n

    n

    n babababababaN

    +++++++=

    ............

    1

    1

    0

    0

    1

    1

    1

    1)10(

    ==

    n

    mi

    i

    i baN .)10(

    11101.11(2) = 1x24+1x23+1x22+0x21+1x20+1x2-1+1x2-2=

    29.75(10) MELJUNELJUN

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    10/294

    Page 10

    1.1.1. Number Representation

    Decimal:

    b=10

    Digits: 0,1,2,3,4,5,6,7,8,9

    Eg:

    539.45(10) = 5x102+3x101+9x100+4x10-1+5x10-2

    mnnnaaaaaaaaN = ....... 210121)10( ai = 0..9

    MELJUNELJUN

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    11/294

    Page 11

    1.1.1. Number Representation

    Binary: b=2

    Digits: 0,1

    Eg:

    1011.011(2) = 11 + 0*2-1 + 1*2-2+1*2-3=11 + 0 + 0.25 + 0.125

    = 11.375(10)

    mnnnaaaaaaaaN = ....... 210121)2( ai = 0,1

    bit binary digit

    ==n

    mi

    i

    iaN 2.)10(

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    12/294

    Page 12

    1.1.1. Number Representation

    Binary (cnt)

    n-bit binary number can represent which range?

    an-1 ...a1a0 from 0 to 2n-1

    MSB Most Significant Bit

    LSB Least Significant Bit

    0001 = 1 1001 = 9

    0010 = 2 1010 = 10

    0011 = 3 1011 = 11

    0100 = 4 1100 = 12

    0101 = 5 1101 = 13

    0110 = 6 1110 = 14

    0111 = 7 1111 = 15

    1000 = 8

    MELJUNELJUN

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    13/294

    Page 13

    1.1.1. Number Representation

    Octal:

    b=8

    Digits: 0,1,2,3,4,5,6,7

    Eg:

    503.071(8) = 5x8

    2

    + 0x8

    1

    + 3x8

    0

    + 0x8

    -1

    + 7x8

    -2

    + 1x8

    -3

    mnn aaaaaaaN = ....... 21011)8(

    ai = 0..7

    Hexadecimal:

    b=16

    Digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

    Eg:

    1010 0011(2)= A3(16)

    503.071(16) = 5x162 + 0x161 + 3x160 + 0x16-1 + 7x16-2 + 1x16-3

    ai = 0..Fmnn

    aaaaaaaN

    =....... 21011)16(

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    14/294

    Page 14

    Convert from base b to base 10

    Base b to base 10 conversion

    Eg:0

    1010.11(2) = 10.75

    1010.11(8) = 0*80+1*81+0*82+1*83 + 1*8-

    1+1*8-2 = 0+8+0+512+0.125+0.015625

    A12(16) = 10572 = 2*160

    + 1*161

    + 10*162

    =

    mnnnbaaaaaaaaN = ....... 210121)(

    mm

    nn

    nn babababababaN

    +++++++= ............ 11001111)10(

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    15/294

    Page 15

    110.011(2)=?(10) 6.375

    110.011(8)=?(10) 72.0175

    110.011(16)=?(10) 272.039...

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    16/294

    Page 16

    Convert from base 10 to base b

    Base 10 to base b conversionFor integer part:

    Divide integer part by b until the result is 0

    Write remainders in reverse order to get the converted result.

    For the odd part after .

    Multiply by b until the result is 0

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    17/294

    Page 17

    Convert from base 10 to base 2

    Eg1: 6.625(10) = ?(2)

    The integer part

    Eg2: 20.75(10) = ?(2)

    6 2

    0 3 2

    1 1 2

    1 0

    The odd part after .

    0.625 x 2 = 1.25

    0.25 x 2 = 0.5

    0.5 x 2 = 1.0

    6.625(10) = 110.101(2)

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    18/294

    Page 18

    MELJUN CORTES

    20.75(10) = ?(2)10100.11(2)

    20 2 0.75 * 2 = 1.5

    0 10 2 0.5 * 2 = 1.0 0 5 2

    1 2 2

    0 1 2

    1 0

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    19/294

    Page 19

    MELJUN CORTES

    20.75(10)=?(8)=10100.11(2) = 24.6(8)

    20 8 0.75 * 8 = 6.0

    4 2 8 2 0

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    20/294

    Page 20

    Convert from base 2 to base 2n

    Group from right to left n-bit groups and replace the equivalent values in

    base 2n

    Eg:

    101011(2) = ?(8) 1010.110(2) =12.6(8)

    101011(2) = ?(16) 1010.110(2) =A.C(16)

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    21/294

    Page 21

    Convert from base 2n to base 2

    Each digit in base 2n

    is replaced by n bit in base 2.

    Eg:

    37A.B(16)=?(2) = 0011 0111 1010 . 1011(2)

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    22/294

    Page 22

    Convert from base i to base j

    If both i and j are powers of 2, use base 2 as an intermediatebase:

    Eg: base 8 base 2 base 16

    735.37(8)= 000111011101.01111100(2) = 1DD.7C ?(16)

    Else, use base 10 as an intermediate base:

    Eg: base 5 base 10 base 2

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    23/294

    Page 23

    1.1. Review of Number Systems

    1.1.1 Number Representation1.1.2 Binary Addition

    1.1.3 Signed Numbers

    1.1.4 Binary Subtraction

    1.1.5 Binary Coded Decimal (BCD)

    1.1.6 Other Codes

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    24/294

    Page 24

    1.1.2 Binary Addition

    Binary long addition similar to decimal long addition.

    decimalbinary

    carry 110 11110

    A 2565 10110B 6754 11011

    sum 9319 110001

    Eg: 10101(2) + 11011(2) = 110000 ? (2)

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    25/294

    Page 25

    1.1.2 Binary Addition

    Overflow:

    Occur when the result of addition is out of range of representation

    (the result can not be stored in the predefined number of bits)

    In 8-bit computer, the result of addition of two binary numbers

    10101010 and 11010011 is 9-bit binary number which can not be

    stored in 8-bit => overflow

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    26/294

    Page 26

    1.1.2 Binary Addition

    n-bit adder in computer:A = an-1an-2...a1a0

    B = bn-1bn-2...b1b0

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    27/294

    Page 27

    1.1. Review of Number Systems

    1.1.1 Number Representation1.1.2 Binary Addition

    1.1.3 Signed Numbers

    1.1.4 Binary Subtraction

    1.1.5 Binary Coded Decimal (BCD)

    1.1.6 Other Codes

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    28/294

    Page 28

    1.1.3 Signed Numbers

    Represent sign and amplitudeUse the most-left-bit to represent sign:

    0: positive, 1: negative

    Eg: represent signed numbers using 4 bit:

    +5 = 0101, -5 = 1101, -3 = 1011

    Using 3 right bits to represent amplitude, we can represent from -7 to

    +7.

    Drawbacks:

    +0 = 0000, -0 = 1000 => complex when calculating

    => need an other representation

    2 l t t ti

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    29/294

    Page 29

    2s complement representation

    Most left bit is still sign bit

    Positive and 0 numbers are expressed in usual binary

    format.

    The largest number can be represented is 2n-1-1

    n=8 => largest signed number: 28-1-1 = 127

    Negative numbera is stored as the binary equivalent of 2n-a

    in a n-bit system.

    -3 is stored as 28-3=11111101 in a 8-bit system

    The most negative number can be stored is -2n-1

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    30/294

    Page 30

    2s complement representation

    +10 = 0000 1010 - 10 = 28-10 = 1 0000 0000

    0000 1010

    1111 0110

    - 10 = 1111 0110

    +10 + (-10) = ? 0000 1010

    1111 0110

    1 0000 0000

    2s complement representation

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    31/294

    Page 31

    2 s complement representation

    Procedure to find binary representation of negative numberin 2s complement:

    Find the binary equivalent of the magnitude

    Complement each bit (0=>1, 1=>0)

    Add 1

    Eg: find representation of -13 in 8-bit signed numbersystem using 2s complement:

    Magnitude: 13 = 0000 1101

    Complement: 1111 0010

    Add 1: 1

    -13 = 1111 0011+

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    32/294

    Page 32

    2s complement representation

    Range of representation: Use n bit to represent 2s complement numbers

    Range: -2n-1 => 2n-1-1

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    33/294

    Page 33

    4 bit representation of unsigned and signed (2s complement)

    Binary format Unsigned Signed

    0000 0 0

    0001 1 +1

    0010 2 +2

    0011 3 +3

    0100 4 +4

    0101 5 +5

    0110 6 +60111 7 +7

    1000 8 -8

    1001 9 -7

    1010 10 -6

    1011 11 -5

    1100 12 -4

    1101 13 -3

    1110 14 -2

    1111 15 -1

    2 l t t ti

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    34/294

    Page 34

    2s complement representation

    To find the magnitude of a negative number: Complement each bit

    Add 1

    Eg: 1001 0110(2) = -106?

    0110 1001

    + 1

    01101010 = 106

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    35/294

    Page 35

    Addition of signed numbers

    The reason that 2s complement is so popular is the simplicityof addition.

    To add any two numbers, no matter what the sign of each is,

    we just do binary addition on their representation.

    -5 1011 -5 1011 -5 1011

    +7 0111 +5 0101 +3 0011

    +2 0010 0 0000 -2 1110

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    36/294

    Page 36

    Addition of signed numbers

    Overflow Occur when?

    Add two numbers of the opposite sign?

    Add two positive numbers?

    Add two negative numbers?maybe

    Overflow occurs when adding two numbers with the samesign and the result is in different sign

    0110 0101 = 101

    + 0101 0010 = 82

    1011 0111

    1 1 Review of Number Systems

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    37/294

    Page 37

    1.1. Review of Number Systems

    1.1.1 Number Representation1.1.2 Binary Addition

    1.1.3 Signed Numbers

    1.1.4 Binary Subtraction

    1.1.5 Binary Coded Decimal (BCD)

    1.1.6 Other Codes

    1 1 4 Bi S bt ti

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    38/294

    Page 38

    1.1.4 Binary Subtraction

    Find the 2s complement of the second operand, then add.a b = a + (-b)

    Eg: 7 5 = ?

    5 0101 7 0111

    1010 -5 +1011

    + 1 2 0010

    -5 1011

    1 1 Review of Number Systems

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    39/294

    Page 39

    1.1. Review of Number Systems

    1.1.1 Number Representation1.1.2 Binary Addition

    1.1.3 Signed Numbers

    1.1.4 Binary Subtraction

    1.1.5 Binary Coded Decimal (BCD)

    1.1.6 Other Codes

    Bi C d d D i l BCD

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    40/294

    Page 40

    Binary-Coded Decimal - BCD

    BCD:

    Use four bits (a nibble) to represent

    each of the decimal digits 0 through

    9.

    Eg:

    375 = 0011 0111 0101(BCD)

    Decimal Binary BCD0 0000 0000

    1 0001 0001

    2 0010 0010

    3 0011 0011

    4 0100 0100

    5 0101 0101

    6 0110 0110

    7 0111 0111

    8 1000 1000

    9 1001 1001

    10 1010 0001 0000

    11 1011 0001 0001

    12 1100 0001 0010

    13 1101 0001 0011

    14 1110 0001 0100

    15 1111 0001 0101

    1 1 Review of Number Systems

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    41/294

    Page 41

    1.1. Review of Number Systems

    1.1.1 Number Representation

    1.1.2 Binary Addition

    1.1.3 Signed Numbers

    1.1.4 Binary Subtraction

    1.1.5 Binary Coded Decimal (BCD)

    1.1.6 Other Codes

    ASCII

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    42/294

    Page 42

    ASCII

    American Standard Code for Information Interchange - ASCII

    Use seven bits to represent various characters on the

    standard keyboard as well as a number of control signal

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    43/294

    Page 43

    P bl

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    44/294

    Page 44

    Problems

    1. Convert the following unsigned numbers:

    a. 98.625(10)=?(2)

    b. 11011.011(2)=?(10)

    c. 6A1.1E(16)=?(8)

    2. Represent the following signed numbers:

    a. -74 in 8-bit signed 2s complement.

    b. -74 in 16-bit signed 2s complement.

    1 Introduction

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    45/294

    Page 45

    1. Introduction

    1.1. Review of Number Systems

    1.2. Switching Algebra and Logic Circuits

    1 2 Switching Algebra and Logic Circuits

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    46/294

    Page 46

    1.2. Switching Algebra and Logic Circuits

    1.2.1 Definition of Switching Algebra

    1.2.2 Basic Properties of Switching Algebra

    1.2.3 Manipulation of Algebraic Functions

    1.2.4 Representations of Algebraic Functions

    1.2.5 Implementation of Functions with AND, OR, NOT, NAND,

    NOR, XOR Gates

    1 2 Switching Algebra and Logic Circuits

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    47/294

    Page

    47

    1.2. Switching Algebra and Logic Circuits

    1.2.1 Definition of Switching Algebra

    1.2.2 Basic Properties of Switching Algebra

    1.2.3 Manipulation of Algebraic Functions

    1.2.3 Representations of Algebraic Functions

    1.2.4 Implementation of Functions with AND, OR, NOT, NAND,

    NOR, XOR Gates

    1 2 1 Definition of Switching Algebra

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    48/294

    Page

    48

    1.2.1 Definition of Switching Algebra

    Switching algebra is binary:

    All variables and constant take on 0 or 1.

    Light on/off, switch: up/down, voltage: low/high...

    Quantities which are not naturally binary must be coded into binary

    format. Three operators:

    OR: a+b

    AND: a.b

    NOT: a

    1 2 Switching Algebra and Logic Circuits

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    49/294

    Page

    49

    1.2. Switching Algebra and Logic Circuits

    1.2.1 Definition of Switching Algebra

    1.2.2 Basic Properties of Switching Algebra

    1.2.3 Manipulation of Algebraic Functions

    1.2.3 Representations of Algebraic Functions

    1.2.4 Implementation of Functions with AND, OR, NOT, NAND,

    NOR, XOR Gates

    Basic Properties of Switching Algebra

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    50/294

    Page

    50

    Basic Properties of Switching Algebra

    P1: Commutative: a + b = b + a a.b = b.a

    P2: Associative:

    a + (b + c) = (a + b) + c a.(b.c) = (a.b).cP3:

    a + 0 = a a . 1 = a

    P4: a + 1 = 1 a . 0 = 0

    Basic Properties of Switching Algebra

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    51/294

    Page

    51

    Basic Properties of Switching Algebra

    P5: a + a = 1 a . a = 0

    P6: no coefficient and no exponent

    a + a = a a . a = a n.a=a (a)n=a

    P7: complement

    (a) = a

    P8: distributive:

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

    Basic Properties of Switching Algebra

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    52/294

    Page

    52

    P9: adjacency ab + ab = a (a+b)(a+b)=a

    P10:

    a + ab = a +b a(a+b) = abP11: De Morgan

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

    P12: absorption a + ab = a a(a+b) = a

    Basic Properties of Switching Algebra

    Basic Properties of Switching Algebra

    Basic Properties of Switching Algebra

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    53/294

    Page

    53

    P13: redundant ab+bc+ac = ab+bc

    A B

    C

    Basic Properties of Switching Algebra

    Problems

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    54/294

    Page

    54

    Problems

    1. Prove the following equalities:

    a. xy+y=x+y

    b. xy+xz+yz=xy+xz => prove it incorrect

    c. xyz+yz+xz=z

    d. (x+y)[x(y+z)]+xy+xz = 1

    1 2 Switching Algebra and Logic Circuits

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    55/294

    Page

    55

    1.2. Switching Algebra and Logic Circuits

    1.2.1 Definition of Switching Algebra

    1.2.2 Basic Properties of Switching Algebra

    1.2.3 Manipulation of Algebraic Functions

    1.2.4 Representations of Algebraic Functions

    1.2.5 Implementation of Functions with AND, OR, NOT, NAND,

    NOR, XOR Gates

    Manipulation of Algebraic Functions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    56/294

    Page

    56

    Manipulation of Algebraic Functions

    A literal:

    Is the appearance of a variable or its complement

    Eg: x and x are two different literals

    Expression ab+bcd+ad+e has 8 literals

    A product term:

    Is one or more literal connected by AND operators

    Expression ab+bcd+ad+ehas 4 product terms

    Note: A single literal is also a product term

    Manipulation of Algebraic Functions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    57/294

    Page

    57

    A standard product term - minterm: Is a product term which includes every variable of the

    function, either uncomplemented or complemented.

    Eg: for a function of four variables a,b,c,d:

    the product term abcd is a standard product term

    the product term abd is not

    Manipulation of Algebraic Functions

    Manipulation of Algebraic Functions

    Manipulation of Algebraic Functions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    58/294

    Page

    58

    A sum of product - SOP:

    Is one or more product terms connected by OR operators

    Eg: abc+abc+ac+a

    d

    A canonical sum sum of standard product term

    Is a sum of products expression where all terms are

    standard product terms.

    Eg: A function of three variables a,b,c: abc + abc + abc is a canonical sum

    abc + abc + a is not

    Manipulation of Algebraic Functions

    Manipulation of Algebraic Functions

    Manipulation of Algebraic Functions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    59/294

    Page

    59

    A minimum sum of products:

    Is one of those SOP expression for a function that hasthe fewest number of product terms.

    If there is more than one expression with fewest numberof terms, then minimum is defined as one or more ofthose expressions with the fewest number of literals.

    Eg:

    F1(x,y,z) = xyz+xyz+ xyz+xyz+xyz

    F2(x,y,z) = xy+xy+xyz F3(x,y,z) = xy+xy+xz

    F4(x,y,z) = xy+xy+yz

    Manipulation of Algebraic Functions

    F3,F4 are minimum SOP of F1

    Manipulation of Algebraic Functions

    Manipulation of Algebraic Functions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    60/294

    Page

    60

    A sum term:

    Is one or more literals connected by OR operators

    Eg:

    a + b + c

    b

    A standard sum term - maxterm:

    Is a sum term that includes each variable of the problem,either uncomplemented or complemented

    Eg: For a function of four variables x,y,z,t

    x+y+z+t is a maxterm

    x+y+t is not

    Manipulation of Algebraic Functions

    Manipulation of Algebraic Functions

    Manipulation of Algebraic Functions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    61/294

    Page

    61

    A product of sum POS: Is one or more sum terms connected by AND

    Eg:

    (w+x+y)(w+y+z)(w+x+z)

    w

    A canonical product product of standard sum

    terms:

    Is a product of sum term where all sum terms are standard

    Manipulation of Algebraic Functions

    Manipulation of Algebraic Functions

    Manipulation of Algebraic Functions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    62/294

    Page

    62

    A minimum POS is defined the same way as SOP: fewest number of terms

    the same number of terms => fewest number of literals

    Manipulation of Algebraic Functions

    Manipulation of Algebraic Functions

    Canonical forms

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    63/294

    Page

    63

    Canonical forms

    Properties of minterm/Maxterm: mimj=0 if ij

    =mi if i=j

    Mi+Mj=1 if ij

    = Mi if i=j

    mi=Mi and Mi=mi for every i

    Canonical forms

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    64/294

    Page

    64

    Canonical forms

    An algebraic expression of a Boolean function canbe derived from a given truth table in two ways:

    By summing (ORing) those minterm for which the function

    takes a value 1.

    By multiplying (ANDing) those maxterm for which thefunction takes a value 0.

    Canonical forms

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    65/294

    Page

    65

    Decimal x2 x1 x0 f

    0 0 0 0 0

    1 0 0 1 1

    2 0 1 0 03 0 1 1 0

    4 1 0 0 1

    5 1 0 1 1

    6 1 1 0 17 1 1 1 1

    f(x2,x1,x0)=m1+m4+m5+m6+m7=(1,4,5,6,7)

    f(x2,x1,x0)=M0

    M2

    M3

    = (0,2,3)

    Canonical sum-of-products (SOP)

    Canonical product-of-sums (POS)

    F(a,b,c)= abc+ab

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    66/294

    Page

    66

    ( , , )

    F(a,b,c)=m0+m1+m6 (0,1,6)

    Decimal a b c f

    0 0 0 0 1

    1 0 0 1 1

    2 0 1 0 0

    3 0 1 1 0

    4 1 0 0 0

    5 1 0 1 0

    6 1 1 0 1

    7 1 1 1 0

    1.2. Switching Algebra and Logic Circuits

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    67/294

    Page

    67

    g g g

    1.2.1 Definition of Switching Algebra

    1.2.2 Basic Properties of Switching Algebra

    1.2.3 Manipulation of Algebraic Functions

    1.2.4 Representations of Algebraic Functions

    1.2.5 Implementation of Functions with AND, OR, NOT, NAND,

    NOR, XOR Gates

    1.2.4 Representations of Algebraic Functions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    68/294

    Page

    68

    p g

    Truth table

    Venn diagram

    Karnaugh map

    Truth table

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    69/294

    Page

    69

    List all the possible binary combinations of the independent

    variables and display the corresponding binary values of

    dependant variables.

    Truth table

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    70/294

    Page

    70

    n independent variables and m dependant functions:

    2n rows

    n+m columns 3 independentvariables

    2 dependent

    functions

    23 rows

    Venn diagram

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    71/294

    Page

    71

    g

    Venn diagram using space to present logic

    F(A,B)=A.B

    A B

    C

    F(A,B,C)=C.not(B)

    Venn diagram

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    72/294

    Page

    72

    g

    A A

    A+B A.B

    A.BA+B

    Karnaugh map

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    73/294

    Page 73

    BC

    A00 01 11 10

    00 1 3 2

    14 5 7 6

    C

    AB0 1

    000 1

    01 2 3

    116 7

    10

    4 5

    A Karnaugh map is a graphical method for

    representing the true table of a Boolean function.K-map may be used for any variables number, but

    often at most six.

    Karnaugh map (K-map)

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    74/294

    Page 74

    If variables number is n => 2n cells in K-map.

    2n cells are arranged in logical pattern for minimization

    purpose.

    BC

    A00 01 11 10

    00 1 3 2

    14 5 7 6

    Two-variable K-map

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    75/294

    Page 75

    F(A,B)

    0 1

    2

    3

    AB 0 1

    0

    1

    0 2

    1

    3

    BA 0 1

    0

    1

    Two-variable K-map

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    76/294

    Page 76

    F(A,B) = AB

    0 0

    0 1

    AB 0 1

    0

    1

    Three-variable K-map

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    77/294

    Page 77

    F(A,B,C)

    BC

    A00 01 11 10

    00 1 3 2

    14 5 7 6

    C

    AB

    0 1

    000 1

    012 3

    11 6 7

    104 5

    Three-variable K-map

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    78/294

    Page 78

    F(x,y,z) = xyz + yz + x

    x y z F

    0 0 0 0

    0 0 1 0

    0 1 0 1

    0 1 1 0

    1 0 0 1

    1 0 1 1

    1 1 0 1

    1 1 1 1

    yz

    x

    00 01 11 10

    0 0 0 0 1

    1 1 1 1 1

    z

    xy

    0 1

    00 0 0

    01 1 0

    11 1 1

    10 1 1

    Four-variable K-map

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    79/294

    Page 79

    CD

    AB00 01 11 10

    00

    01

    11

    10

    F(A,B,C,D)

    Four-variable K-map

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    80/294

    Page 80

    F(A,B,C,D) = AB + CD + BCD

    CD

    AB00 01 11 10

    000 0 0 1

    01 0 0 1 1

    11 1 1 1 1

    10 0 0 0 1

    Five-variable K-map

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    81/294

    Page 81

    00 01 11 10ABCD

    00

    01

    11

    10

    00 01 11 10ABCD

    00

    01

    11

    10

    E 0 1

    5 variables Karnaugh Map consists of two4 variables Karnaugh Map connected up/down.

    Six-variable K-map

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    82/294

    Page 82

    1 1

    1 1

    1 1

    00 01 11 10ABCD

    00

    01

    11

    10

    1 1

    1 1

    1 1

    00 01 11 10ABCD

    00

    01

    11

    10

    E 0 1

    1 1

    1 1

    1 1

    00 01 11 10ABCD

    00

    01

    11

    10

    1 1

    1 1

    1 1

    00 01 11 10ABCD

    00

    01

    11

    10

    F

    0

    1

    Karnaugh map with dont care

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    83/294

    Page 83

    CD00 01 11 10

    00

    01

    11

    10

    AB

    1 1

    1 1

    dont care ~ input conditions that not occur

    1.2. Switching Algebra and Logic Circuits

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    84/294

    Page 84

    1.2.1 Definition of Switching Algebra

    1.2.2 Basic Properties of Switching Algebra

    1.2.3 Manipulation of Algebraic Functions

    1.2.4 Representations of Algebraic Functions

    1.2.5 Implementation of Functions with AND, OR, NOT, NAND,

    NOR, XOR Gates

    Basic logic gates

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    85/294

    Page 85

    AND OR NOT

    A B out

    0 0 0

    0 1 0

    1 0 0

    1 1 1

    A B out

    0 0 0

    0 1 1

    1 0 1

    1 1 1

    A out

    0 1

    1 0

    Basic logic gates

    http://en.wikipedia.org/wiki/Image:Or-gate.png
  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    86/294

    Page 86

    NAND NOR XOR

    A B out

    0 0 1

    0 1 11 0 1

    1 1 0

    A B out

    0 0 1

    0 1 01 0 0

    1 1 0

    A B out

    0 0 0

    0 1 11 0 1

    1 1 0

    Implementation of Functions with AND, OR

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    87/294

    Page 87

    Assume all inputs are available in uncomplemented and

    complemented

    F1 = xyz+xyz+xyz+xyz+xyz

    F2 = xy+xy+xz

    Implementation of Functions with AND, OR, NOT

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    88/294

    Page 88

    Complemented inputs can be produced using inverters NOT:

    X

    Y

    Z

    F

    Multilevel circuits

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    89/294

    Page 89

    A circuit is called n-level circuit if the maximum number of

    gates through which one signal must pass from input tooutput

    two-level circuit three-level circuit

    Implementation of Functions with NAND

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    90/294

    Page 90

    Using equivalent change steps, every expression can be

    represented using only NAND gates.

    NOT

    AND

    OR

    A

    B

    A.B (A.B)=A+B

    A

    B

    Implementation of Functions with NAND

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    91/294

    Page 91

    Represent the following expression using only NAND:

    F(a,b,c) = ab + bc + b

    =

    bcbabbcbabbcbab ..=++=++

    Implementation of Functions with NOR

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    92/294

    Page 92

    Using equivalent change steps, every expression can be

    represented using only NOR gates.

    U10A

    7402N

    U11A

    7402N

    U7A

    7402N

    U8A

    7402N

    U9A

    7402N

    A

    B

    ( A' +B' ) ' =A. B

    A'

    B'U3A

    7402N

    A

    ( A+A) ' =A'

    Implementation of Functions with NOR

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    93/294

    Page 93

    Represent the following expression using only NOR:

    F(a,b,c) = ab + bc + b

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    94/294

    Page 94

    Chapter 2.

    Logic Function Minimization Methods

    2. Function Minimization Methods

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    95/294

    Page 95

    2.1 Algebraic Method

    2.2 The Karnaugh Map Method

    2.3 Quine-McCluskey Method

    2. Function Minimization Methods

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    96/294

    Page 96

    What is minimization?

    Number of operands is minimal and number of literal in each operand is

    minimal

    Why minimization needed?

    Minimize electronic components used to construct the circuit to

    implement that expression

    2. Function Minimization Methods

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    97/294

    Page 97

    2.1 Algebraic Method

    2.2 The Karnaugh Map Method

    2.3 Quine-McCluskey Method

    2.1. Algebraic Method

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    98/294

    Page 98

    Use algebraic properties to minimize expressions

    Drawback:

    Heuristic, depending on experience no formal method/procedure

    Manually

    Not sure whether the last expression is minimal or not

    2.1. Algebraic Method

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    99/294

    Page 99

    Eg: Minimize these expressions using algebraic method:

    F0(x,y,z)=xyz+xyz+xyz+xyz

    F1(a,b,c,d)=ab+abc+acd+acd+abcd

    F2(A,B,C,D)=

    F3(x,y,z)=(x+y)(x+y+z)+y F4(a,b,c,d)=(a+b+c)(a+c)(a+b+c)(a+c+d)

    ))(.()( CADCBABCA ++++

    2. Function Minimization Methods

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    100/294

    Page 100

    2.1 Algebraic Method

    2.2 The Karnaugh Map Method

    2.3 Quine-McCluskey Method

    2.2 The Karnaugh Map Method

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    101/294

    Page 101

    1. Minimum Sum of Product Expressions Using the Karnaugh

    Map

    2. Dont Cares

    3. Product of Sums

    4. Minimum Cost Gate Implementation

    5. Five- and Six-Variable Maps

    6. Multiple Output Problems

    Implicant, Prime Implicant

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    102/294

    Page 102

    An implicant of a function is a product term that can be used in a SOP

    CD

    AB00 01 11 10

    00 1 1

    01 1

    11 1 1 1 1

    10

    Implicants of F

    Minterm Groups of 2 Groups of 4

    ABCD ACD AB

    ABCD BCD

    ABCD ABC

    ABCD ABD

    ABCD ABCABCD ABD

    ABCD

    Implicant, Prime Implicant

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    103/294

    Page 103

    A prime Implicant is an implicant which can not be contained

    in any other implicants.

    CD

    AB00 01 11 10

    00 1 1 1

    01 1 1

    11 1 1

    10 1 1 1 1

    B C

    *B D

    *B D

    A D

    A B

    C D

    Essential Prime Implicant

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    104/294

    Page 104

    Essential PI is a PI which contains at least one minterm which

    is not contained in other PI.

    CD

    AB00 01 11 10

    00 1 1 1

    01 1 1

    11 1 1

    10 1 1 1 1

    B C

    *B D

    *B D

    A D

    A B

    C D

    minterm 0 is only contained in PI BD

    minterm 5 is only contained in PI BD

    => BD & BD are two Essential PI

    2.2.1 Minimum Sum of Product Expressions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    105/294

    Page 105

    Rules to minimize using K-map:

    Rule 1: Fill K-map cells with corresponding values

    Rule 2: Group adjacent cells whose values are 1. Number of cells is 2n.

    Rule 3: Each group will be a part of result. Variables in each group will

    be excluded: 2n cells => exclude n variables.

    2.2.1 Minimum Sum of Product Expressions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    106/294

    Page 106

    Step 2: Group adjacent cells whose values are 1. Number

    of cells is 2n.

    CD

    AB00 01 11 10

    00

    011 1

    11 1 1

    10 1 1

    CD

    AB00 01 11 10

    001 1

    01 1 1

    11 1 1

    10 1 1

    2.2.1 Minimum Sum of Product Expressions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    107/294

    Page 107

    Step 3: Each group will be a part of result. Variables in each

    group will be excluded: 2n cells => exclude n variables.

    CD

    AB00 01 11 10

    00

    01 1 1

    11 1 1

    10 1 1

    21 cells => eliminate 1 variable

    22 cells => eliminate 2 variables

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

    2.2.1 Minimum Sum of Product Expressions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    108/294

    Page 108

    Example 1: Minimize these functions using K-map:

    a. F(A,B,C,D) = R(0,2,5,6,9,11,13,14)

    b. F(A,B,C,D) = R(1,3,5,8,9,13,14,15)

    c. F(A,B,C,D) = R(2,4,5,6,7,9,12,13)

    d. F(A,B,C,D)= R(1,3,4,5,7,9,13,14,15)

    e. F(A,B,C,D)=R(1,3,4,6,9,11,12,14)

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    109/294

    Page 109

    a. F(A,B,C,D) = R(0,2,5,6,9,11,13,14)

    = BCD + ABD + BCD + ABD

    CD

    AB00 01 11 10

    001 1

    01 11

    11 1 1

    101

    1

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    110/294

    Page 110

    b. F(A,B,C,D) = R(1,3,4,6,9,11,12,14)

    = BD + BD

    CD

    AB00 01 11 10

    00 1 1

    01 1 1

    11 1 1

    101

    1

    2.2 The Karnaugh Map

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    111/294

    Page 111

    1. Minimum Sum of Product Expressions Using the Karnaugh

    Map

    2. Dont Cares

    3. Product of Sums

    4. Minimum Cost Gate Implementation

    5. Five- and Six-Variable Maps

    6. Multiple Output Problems

    2.2.2 Dont care

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    112/294

    Page 112

    If the function has dont care values in cells:

    Cells with dont care values

    can be grouped with 1 cells

    Do not group only dont

    care cells in one group.

    CD00 01 11 10

    00

    01

    11

    10

    AB

    1 1

    1 1

    CBCBDCBAF +=),,,(

    Examples:

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    113/294

    Page 113

    F(a,b,c,d)=R(1,3,5,7,12,13)dont care (0,4,10,15)

    CD

    AB00 01 11 10

    00- 1 1

    01 - 11

    111 1

    -

    10 -

    2. Function Minimization Methods

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    114/294

    Page 114

    2.1 Algebraic Method

    2.2 The Karnaugh Map Method

    2.3 Quine-McCluskey Method

    2.3 Quine-McCluskey Method

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    115/294

    Page 115

    1. Quine-McCluskey Method for One Output

    2. Iterated Consensus for One Output

    3. Prime Implicant Tables for One Output

    4. Quine-McCluskey for Multiple Output Problems

    5. Iterated Consensus for Multiple Output Problems6. Prime Implicant Tables for Multiple Output Problems

    2.3. Quine-Mcluskey method

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    116/294

    Page 116

    Karnaugh map cannot handle more than 6 variables.Quine-McCluskey method has no limitation with number of

    variables, and is suitable for computer algorithm.

    0 1

    00

    01 111 1 1

    10 1 1

    ABC

    ABC+ABC+ABC+ABC+ABC

    010

    *10 11* 1*0 1*1 10*

    110 111 100 101

    1**

    find a pair of numbers of 1 bit difference

    Quine-Mcluskey Procedure

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    117/294

    Page 117

    1: Represent minterms in binary numbers

    2: Group each minterm by the number of 1 appearance

    3: Make set of 1 bit different numbers between neighboringgroup

    write the difference within parenthesis

    mark * to the number which is not included in a set

    4: Make set of 1 bit different sets with the same number in aparenthesis

    append the difference to parenthesis

    mark + to the set which is not included in a set

    5: Iterate these step until all the generated set is marked *

    6: Select prime implicants

    7: Convert to logic variable

    S1. Represent minterms in binary numbers

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    118/294

    Page 118

    f = ABCDEF+ABCDEF+ABCDEF+ABCDEF+ABCDEF

    +ABCDEF+ABCDEF +ABCDEF+ABCDEF+ABCDEF

    f = 000000+000010+000110+000111+001110

    +001000+101001+001100+001111+001010

    f(A,B,C,D,E,F)=(0,2,6,7,14,8,41,12,15,10)

    S2. Grouping

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    119/294

    Page 119

    f = 000000+000010+000110+000111+001110+001000+101001+001100+001111+001010

    000000

    once twice three times

    000010001000

    000110001100

    001010

    000111001110

    101001

    four times

    001111

    group 0 group 1 group 2 group 3 group 4

    group each term by the appearance of 1

    no times

    S3 & S4. Making set (1)

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    120/294

    Page 120

    000000 0000010 2001000 8

    000110 6001010 10001100 12

    000111 7

    001110 14101001 41

    001111 15

    0,2 (2)0,8 (8)

    2,6(4)

    2,10(8)

    8,10(2)

    8,12(4)

    6,7(1)

    6,14(8)

    10,14(4)

    12,14(2)

    7,15(8)

    14,15(1)

    find a pair of 1 bit difference

    between neighboring group

    write difference within ( )

    mark

    to the number

    not included in any set

    group 0

    group 1

    group 2

    group 3

    group 4

    S3 & S4. Making set (2)

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    121/294

    Page 121

    0,2 (2)0,8 (8)

    2,6(4)

    2,10(8)

    8,10(2)

    8,12(4)

    6,7(1)

    6,14(8)

    10,14(4)

    12,14(2)

    7,15(8)

    14,15(1)

    0,2,8,10(2,8)

    2,6,10,14(4,8)8,10,12,14(2,4)

    6,7,14,15(1,8)

    mark to the set

    not involved

    in the next level set

    when all the set is marked

    finish

    Each pair appears in duplicate

    find a pair of 1 bit different sets

    with the same value in ( )

    between neighboring group

    append difference within ( )

    S6. Selecting Prime Implicants (1)

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    122/294

    Page 122

    41

    0,2,8,10(2,8)

    2,6,10,14(4,8)

    8,10,12,14(2,4)

    6,7,14,15(1,8)

    0 2 6 7 8 10 12 14 15 41

    x x x x

    x

    x x x x

    x x x x

    x x x x

    If only one x in a column, then the row is inevitable implicant

    minterms (given at first)Primei

    mplicant

    marked

    write x into the position where minterm is included

    in the prime implicantinevitable

    implicant

    S6. Selecting Prime Implicants (2)

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    123/294

    Page 123

    41

    0,2,8,10(2,8)2,6,10,14(4,8)

    8,10,12,14(2,4)

    6,7,14,15(1,8)

    0 2 6 7 8 10 12 14 15 41

    x x x x

    x

    x x x x

    x x x x

    x x x x

    mini term

    prim

    eimplicants

    mark minterms involved in the

    inevitable implicants inevitableimplicants

    S7. Conversion to logic variables

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    124/294

    Page 124

    41 101001

    0,2,8,10(2,8)

    000000

    000010

    001000

    001010

    8,10,12,14(2,4)

    001000

    001010

    001100

    001110

    6,7,14,15(1,8)000110

    000111

    001110

    001111

    ABCDEF

    ABDF

    ABCF

    ABDE

    F=ABCDEF+ABDF

    +ABCF

    +ABDE

    Examples:

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    125/294

    Page 125

    Minimize the following functions using Quine-

    Mcluskey method:

    a.

    b. F(a,b,c,d,e,f) =

    (17,21,25,29, 44,45,46,47,49,52,53,54,55,47,61)

    fedbafdcbfebcaefdba +++=f)e,d,c,b,F(a,

    Quine-Mcluskey method with dont care

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    126/294

    Page 126

    1: Represent logic function in sum of mini terms ==>A

    2: Represent dont care in sum of mini terms ==>B

    3: If there exist duplication in A and B, remove from A

    4: Apply Quine-McCluskey method for A and B

    5: Be careful not to include B in selecting prime implicants

    Quine-Mcluskey method with dont care

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    127/294

    Page 127

    f=ABCD+BCD+ACD+ABCD+ABCD

    dont care AD

    mini term

    ABCD

    0000

    00010010

    0011

    0101

    0111

    1011

    1101

    1111

    decimal

    0

    12

    3

    5

    7

    1113

    15

    first comparison second comparison0,1(1)

    0,2(2)

    1,3(2)1,5(4)

    2,3(1)

    3,7(4)

    3,11(8)

    5,7(2)

    5,13(8)

    7,15(8)

    11,15(4)

    13,15(2)

    0,1,2,3(1,2)

    1,3,5,7(2,4)

    3,7,11,15(4,8)5,7,13,15(2,8)

    Quine-Mcluskey method with dont care

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    128/294

    Page 128

    0 2 11 13 15

    0,1,2,3(1,2)

    1,3,5,7(2,4)

    3,7,11,15(4,8)

    5,7,13,15(2,8)

    xx

    x

    x

    x

    x

    00**

    0**1

    **11

    *1*1

    ABCD

    f=AB+CD+BD

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    129/294

    Page 129

    Chapter 3.

    Larger Combinational Systems

    Introduction

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    130/294

    Page 130

    Logic circuits are divided into two classes:

    Combinational logic circuits

    Output signals only depend on current input signals

    Memoryless circuits

    Sequential logic circuits

    Output signals not only depend on current input signals, but also

    depend on those input signals in the past

    Memory circuits

    3. Larger Combinational Systems

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    131/294

    Page 131

    3.1 Delay in Combinational Logic Circuits

    3.2 Adders and Other Arithmetic Circuits

    3.3 Decoders

    3.4 Encoders

    3.5 Multiplexers

    3.6 Demultiplexers

    3.7 Three-State Gates

    3.8 Gate Arrays-ROMs, PLAs and PALs

    3.9 Larger Examples

    3.1 Delay in Combinational Logic Circuits

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    132/294

    Page 132

    Delay through logic gates

    When the input to a gate changes, the output of that gate doesnt

    change immediately; but there is a small delay .

    The output is stable after the longest delay path

    A

    B

    C

    F

    X

    3. Larger Combinational Systems

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    133/294

    Page 133

    3.1 Delay in Combinational Logic Circuits

    3.2 Adders and Other Arithmetic Circuits

    3.3 Decoders

    3.4 Encoders

    3.5 Multiplexers

    3.6 Demultiplexers

    3.7 Three-State Gates

    3.8 Gate Arrays-ROMs, PLAs and PALs

    3.9 Larger Examples

    Half Adder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    134/294

    Page 134

    a b r0 0 0 0

    0 1 1 0

    1 0 1 0

    1 1 0 1

    =a b

    r = ab

    =1

    &

    a

    b

    r

    Half Adder

    HA

    a

    b

    r

    (Result)

    (Carry-out)

    Addition of two n-bit numbers

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    135/294

    Page 135

    4

    3

    2

    1

    0

    r3

    r2

    r1

    r0

    A = a3

    a2

    a1

    a0

    +B = b3 b2 b1 b0

    r4

    3

    r3

    2

    r2

    1

    r1

    0

    Summation

    Full Adder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    136/294

    Page 136

    FAai

    ri

    bi

    i

    ri+1

    ai

    bi

    ri

    i

    ri+1

    0 0 0 0 00 0 1 1 0

    0 1 0 1 0

    0 1 1 0 1

    1 0 0 1 0

    1 0 1 0 1

    1 1 0 0 1

    1 1 1 1 1

    aibi

    ri

    00 01 11 10

    0 1 1

    1 1 1

    i

    aibi

    ri

    00 01 11 10

    0 1

    1 1 1 1

    ri+1

    i= a

    i b

    i r

    i

    ri+1

    = aib

    i+ r

    i(a

    i b

    i)

    Combinational logic circuit design procedure

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    137/294

    Page 137

    Problems: design a combinational logic circuit to do smth.

    Design procedure:

    S1: Find inputs, outputs and relations.

    S2: Construct truth table

    S3: For each output, using K-map to minimize from truth table. S4: Draw the circuit.

    Example 1

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    138/294

    Page 138

    Problem: Design a combinational logic circuit to implement

    this operation: M=N+3, N is 3-bit binary number, the numberof bit of M is selected properly.

    Solution:

    S1: three inputs: n2n1n0

    four outputs: m3m2m1m0

    Example 1

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    139/294

    Page 139

    S1: three inputs: n2n1n0

    four outputs: m3m2m1m0

    S2: truth table

    n2 n1 n0 m3 m2 m1 m0

    0 0 0 0 0 1 1

    0 0 1 0 1 0 0

    0 1 0 0 1 0 1

    0 1 1 0 1 1 0

    1 0 0 0 1 1 1

    1 0 1 1 0 0 0

    1 1 0 1 0 0 1

    1 1 1 1 0 1 0

    S3:

    n1n0

    n2

    00 01 11 10

    0 0 0 0 0

    1 0 1 1 1

    m3

    = n2n

    0+ n

    2n

    1

    n2

    n1

    n0

    m3

    m2

    m1

    m0

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    140/294

    Example 2

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    141/294

    Page 141

    Step 2: truth table

    Step3: using K-map to minimize outputs

    b3 = a1.a0 b1 = 0

    b2 = a1.a0 b0 = a0

    a1 a0 b3 b2 b1 b0

    0 0 0 0 0 0

    0 1 0 0 0 1

    1 0 0 1 0 0

    1 1 1 0 0 1

    Example 2

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    142/294

    Page 142

    Step 4: Draw circuit

    b3 = a1.a0 b1 = 0

    b2 = a1.a0 b0 = a0

    a1

    a0

    b3

    b2

    b1

    b0

    U1A

    7408N

    U1B

    7408N

    U2A

    7404N

    X1

    2.5 V

    X2

    2.5 V

    X3

    2.5 V

    X4

    2.5 V

    R1

    100

    V15 V

    J1

    Key = A

    R2

    100

    V212 V

    J2

    Key = B

    Full Adder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    143/294

    Page 143

    =1

    &

    ri

    ai

    bi

    =1

    &

    i

    ri+1 1

    Full Adder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    144/294

    Page 144

    =1

    &

    ri

    ai

    bi

    =1

    &

    i

    ri+1 1

    HA HA

    n-bit Adder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    145/294

    Page 145

    Serial n-bit adder

    A = an-1an-2...a1a0 , B = bn-1bn-2...b1b0

    FA

    an-1 bn-1

    rn-1

    rn

    n-1

    FA

    an-2 bn-2

    rn-2

    n-2

    FA

    a1 b1

    r1

    r2

    1

    FA

    a0 b0

    r0= 0

    0

    n

    Delay = n x ?

    n-bit Adder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    146/294

    Page 146

    Parallel n-bit adder:

    ri+1

    = aib

    i+ r

    i(a

    i b

    i)

    Pi= a

    i b

    iand G

    i= a

    ib

    i ri+1 = Gi + ri Pi

    r1 = G0 + r0P0

    &

    1G0

    P0

    r0

    r1

    1

    2

    r2

    = G1

    + G0P

    1+ r

    0P

    0P

    1

    &

    1G1

    G0

    P1

    r2

    &P0r0

    Parallel 4-bit addition

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    147/294

    Page 147

    r4 = 4 3 2 1 0

    r2 r1

    a2 b2 a1 b1 a0 b0

    P3 G3 P2 G2 P1 G1 P0 G0

    Calculate Pi and Gi

    a3 b3 a2 b2 a1 b1 a0 b0

    Carry calculation

    Sum calculation

    r0

    a3 b3

    r3r4

    r0

    Subtractor

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    148/294

    Page 148

    To subtract a-b, simply add a to 2s complement ofb.

    Second choice:

    Half Subtractor => Full Subtractor => n-bit Subtractor

    Subtractor

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    149/294

    Page 149

    Subtractor by using 2s complement

    A3A2 A1 A0

    B3 B2 B1 B0

    S3 S2 S1 S0

    1C1C2C3

    C4

    A B

    C

    S

    C+ FAA B

    C

    S

    C+ FA

    A B

    C

    S

    C+ FA

    A B

    C

    S

    C+ FA

    Adder and Subtractor

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    150/294

    Page 150

    C1C2C3C4

    A B

    C

    S

    C+ FAA B

    CS

    C+

    FA

    A B

    CS

    C+

    FA

    A B

    CS

    C+

    FA

    MPX MPX MPX MPX

    A3 A2 A1 A0B3 B2 B1 B0

    S3 S2 S1 S0

    sel

    3. Larger Combinational Systems

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    151/294

    Page 151

    3.1 Delay in Combinational Logic Circuits

    3.2 Adders and Other Arithmetic Circuits

    3.3 Decoders

    3.4 Encoders

    3.5 Multiplexers

    3.6 Demultiplexers

    3.7 Three-State Gates

    3.8 Gate Arrays-ROMs, PLAs and PALs

    3.9 Larger Examples

    Decoder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    152/294

    Page 152

    An nxm decoder is a combinational circuit that converts

    binary information from n input lines to m output lines, wherem2n.

    m = 2n => complete decoder

    Fundamental property: only one output is 1 for any given

    input combination.

    Decoder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    153/294

    Page 153

    Complete decoders: m=2n

    Eg:+ 3 bit inputs x1,x2,x3.

    + 8 bit outputs Y0,Y1Y7

    nxmdecoder..

    ....

    x1

    x2

    xn

    D0

    D1

    Dm-1

    E

    3x8decoder ...

    x1

    x2

    x3

    D0

    D1

    D7

    Design 3x8 decoder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    154/294

    Page 154

    3x8

    decoder ...

    x1

    x2

    x3

    D0

    D1

    D7

    En

    if (En=0)

    Disable or D0...D7=0else if (En=1)

    Function as a 3x8 decoder

    BCD-to-decimal decoder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    155/294

    Page 155

    BCDtodecimalDecoder

    ABCD

    Y0

    Y1

    Yi

    Y9

    :

    :

    N A B C D Y0

    Y1

    .

    .Y

    9

    0 0 0 0 0 1 0 ..

    0

    1 0 0 0 1 0 1 ..

    0

    2 0 0 1 0 0 0 .

    .

    0

    3 0 0 1 1 0 0 ..

    0

    4 0 1 0 0 0 0 ..

    0

    5 0 1 0 1 0 0 ..

    0

    6 0 1 1 0 0 0 ..

    0

    7 0 1 1 1 0 0 ..

    0

    8 1 0 0 0 0 0 ..

    0

    9 1 0 0 1 0 0 . 1

    BCD-to-decimal decoder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    156/294

    Page 156

    = =0 1Y A B C D Y A B C D

    =2Y BCD

    =

    =

    =

    =

    =

    =

    =

    3

    4

    5

    6

    7

    8

    9

    Y BCD

    Y BC D

    Y BC D

    Y BC D

    Y BCD

    Y AD

    Y AD

    CD

    AB00 01 11 10

    00 1

    01

    11 10

    Decoder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    157/294

    Page 157

    4x16 decoder using two 3x8 decoders

    3x8

    decoder ...

    x2

    x3

    x4

    D0

    D1

    D7

    3x8decoder ...

    x1D8

    D9

    D15

    Decoder implementation of arbitrary functions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    158/294

    Page 158

    4x16

    decoderx2

    x3

    x4

    D0D1D2

    x1

    D3D4D5D6D7

    D8D9D10D11D12

    D13D14

    D15

    F1

    F1(x1,x2,x3,x4)=(0,1,3,8,12)

    BCD-to-7segment decoder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    159/294

    Page 159

    a

    b

    c

    d

    e

    f g

    Each segment is a LightEmitting Diode (LED)

    KA

    N A B C D a b c d e f g

    0 0 0 0 0 1 1 1 1 1 1 0

    1 0 0 0 1 0 1 1 0 0 0 0

    2 0 0 1 0 1 1 0 1 1 0 1

    3 0 0 1 1 1 1 1 1 0 0 1

    4 0 1 0 0 0 1 1 0 0 1 1

    5 0 1 0 1 1 0 1 1 0 1 1

    6 0 1 1 0 1 0 1 1 1 1 1

    7 0 1 1 1 1 1 1 0 0 0 0

    8 1 0 0 0 1 1 1 1 1 1 1

    9 1 0 0 1 1 1 1 1 0 1 1

    BCD-to-7segment decoder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    160/294

    Page 160

    CD

    AB

    00 01 11 10

    00 1 0 1 1

    01 0 1 1 1

    11 10 1 1

    = + + +a A C BD B D

    &

    &

    B

    D

    1A

    C

    3. Larger Combinational Systems

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    161/294

    Page 161

    3.1 Delay in Combinational Logic Circuits

    3.2 Adders and Other Arithmetic Circuits

    3.3 Decoders

    3.4 Encoders

    3.5 Multiplexers

    3.6 Demultiplexers

    3.7 Three-State Gates

    3.8 Gate Arrays-ROMs, PLAs and PALs

    3.9 Larger Examples

    Encoder

    A d i i i h f h f i f d d i

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    162/294

    Page 162

    An encoder is a circuit that performs the function of a decoder in reverse.

    An mxn encoder has m inputs, n outputs where m2n. The outputsgenerate the binary codes corresponding to m inputs.

    For example: encoder for PCs keyboard

    Key Character Key code102 keys, 8 bit ASCII

    Keyboard encoder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    163/294

    Page 163

    9 keys

    4-bit key code.

    1

    2

    i Encoder

    9

    P2

    P1

    Pi

    A

    B

    C

    D

    N=i

    1

    P9

    Keyboard encoder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    164/294

    Page 164

    A = 1 if (N=8) or (N=9)

    B = 1 if (N=4) or (N=5) or (N=6)or (N=7)C = 1 if (N=2) or (N=3) or (N=6)

    or (N=7)D = 1 if (N=1) or (N=3) or (N=5)

    or (N=7) or (N=9)

    N ABCD

    1 0001

    2 0010

    3 0011

    4 0100

    5 0101

    6 0110

    7 0111

    8 1000

    9 1001

    Keyboard encoder

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    165/294

    Page 165

    1

    1

    1

    1

    N=9

    N=8

    N=7

    N=6

    N=5

    N=4

    N=3

    N=2

    N=1

    A

    B

    C

    D

    3 1 D l i C bi ti l L i Ci it

    3. Larger Combinational Systems

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    166/294

    Page 166

    3.1 Delay in Combinational Logic Circuits

    3.2 Adders and Other Arithmetic Circuits

    3.3 Decoders

    3.4 Encoders

    3.5 Multiplexors

    3.6 Demultiplexors

    3.7 Three-State Gates

    3.8 Gate Arrays-ROMs, PLAs and PALs

    3.9 Larger Examples

    Multiplexor

    Multiplexor has one output and more than one input

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    167/294

    Page 167

    Multiplexor has one output and more than one input.

    Function: select one of input for output

    X0

    X1

    C0

    Y

    MUX 2-1

    C0 Y

    0 X0

    1 X1

    C1

    C0

    Y

    0 0 X0

    0 1 X1

    1 0 X2

    1 1 X3

    control inputs

    X0

    X1

    X2

    X3

    C0

    C1

    Y

    MUX 4-1

    2-to-1 Multiplexor

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    168/294

    Page 168

    X0

    X1

    C0

    Y

    MUX 2-1

    C0

    Y

    0 X0

    1 X1

    = +0 0 1 0Y X C X C

    X1X0C0

    00 01 11 10

    0 1 1

    1 1 1

    C0

    X1

    X0

    Y

    0 0 0 0

    0 0 1 1

    0 1 0 0

    0 1 1 1

    1 0 0 0

    1 0 1 0

    1 1 0 1

    1 1 1 1

    2-to-1 Multiplexor

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    169/294

    Page 169

    4-to-1 Multiplexor

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    170/294

    Page 170

    Y = s1s0I0 + s1s0I1 +s1s0I2+ s1s0I3

    Application of multiplexor

    Select source

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    171/294

    Page 171

    Select source

    Source 1 Source 2

    Receiver

    Y3 Y2 Y1 Y0

    A = a3 a2 a1 a0 B = b3 b2 b1 b0

    C0

    Application of multiplexor

    Convert parallel serial

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    172/294

    Page 172

    Convert parallel-serial

    a0

    a1

    a2

    a3

    C0

    C1

    Y

    a0 a1 a2 a3

    Y

    C1

    C0

    0

    1

    0

    1

    t

    t

    t

    A

    Application of multiplexor

    Implementation of arbitrary functions:

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    173/294

    Page 173

    Implementation of arbitrary functions:

    = + + +f(A,B) A Bf(0,0) A Bf(0,1) A Bf(1,0) A Bf(1,1)

    = + + +1 0 0 1 0 1 1 0 2 1 0 3Y C C X C C X C C X C C X

    x0

    x1

    x2

    x3C1 C0

    f(0,0)

    f(0,1)

    f(1,0)

    f(1,1)

    A

    B

    Y = f(A,B)Inputs toselectfunction

    Variables

    Example

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    174/294

    Page 174

    F(A,B) = AB + AB

    x0

    x1

    x2

    x3C1 C0

    0

    1

    1

    0

    A

    B

    Y = f(A,B)Inputs toselectfunction

    Variables

    3. Larger Combinational Systems

    3 1 Delay in Combinational Logic Circuits

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    175/294

    Page 175

    3.1 Delay in Combinational Logic Circuits

    3.2 Adders and Other Arithmetic Circuits

    3.3 Decoders

    3.4 Encoders and Priority Encoders

    3.5 Multiplexers

    3.6 Demultiplexers

    3.7 Three-State Gates

    3.8 Gate Arrays-ROMs, PLAs and PALs

    3.9 Larger Examples

    Demultiplexor

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    176/294

    Page 176

    Demultiplexor has one input and more than one output Function: select one of outputs for input

    E

    C0

    S0

    S1

    ECS

    ECS

    01

    00

    =

    =

    DeMUX 1-2

    Demultiplexor 1-4

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    177/294

    Page 177

    E

    C1

    C0

    S0

    S1

    S2

    S3

    3 1 Delay in Combinational Logic Circuits

    3. Larger Combinational Systems

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    178/294

    Page 178

    3.1 Delay in Combinational Logic Circuits

    3.2 Adders and Other Arithmetic Circuits

    3.3 Decoders

    3.4 Encoders and Priority Encoders

    3.5 Multiplexers

    3.6 Demultiplexers

    3.7 Three-State Gates

    3.8 Gate Arrays-ROMs, PLAs and PALs

    3.9 Larger Examples

    3.7 Three-State Gates (Tristate)

    Three state gates exhibit three states instead of two states

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    179/294

    Page 179

    Three state gates exhibit three states instead of two states.

    The three states are: High : 1

    Low : 0

    High impedance : z

    In this state the output is disconnected which is equal to open circuit.In the other words in that state circuit has no logic significant. We can

    have AND or NAND three-state gates but the most common is three-

    state buffer gate

    3.7 Three-State Gates (Tristate)

    We may use conventional gates such as AND or NAND as

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    180/294

    Page 180

    We may use conventional gates such as AND or NAND as

    three-state gates but the most common is three-state buffergate.

    Note that buffer produces transfer function and can be used

    for power amplification. Three state buffer has extra input

    control line entering the bottom of the gate symbol (see nextslide)

    Three-State buffer

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    181/294

    Page 181

    Three-state buffer

    C A Y

    ----------------------

    0 0 z

    0 1 z

    1 0 0

    1 1 1

    Application of three-state buffer

    Three-state buffers can be used to implement

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    182/294

    Page 182

    Three state buffers can be used to implement

    multiplexer

    3. Larger Combinational Systems

    3 1 Delay in Combinational Logic Circuits

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    183/294

    Page 183

    3.1 Delay in Combinational Logic Circuits

    3.2 Adders and Other Arithmetic Circuits

    3.3 Decoders

    3.4 Encoders and Priority Encoders

    3.5 Multiplexers

    3.6 Demultiplexers

    3.7 Three-State Gates

    3.8 Gate Arrays - ROMs, PLAs and PALs

    3.9 Larger Examples

    3.8 Gate Arrays - ROM, PLA and PAL

    PLA - Programmable Logic Arrays

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    184/294

    Page 184

    PLA - Programmable Logic Arrays

    PAL - Programmable Array Logic

    ROM

    PLA - Programmable logic arrays

    Pre-fabricated building block of many AND/OR gates

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    185/294

    Page 185

    Pre fabricated building block of many AND/OR gates

    actually NOR or NAND

    "personalized" by making or breaking connections among the gates

    programmable array block diagram for sum of products form

    inputs

    AND

    array

    outputs

    OR

    arrayproductterms

    A B C Z1 Z2

    0 0 0 0 0 1

    1 0 0 1 0 0

    2 0 1 0 1 1

    3 0 1 1 0 0

    4 1 0 0 0 15 1 0 1 1 0

    6 1 1 0 1 1

    7 1 1 1 1 0

    Before programming

    All possible connections are available before "programming"

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    186/294

    Page 186

    All possible connections are available before programming

    in reality, all AND and OR gates are NANDs

    After programming

    Unwanted connections are "blown"

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    187/294

    Page 187

    Unwanted connections are blown

    fuse (normally connected, break unwanted ones)

    anti-fuse (normally disconnected, make wanted connections)

    A B C

    F1 F2 F3F0

    AB

    B'C

    AC'

    B'C'

    A

    PLA example

    Multiple functions of A, B, C

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    188/294

    Page 188

    p , ,

    F1 = A B C F2 = A + B + C

    F3 = A' B' C'

    F4 = A' + B' + C'

    F5 = A xor B xor C F6 = A xnor B xnor C

    A B C F1F2F3F4F5 F60 0 0 0 0 1 1 0 00 0 1 0 1 0 1 1 1

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

    A'B'C'

    A'B'C

    A'BC'

    A'BC

    AB'C'

    AB'C

    ABC'ABC

    A B C

    F1 F2 F3 F4 F5F6

    full decoder as for memory addresbits stored in memory

    PALs and PLAs

    Programmable logic array (PLA)

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    189/294

    Page 189

    g g y ( )

    what we've seen so far unconstrained fully-general AND and OR arrays

    Programmable array logic (PAL)

    constrained topology of the OR array

    innovation by Monolithic Memories

    faster and smaller OR plane

    a given column of the OR arrayhas access to only a subset of

    the possible product terms

    ROM Read Only Memories

    Two dimensional array of 1s and 0s

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    190/294

    Page 190

    y

    entry (row) is called a "word" width of row = word-size

    index is called an "address"

    address is input

    selected word is output

    decoder

    0 n-1

    Address

    2 -1

    n

    0

    1 1 1 1

    word[i] = 0011

    word[j] = 1010

    bit lines (normally pulled to 1 throughresistor selectively connected to 0by word line controlled switches)

    j

    i

    internal organization

    word lines (only oneis active decoder isjust right for this)

    Example:10 address x 8 data ROM210 words x 8 ROM1024 words x 8 ROM1k x 8 ROM

    ROM Read Only Memories

    Combinational logic implementation (two-level canonical

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    191/294

    Page 191

    F0 = A' B' C + A B' C' + A B' C

    F1 = A' B' C + A' B C' + A B C

    F2 = A' B' C' + A' B' C + A B' C'

    F3 = A' B C + A B' C' + A B C'

    truth table

    A B C F0 F1 F2 F30 0 0 0 0 1 00 0 1 1 1 1 00 1 0 0 1 0 00 1 1 0 0 0 11 0 0 1 0 1 11 0 1 1 0 0 01 1 0 0 0 0 11 1 1 0 1 0 0

    block diagram

    ROM8 words x 4 bits/word

    address outputsA B C F0 F1 F2 F3

    g p (

    form) using a ROM

    ROM structure

    Similar to a PLA structure but with a fully decoded AND array

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    192/294

    Page 192

    y y

    completely flexible OR array (unlike PAL)

    n address lines

    inputs

    decoder 2n word

    lines

    outputs

    memory

    array(2n words

    by m bits)

    m data lines

    3. Larger Combinational Systems

    3.1 Delay in Combinational Logic Circuits

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    193/294

    Page 193

    y g

    3.2 Adders and Other Arithmetic Circuits

    3.3 Decoders

    3.4 Encoders and Priority Encoders

    3.5 Multiplexers

    3.6 Demultiplexers

    3.7 Three-State Gates

    3.8 Gate Arrays-ROMs, PLAs and PALs3.9 Larger Examples

    3.9 Larger Examples

    1. Seven-segment displays

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    194/294

    Page 194

    g p y

    2. Comparator

    Comparator

    1 bit full comparator:

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    195/294

    Page 195

    1-bit full comparator:

    1bit

    Full

    Comparator

    ai

    bi

    Gi

    Li

    Ei

    iii

    iii

    iii

    baEbaL

    baG

    =

    =

    =

    .

    .ai > bi Gi=1

    ai < bi Li=1

    ai = bi Ei=1

    Comparator

    N-bit parallel comparator:

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    196/294

    Page 196

    p p

    Midterm examination (90)

    1. Represent the following function in the canonical form SOP:

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    197/294

    Page 197

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

    2. Use the Quine-McCluskey method to obtain the minimal sum for thefollowing function:

    F(A,B,C,D,E)= (1,4,6,7,8,9,10,11,15)

    3. Design 4x16 decoder using only 2x4 decoders.

    4. Design a combinational logic circuit to calculate the following function:M=N+3 where N is BCD number (Binary-Coded Decimal).

    Midterm examination 2 (90)

    1. Represent the following function in the canonical form SOP and POS:

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    198/294

    Page 198

    F(A,B,C)=C

    2. Use the Quine-McCluskey method to obtain the minimal sum for thefollowing function:

    F(A,B,C,D,E)= (1,4,6,7,8,11,12,13,15)

    3. Using 3x8 decoder to implement the following function:

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

    4. Design a combinational logic circuit to calculate the following function:M=N+5 where N is BCD number (Binary-Coded Decimal).

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    199/294

    Page 199

    Chapter 4.

    Sequential Systems

    4. Sequential Systems

    4.1 Definitions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    200/294

    Page 200

    4.2 State Tables and Diagrams

    4.3 Latches and Flip Flops

    4.4 Analysis of Sequential Systems

    4.5 Design of Sequential Systems

    4.6 Solving Larger Sequential Problems

    4.1 Definitions

    Combinatorial circuit is memoryless.

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    201/294

    Page 201

    In a circuit with memory, an output value at tn+1 must be a

    function not only of the inputs at tn+1 but also of the outputs at

    tn.

    To achieve this, the circuit must have some feedback

    connections from its outputs to its inputs.

    A circuit with memory is a combinatorial circuit

    incorporating some feedback connections.

    Feedback and memory devices

    To implement feedback, signals are fed back from outputs to

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    202/294

    Page 202

    inputs using memory devices.A memory device stores an output value at time tn so that it

    can be input to the circuit at tn+1.

    But then, output at tn depends on input at tn-1, which in turn

    depends on tn-2

    The circuit maps input sequences to output sequences

    Sequential circuit model

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    203/294

    Page 203

    Circuits with memory are called sequential circuits.

    Combinatorial

    circuit

    .

    .

    .

    x1

    x2

    xn

    .

    .

    .

    z1

    z2

    Memorydevice

    Memory

    device

    ..

    .

    Yk

    Y1

    yk

    y1

    Circuit inputs Circuit outputs

    Present state Next state

    Sequential circuit model

    Mealy model:

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    204/294

    Page 204

    X : finite inputs. m inputs: x1,x2...,xm

    S : finite states. n states: s1,s

    2...,s

    n

    Y: finite outputs.l outputs: y1,y

    2...,y

    l

    Fs: state function. s = Fs(X,S)

    Fy : output function. y = Fy(X,S)

    Moore: ~Mealy

    Difference: Fy = Fy(S)

    Asynchronous/Synchronous sequential circuits

    The timing of the signal in the circuit determine two types of

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    205/294

    Page 205

    sequential circuits: Synchronous

    Asynchronous.

    Synchronous sequential circuits

    In a synchronous sequential circuit, the state can change onlyat

    di t i t t f ti

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    206/294

    Page 206

    discrete instants of time.

    To achieve that, the circuit uses a timing device, called a clock

    generator, that produce trains of periodic or aperiodic clock pulses.

    The clock pulses are input to the memory devices so that they can

    change state onlyin response to the arrival of a pulse and only

    once for each pulse occurrence.

    The operation of the circuit is synchronized with the clock pulse input.

    Asynchronous sequential circuits

    The behavior of an asynchronous sequential circuit depends

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    207/294

    Page 207

    onlyon the order in which the inputs change and can beaffected at any instant of time.

    There is no timing device in asynchronous sequential circuit

    (unclocked memory).

    4. Sequential Systems

    4.1 Definitions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    208/294

    Page 208

    4.2 State Tables and Diagrams

    4.3 Latches and Flip Flops

    4.4 Analysis of Sequential Systems

    4.5 Design of Sequential Systems

    4.6 Solving Larger Sequential Problems

    State diagram

    Depict graphically the operation of a sequential circuit.

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    209/294

    Page 209

    Mealy state diagram

    a b c d0/0 1/0 0/0

    0/00/0

    1/0 1/1

    Example of state diagram

    Example: a sequential circuit is used to detect the string

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    210/294

    Page 210

    A B C D0 / 0

    1 / 00 / 0

    1 / 0

    1 / 0

    0 / 0

    0 / 0

    1 / 1

    0101 from one input.

    State diagram

    Depict graphically the operation of a sequential circuit.

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    211/294

    Page 211

    Moore state diagram

    a/0

    b/0

    c/0

    d/0

    e/1

    f/1

    01 0

    0

    0

    0

    1

    1

    1

    1

    1

    State table

    State table presents in a tabular form the same information

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    212/294

    Page 212

    contained in the state diagram. Mealy state table

    Moore state table

    Mealy state table

    0/00/0

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    213/294

    Page 213

    PS NS Output (z)

    x=0 x=1 x=0 x=1

    a b a 0 0

    b b c 0 0

    c d a 0 0

    d b c 0 1

    PS NS/Output (z)

    x=0 x=1

    a b/0 a/0

    b b/0 c/0

    c d/0 a/0

    d b/0 c/1

    PS: Present StateNS: Next State

    k memory devices => 2k rows

    n circuit inputs => NS portion contains 2n columns

    Output portion also contains 2n columns

    a b c d0/0 1/0 0/0

    1/0 1/1

    Moore state table

    1

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    214/294

    Page 214

    PS NS Output

    x=0 x=1 z

    a b a 0

    b b c 0

    c d c 0

    d d e 0

    e f e 1

    f f a 1

    The output portion always contains a single column.

    The entry at the intersection of any row with the output column indicates the

    output values corresponding to the PS associated with that row.

    a/0

    b/0

    c/0

    d/0

    e/1

    f/1

    01 0

    0

    0

    0

    0 1

    1

    1

    1

    Incompletely specified Mealy state table

    Two inputs: x1,x2

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    215/294

    Page 215

    A single output: z

    PS NS/Output (z)

    00 01 11 10a -/- c/1 b/- e/1

    b e/0 -/- -/- -/-

    c f/0 f/1 -/- -/-

    d a/- -/- e/- b/1

    e -/- f/0 d/1 a/0

    f c/0 -/- c/1 b/0

    4. Sequential Systems

    4.1 Definitions

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    216/294

    Page 216

    4.2 State Tables and Diagrams

    4.3 Latches and Flip Flops

    4.4 Analysis of Sequential Systems

    4.5 Design of Sequential Systems4.6 Solving Larger Sequential Problems

    4.3. Latches and Flip-Flops

    Simplest memory devices: Delay element

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    217/294

    Page 217

    TYi yi

    yi(t+T) = Yi(t)

    T

    Yi

    yi

    In practice, we dont have to actually insert delay elements

    because propagation time delays between the inputs and

    the outputs of the combinatorial part of the circuit provide

    sufficient delay across the feedback loops.

    4.3. Latches and Flip-Flops

    Bistable devices:

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    218/294

    Page 218

    Two stable states: Q=0 : the device is reset(reset state)

    Q=1: the device is set(set state)

    A bistable device remains in one of two states indefinitely until directedby an input signal to change state.

    Two types:

    Latch

    Flip-flop

    4.3. Latches and Flip-Flops

    Latch: transparency property:

  • 8/9/2019 MELJUN CORTES - Logic Design & Switching (Digital Logic Design)

    219/294

    Page 219

    Change state when the input values change The new output state is delayed only by the propagation time delays of

    the gates between inputs and outputs of the latch.

    Used to implement the memory part of asynchronous circuits.

    Flip-flop: no transparency property

    Has a control (triggering) input, called clock.

    The state change only in response to a transition of a clock pulse atclock input.

    Used to implement memory part of synchronous circuits

    SR Latch

    Two inputs: S (set), R (reset)

  • 8/9/2019 MELJUN CORTES - Logic Design & S