Chapter 4(Complete)

download Chapter 4(Complete)

of 91

Transcript of Chapter 4(Complete)

  • 8/17/2019 Chapter 4(Complete)

    1/91

    1

    Digital Logic Design

    Chapter 4

  • 8/17/2019 Chapter 4(Complete)

    2/91

    2

    Combinational Logic

    OutlineCombinational Circuits

    AnalysisDesign

    Binary Adder / Subtractor Multiplier Comparator Encoder / Decoder Multiplexers / Demultiplexers

  • 8/17/2019 Chapter 4(Complete)

    3/91

    3

    Combinational Circuits

    RecallSingle/multiple inputs Single output

    Many realistic problems use multiple outputsNamed as combinational circuits

    Combinational circuitOutput depends only on input(s

  • 8/17/2019 Chapter 4(Complete)

    4/91

    4

    Combinational Circuits

    !"at "appens i# $e add memory to t"e circuit%

    Becomes a #eedbac& systemSequential Circuits

  • 8/17/2019 Chapter 4(Complete)

    5/91

    5

    Combinational Circuit

    AnalysisDetermine t"e #unction o# circuit'nstead o# de eloping t"e circuit based on t"e #unction

    Circuit analysisDetermine t"e output #unctions as algebraic expressionsDetermine t"e trut" table o# t"e outputs

    !"at is t"e output #unction o# t"is circuit%

  • 8/17/2019 Chapter 4(Complete)

    6/91

    6

    Combinational Circuit

    AnalysisAnalysis steps)* +abel all gate outputs $it" symbols,* Determine Boolean #unction at t"e output o# eac" gate-* Express #unctions in terms o# input ariables . simpli#y

  • 8/17/2019 Chapter 4(Complete)

    7/91

    7

    Combinational Circuit

    AnalysisAnalysis steps)* +abel all gate outputs $it" symbols,* Determine Boolean #unction at t"e output o# eac" gate-* Express #unctions in terms o# input ariables . simpli#y

  • 8/17/2019 Chapter 4(Complete)

    8/91

    8

    Combinational Circuit Analysis

    Substitution

    y x y x y x

    y y y x y x x x y x y y x x

    xy y xy x yT xT

    yT xT T T F

    yT T

    xT T

    xyT

    ⊕=′+′=

    ′+′+′+′=

    ′+′+′+′=

    ′+′=+=

    ′′′=′=

    ′=

    ′=

    ′=

    )()(

    )()(

    ))()(()()(

    )(

    )(

    11

    1132

    13

    12

    1

  • 8/17/2019 Chapter 4(Complete)

    9/91

    9

    Combinational Circuit Analysis:Exampl

    !"at are t"e outputs ) and , o# t"e #ollo$ing circuit%

    0ere

    T 2 = ABC T 1 = A+B+C

    F 2 = AB + AC + BC

    T 3 = F 2 ’ T 1F 1 = T 3 + T 2

  • 8/17/2019 Chapter 4(Complete)

    10/91

    1!

    Combinational Circuit Analysis:Exampl

    Analysis by trut" table

  • 8/17/2019 Chapter 4(Complete)

    11/91

    11

    Combinational Circuit " sign

    Design procedure)* Determine t"e number o# inputs and outputs,* Assign symbols-* Deri e t"e trut" table1* Obtain simpli#ied #unctions #or eac" output2* Dra$ t"e logic diagram

    3rut" tables4 input and output columns

    Multiple met"ods to sol eBoolean algebra5 map met"ods5 computer aided solution

    'ssues to consider Number o# gates6ate inputs7ropagation delayNumber o# interconnections

  • 8/17/2019 Chapter 4(Complete)

    12/91

    12

    Combinational Circuit " sign:Exampl

    Design a circuit t"at con erts a BCD digit to Excess8-code

  • 8/17/2019 Chapter 4(Complete)

    13/91

    13

    Combinational Circuit " sign:Exampl

    Design a circuit t"at con erts a BCD digit to Excess8-code

    Step )4 'nputs and Outputs'nput4 BCD digit

    1 inputs4 A5 B5 C5 D

    Output4 Excess8- digit1 outputs4 $5 x5 y5 9

    Step ,4 3rut" table

  • 8/17/2019 Chapter 4(Complete)

    14/91

    14

    Combinational Circuit " sign:Exampl

    Step -4 Minimi9e output #unctions

  • 8/17/2019 Chapter 4(Complete)

    15/91

    15

    Combinational Circuit " sign:Exampl

    Step -4 Minimi9e output #unctions

  • 8/17/2019 Chapter 4(Complete)

    16/91

    16

    Combinational Circuit " sign:Exampl

    Step 14 Simpli#icationz = D’ y = CD+C’D’ = CD+(C+D)’

    x = B’C+B’D+BC’D’ = B’(C+D)+BC’D’ = B’(C+D)+B(C+D)’ w = A+BC+BD

    = A+B(C+D)

    Step 24 Circuit Diagram

  • 8/17/2019 Chapter 4(Complete)

    17/91

    17

    Combinational Circuit " sign:ExamplStep 24 Circuit Diagram

  • 8/17/2019 Chapter 4(Complete)

    18/91

    18

    #inary A$$ rs

    Addition is important #unction in computer system

    !"at does an adder do% Add binary digits6enerate carry i# necessaryConsider carry #rom pre ious computation

    Binary adders operate bit8$ise A ):8bit adder uses ): one8bit adders

    Binary adders come in t$o #la ors0al# adder adds t$o bits and generates result and carry

    ull adder considers carry input in addition to "al# adder 3$o "al# adders ma&e one #ull adder

  • 8/17/2019 Chapter 4(Complete)

    19/91

    19

    #inary %al& A$$ r

    SpecificationDesign a circuit t"at adds t$o bits and generates t"e sum and a carry

    Input / Output

  • 8/17/2019 Chapter 4(Complete)

    20/91

    2!

    #inary %al& A$$ r

    SpecificationDesign a circuit t"at adds t$o bits and generates t"e sum and a carry

    Input/Output

    3$o inputs4 x, y 3$o output4 S (sum 5 C (carry

    Functionality

  • 8/17/2019 Chapter 4(Complete)

    21/91

    21

    #inary %al& A$$ r

    SpecificationDesign a circuit t"at adds t$o bits and generates t"e sum and a carry

    Input/Output

    3$o inputs4 x, y 3$o output4 S (sum 5 C (carry

    Functionality

  • 8/17/2019 Chapter 4(Complete)

    22/91

    22

    #inary %al& A$$ r

  • 8/17/2019 Chapter 4(Complete)

    23/91

    23

    #inary %al& A$$ r

  • 8/17/2019 Chapter 4(Complete)

    24/91

    24

    'ull A$$ r

    0al# adder $or&s only #or a single bit!"en multiple bits are in ol ed5 carry bits s"ould be consideredSolution ull adder

    Specifications A circuit t"at adds t"ree bits andgenerates sum and carry

    Input/output

    3"ree inputs4 x5 y5 C in3$o outputs4 S (Sum 5 C out (Carry

    Truth table

  • 8/17/2019 Chapter 4(Complete)

    25/91

    25

    'ull A$$ r

    0al# adder $or&s only #or a single bit!"en multiple bits are in ol ed5 carry bits s"ould be consideredSolution ull adder

    Specifications A circuit t"at adds t"ree bits andgenerates sum and carry

    Input/output

    3"ree inputs4 x5 y5 C in3$o outputs4 S (Sum 5 C out (Carry

    Truth table

  • 8/17/2019 Chapter 4(Complete)

    26/91

    26

    'ull A$$ r

    Deri e and minimi9e Boolean expressions

  • 8/17/2019 Chapter 4(Complete)

    27/91

    27

    'ull A$$ r

    Deri e and minimi9e Boolean expressions

    xyC y x yC xC xyC C y x xyC C y xC y xC y xS

    inininout

    ininininin

    +⊕=++=

    ⊕⊕=+′′+′′+′′=

    )(

  • 8/17/2019 Chapter 4(Complete)

    28/91

    28

    'ull A$$ r

    Circuit

  • 8/17/2019 Chapter 4(Complete)

    29/91

    29

    'ull A$$ r &rom %al& A$$ rs

    0o$ can t$o "al# adders ma&e a #ull adder%

    Obser ations3"ree inputs x5 y5 9 can be added in t$o steps

    x+y+z = (x+y) + z

    !"at about t"e carry%Carry can occur $"en adding x+y and $"en adding 9

    ull adder4 S ; x ⊕ y ⊕ z , C = xy + (x ⊕ y)z

  • 8/17/2019 Chapter 4(Complete)

    30/91

    3!

    'ull A$$ r &rom %al& A$$ rs

  • 8/17/2019 Chapter 4(Complete)

    31/91

    31

    #inary n(bit A$$ r

    0o$ can $e build an n8bit adder #rom #ull adders%One adder #or eac" bit ( n totalConnect carry to next adder

  • 8/17/2019 Chapter 4(Complete)

    32/91

    32

    )ippl Carry A$$ r

    0o$ long does it ta&e to complete an addition%Carry needs to propagate t"roug" circuit > a problem

    Speed o# addition is criticalundamental arit"metic operation

    0o$ can $e speed up addition%Determine carries a"ead o# time (carry loo&8a"ead

  • 8/17/2019 Chapter 4(Complete)

    33/91

    33

    Carry(Loo*a+ a$ A$$ r

    Recallor t"e design o# t"e parallel adder to $or&5 t"e signal must propagate

    t"roug" t"e gates be#ore t"e correct output sum is a ailableTotal propagation time = propagation delay of atypical gate x the number of gates

    +et

  • 8/17/2019 Chapter 4(Complete)

    34/91

    34

    Carry(Loo*a+ a$ A$$ r

    ull adder4 S i ; A i ⊕Bi ⊕C i , C i+1 = A i .B i + (A i ⊕Bi ).C i Create new signals

    G i ; A i .B i carry generate #or stage i

    P i = A i⊕ B i carry propagate #or stage i

    ull adder e=uations expressed in terms o# G i and P i S i = P i⊕ C i C i+1 = G i + P i C i

  • 8/17/2019 Chapter 4(Complete)

    35/91

    35

    Carry(Loo*a+ a$ A$$ r

    ull adder #unctionality can be expressedrecursi ely

    S i = P i⊕ C i

    C i+1 = G i + Pi C i

    Carry o# eac" stageC = in!"# $a%%y

    C 1 = G + P C C 2 = G 1 + P 1C 1 = G 1 + P 1 (G + P C ) = G 1 + P 1G + P 1P C C 3 = G 2 + P 2 C 2 = & = G 2 + P 2 G 1 + P 2 P 1G + P 2 P 1P C C ' = G 3 + P 3G 2 + P 3P 2 G 1 + P 3P 2 P 1G + P 3P 2 P 1P C

  • 8/17/2019 Chapter 4(Complete)

    36/91

  • 8/17/2019 Chapter 4(Complete)

    37/91

    37

    4(bit A$$ r ,it+ CarryLoo*a+ a$

    Complete adder Same number o# stages#or eac" bit

    Dra$bac&%'ncreasing complexity o#loo&a"ead logic #or morebits

  • 8/17/2019 Chapter 4(Complete)

    38/91

    38

    -ubtraction

    0o$ can $e per#orm subtraction%Subtract one number #rom anot"er

    Do $e need subtractors% Actually notSubtraction can be done using adders

    * = . (,

  • 8/17/2019 Chapter 4(Complete)

    39/91

    39

    -ubtraction

    0o$ to ta&e )

  • 8/17/2019 Chapter 4(Complete)

    40/91

    4!

    -ubtraction

    Same circuit #or Adder and subtractor Can $e do somet"ing %?es

    @OR gate x ⊕ ; x (use #or Addition x ⊕ ) ; x’ (use #or Subtraction

  • 8/17/2019 Chapter 4(Complete)

    41/91

    41

    #inary -ubtractor

    Adder/Subtractor circuit

  • 8/17/2019 Chapter 4(Complete)

    42/91

    42

    ./ r0o,

    n8bit addition can generate ( n+1 8bit number Called o er#lo$Needs to be detected by computer system

    0o$ can $e detect o er#lo$ in addition%

    End carry

    Also necessary #or signed numbers or subtractionMost signi#icant bit indicates sign

    '# carry into sign position and out o# sign position di##er5 t"en o er#lo$Result $ould be correct $it" extra positionCan be detected by @OR gateCan be used as input carry #or next adder circuit

  • 8/17/2019 Chapter 4(Complete)

    43/91

    43

    ./ r0o, Con$itions

    O er#lo$ conditions3"ere is no o er#lo$ i# signs are di##erent ( ! s + neg 5 or neg + ! s

    O er#lo$ can "appen only $"en bot" numbers "a e same sign5 and'# carry in# sign position and "# o# sign position di##er

    Example4 ,

  • 8/17/2019 Chapter 4(Complete)

    44/91

    44

  • 8/17/2019 Chapter 4(Complete)

    45/91

    45

    #C" A$$ r

    Add t$o decimal numbers( > .( > .() ; >) don

  • 8/17/2019 Chapter 4(Complete)

    46/91

    46

    #C" A$$ r rut+ abl

  • 8/17/2019 Chapter 4(Complete)

    47/91

    47

    #C" A$$ r rut+ abl

  • 8/17/2019 Chapter 4(Complete)

    48/91

    48

    #C" A$$ r

    '# C;)5 need to add : to t"e binary sum0o$ to implement%

    Need anot"er adder

  • 8/17/2019 Chapter 4(Complete)

    49/91

    49

    #C" A$$ r

  • 8/17/2019 Chapter 4(Complete)

    50/91

    5!

    #C" A$$ r

  • 8/17/2019 Chapter 4(Complete)

    51/91

    51

    ultipli r

    7roduct is ) $"en bot" inputs are ) AND gate

    ,8bit multiplier

  • 8/17/2019 Chapter 4(Complete)

    52/91

    52

    ultipli r

    Circuit diagram

  • 8/17/2019 Chapter 4(Complete)

    53/91

    53

    ultipli r

    18bit x -8bit multiplier F;-5 G;1

    0o$ many AND gatesF x G gates

    0o$ many adders(F8) G8bit adders

    0o$ many output bitsF . G bits

  • 8/17/2019 Chapter 4(Complete)

    54/91

    54

    agnitu$ Comparator

    Need to compare t$o numbers4 A and B AHB5 AIB5 A;B

    0o$ can $e determine t"at t$o numbers are e=ual%E=ual i# e ery digit is e=ual

    A 3 A 2 A 1 A = B 3 B2 B1 B i# and only i# A 3 = B 3 and A 2 = B 2 and A 1 = B 1 and A =B

    !"ic" gate%@NOR (E=ui alence

    !"at about A B and A - B %

  • 8/17/2019 Chapter 4(Complete)

    55/91

    55

    agnitu$ Comparator

    Case )4 A H B+oo& at most signi#icant bit $"ere A and B di##er

    '# A = 1 and B = 5 t"en A - B'# not5 t"en A B

    unctionality ( 18bits )'# di##erence in #irst digit4 A - B- <

    '# di##erence in second digit4 x-A , B , <Conditional t"at A - ; B - (x - ;) i# 4 A - ;B -

    Similar #or all ot"er digits

    or A H B(A H B = A - B-

  • 8/17/2019 Chapter 4(Complete)

    56/91

    56

    agnitu$ Comparator

    Case ,4 A I Bs$ap A and B #or A - B

    unctionality

    (A = B) = x 3 x 2 x 1 x (A - B) = A 3B3’+ x 3 A 2 B2 ’ +

    x 3 x 2 A 1B1’ + x 3 x 2 x 1 A B ’ (A B) = A 3’B3+ x 3 A 2 ’B2 +

    x 3 x 2 A 1’B1 + x 3 x 2 x 1 A ’B

    Can be extended to arbitrarynumber o# bits

  • 8/17/2019 Chapter 4(Complete)

    57/91

    57

    .t+ r Arit+m tic #loc*s

    Encoders (Enc

    Decoders (Dec

    Multiplexers (Mux

    De8multiplexers (DeMux

    3ri8state logic

  • 8/17/2019 Chapter 4(Complete)

    58/91

    58

    oti/ation AL " sign

    A+J > Arit"metic and +ogic Jnit Add5 Subtract5 AND5 OR

  • 8/17/2019 Chapter 4(Complete)

    59/91

    59

    oti/ation C " sign

    'nstruction Management

  • 8/17/2019 Chapter 4(Complete)

    60/91

    6!

    " co$ r

    Selects one output based on a binary inputCon erts n8bit code into 2 n outputs5 only one being acti e#or any combination o# inputsSelects output x i# input is binary representation o# x

    ApplicationsBinary8to8octal decoder Memory address selection

    Selection o# any &ind

  • 8/17/2019 Chapter 4(Complete)

    61/91

    $

  • 8/17/2019 Chapter 4(Complete)

    62/91

    62

    " co$ r: Circuit

    !"en is output c"osen%'# x’ y’ z’

    !"en is output ) c"osen%'# x’ y’ z

    Circuit #or line decoder Se=uence o# mintermsCombine ariables tominterms

    $ $ $

  • 8/17/2019 Chapter 4(Complete)

    63/91

    63

    A$/anc $ " co$ r

    Sometimes5 you need to acti ate circuitsReason4 3a&e output only $"en re=uiredSolution4 Jse enable pins

    Decoder $it" enable6enerates output only $"en acti e8lo$ enable is "ig"

    Example4,8to818line decoder $it" enableNAND implementation

    $ $ $

  • 8/17/2019 Chapter 4(Complete)

    64/91

    64

    A$/anc $ " co$ r

    Enable bit allo$s construction o# large decoders usingsmaller onesExample4 Construct a 18to8): decoder only using -8to8Kdecoders

    Acti e8"ig" enable

    Can $e use t"is circuitto construct a 28to8-,decoder%

    NO Absence o# enable

    $ l

  • 8/17/2019 Chapter 4(Complete)

    65/91

    65

    " co$ rs: Exampl

    Design a #ull adder using a -8to8K8line decoder 3rut" table

    E $

  • 8/17/2019 Chapter 4(Complete)

    66/91

    66

    Enco$ rs

    3ranslates 2 n input lines into n output lines'nput4 2 n linesOutput4 n bitsOutput is binary coding o# input t"at is )

    3rut" table (n;- (positi e polarityNote4 only one input is allo$ed to be acti e

    E $

  • 8/17/2019 Chapter 4(Complete)

    67/91

    67

    Enco$ rs

    x ; D 1 . D 2 . D : . D Ly ; D , . D - . D : . D L9 ; D ) . D - . D 2 . D L Can you see any problem "ere%

    0o$ many OR gates are re=uired%

    E $ bl

  • 8/17/2019 Chapter 4(Complete)

    68/91

    68

    Enco$ rs: robl ms

    Only one input can be acti e at a timeSimultaneous acti e inputs result in unde#ined output

    !"en all inputs are 9eroE=ual to t"e case $"en D A is )

    Example'# D- and D: are acti e simultaneously5 $"at is t"eoutput%)))

    0o$ can $e sol e t"is problem%!"at s"ould t"e output be i# multiple lines are acti e%Di##erent solutions4

    Any one (random6i e priority to lo$er or "ig"er lines'ndicate in alid input (re=uires extra bit5 /ali0 i# V

    x ; D1. D2 .D: . DLy ; D,

    . D- .D: . DL9 ; D). D- .D2 . DL

    i i E $

  • 8/17/2019 Chapter 4(Complete)

    69/91

    69

    riority Enco$ r

    Simple encoder5 $it" additional #unctionality'# multiple inputs are )5 gi e priority to one o# t"em

    Example4 18to8) priority encoder $it" priority gi en to one bit

    !"ic" bit "as t"e "ig"est priority%D-

    i i E $

  • 8/17/2019 Chapter 4(Complete)

    70/91

    7!

    riority Enco$ r

    alid bit = D + D 1 + D 2 + D 3

    i i E $

  • 8/17/2019 Chapter 4(Complete)

    71/91

    71

    riority Enco$ r

    Circuit diagram

    x = D 2 + D 3y = D 3 + D 1D2 ’

    = D + D 1 + D 2 + D 3

    lti l

  • 8/17/2019 Chapter 4(Complete)

    72/91

    72

    ultipl x r

    Selects #rom ) o# many inputs and directs it to t"e output

    Input, n lines

    Output) line

    Selection may be controlled by select lines

    lti l

  • 8/17/2019 Chapter 4(Complete)

    73/91

    73

    ultipl x r

    E a!ple,8to8) MJ@

    0o$ to design%18to8) MJ@Selection code directs input

    4(t (1

  • 8/17/2019 Chapter 4(Complete)

    74/91

    74

    4(to(1

    !"at are t"e alues o# ?%

    lti l

  • 8/17/2019 Chapter 4(Complete)

    75/91

    75

    ultipl x r

    A MJ@ only selects one bit(output

    0o$ to select multiple bits(outputs %E a!ple" !"at i# you $ant toc"oose one o# t$o 18bitnumbers%

    Solution4 Jse multiple MJ@

    uadruple ,8to8) line MJ@

    Enable bit sets output to i# )

  • 8/17/2019 Chapter 4(Complete)

    76/91

    s s &or #ool n

  • 8/17/2019 Chapter 4(Complete)

    77/91

    77

    s s &or #ool an'unctions

    Example(x5y59 ; Σ ()5,5:5L

    3rut" table

    s s &or #ool an

  • 8/17/2019 Chapter 4(Complete)

    78/91

    78

    s s &or #ool an'unctions

    s s &or #ool an

  • 8/17/2019 Chapter 4(Complete)

    79/91

    79

    s s &or #ool an'unctions

    Example(x5y59 ; Σ ()5-515))5),5)-5)15)2

    s s &or #ool an

  • 8/17/2019 Chapter 4(Complete)

    80/91

    8!

    s s &or #ool an'unctions

    s s &or #ool an

  • 8/17/2019 Chapter 4(Complete)

    81/91

    81

    s s &or #ool an'unctions

    E a!ple"Design a #ull adder using MJ@es

    ExpressionsS(x5y59 ; ()5,515L P C(x5y59 ; (-525:5L

    s s &or #ool an

  • 8/17/2019 Chapter 4(Complete)

    82/91

    82

    s s &or #ool an'unctions

    " multipl x r "

  • 8/17/2019 Chapter 4(Complete)

    83/91

    83

    multipl x r

    Recei es in#ormation #rom ) input and directs it to one o#2 n possible outputs

    'nputData bitn selection lines

    Output, n lines

    Can be ac"ie ed by decoder circuit $it" enable D acti elo$

    Enable D acts as data bit ( disablen code lines act as selection

    +r ( tat ri(stat at s

  • 8/17/2019 Chapter 4(Complete)

    84/91

    84

    +r (-tat ri(stat at s

    !"at is t"e trut" table #or F %

    3"e t$o gates $ill try to dri e F at t"e same timeNot a good idea to $ire t"eir outputs

    Sometimes it is necessary to disconnect a gate

    3"ree state4 or ) Boolean alue0ig" impedance 5 state

    0ig" impedance acts as i# gate $ere disconnected

    ultipl x r it+ ri(stat

  • 8/17/2019 Chapter 4(Complete)

    85/91

    85

    ultipl x r ,it+ ri(statat s,8to8) MJ@

    18to8) MJ@ $it" Enable

    robl ms

  • 8/17/2019 Chapter 4(Complete)

    86/91

    86

    robl ms

    robl ms

  • 8/17/2019 Chapter 4(Complete)

    87/91

    87

    robl ms

    robl ms

  • 8/17/2019 Chapter 4(Complete)

    88/91

    88

    robl ms

    robl ms

  • 8/17/2019 Chapter 4(Complete)

    89/91

    89

    robl ms

    robl ms

  • 8/17/2019 Chapter 4(Complete)

    90/91

    9!

    robl ms

    robl ms

  • 8/17/2019 Chapter 4(Complete)

    91/91

    robl ms