+ All Categories
Home > Documents > Combinational Logic.pdf

Combinational Logic.pdf

Date post: 27-Feb-2018
Category:
Upload: samuel
View: 236 times
Download: 0 times
Share this document with a friend

of 34

Transcript
  • 7/25/2019 Combinational Logic.pdf

    1/34

    CS1026 1

    Combinational LogicCombinational Logic

    Logic circuits for digital systems may be combinational orLogic circuits for digital systems may be combinational or

    sequential.sequential.

    A combinational circuit consists of logic gates whose outputs atA combinational circuit consists of logic gates whose outputs at

    any time are determined from only the present combination ofany time are determined from only the present combination of

    inputs.inputs.

    A combinational circuit performs an operation that can beA combinational circuit performs an operation that can be

    specified logically by a set of oolean functions.specified logically by a set of oolean functions.

    !n contrast" sequential circuits employ storage elements in!n contrast" sequential circuits employ storage elements in

    addition to logic gates. #heir outputs are a function of theaddition to logic gates. #heir outputs are a function of the

    inputs and the state of the storage elements.inputs and the state of the storage elements.

  • 7/25/2019 Combinational Logic.pdf

    2/34

    CS1026 2

    $or n input %ariables" there are 2&n$or n input %ariables" there are 2&npossible combinations of the binarypossible combinations of the binary

    inputs. $or each possible inputinputs. $or each possible inputcombination" there is one possiblecombination" there is one possible%alue for each output %ariable. #hus" a%alue for each output %ariable. #hus" acombinational circuit can be specifiedcombinational circuit can be specifiedwith a truth table that lists the output %alues for each combination of input %ariables.with a truth table that lists the output %alues for each combination of input %ariables.A combinational circuit also can be described by m oolean functions" one for eachA combinational circuit also can be described by m oolean functions" one for each

    output %ariable. 'ach output function is e(pressed in terms of the n input %ariables.output %ariable. 'ach output function is e(pressed in terms of the n input %ariables.

  • 7/25/2019 Combinational Logic.pdf

    3/34

    CS1026 )

    #here are se%eral combinational circuits that are employed#here are se%eral combinational circuits that are employed

    e(tensi%ely in the design of digital systems.e(tensi%ely in the design of digital systems.

    #hese circuits are a%ailable in integrated circuits and are#hese circuits are a%ailable in integrated circuits and are

    classified as standard components. #hey perform specific digitalclassified as standard components. #hey perform specific digitalfunctions commonly needed in the design of digital systems.functions commonly needed in the design of digital systems.

    #he most important standard combinational circuits#he most important standard combinational circuits

    are adders" subtractors" comparators" decoders" encoders"are adders" subtractors" comparators" decoders" encoders"

    and multiple(ers.and multiple(ers.

    #hese components are a%ailable in integrated circuits as#hese components are a%ailable in integrated circuits as

    medium*scale integration +,S!- circuits.medium*scale integration +,S!- circuits.

  • 7/25/2019 Combinational Logic.pdf

    4/34

    CS1026

    A / A L S ! S 3 C ' 4 5 'A / A L S ! S 3 C ' 4 5 '

    #he analysis of a combinational circuit requires that we#he analysis of a combinational circuit requires that we

    determine the function that the circuit implements.determine the function that the circuit implements.

    #his tas starts with a gi%en logic diagram and culminates with#his tas starts with a gi%en logic diagram and culminates with

    a set of oolean functions" a truth table" or" possibly" ana set of oolean functions" a truth table" or" possibly" ane(planation of the circuit operation.e(planation of the circuit operation.

  • 7/25/2019 Combinational Logic.pdf

    5/34

    CS1026 7

    1. Label all gate outputs that are a function of input %ariables1. Label all gate outputs that are a function of input %ariables

    with arbitrary symbols8but with meaningful names.with arbitrary symbols8but with meaningful names.

    4etermine the oolean functions for each gate output.4etermine the oolean functions for each gate output.

    2. Label the gates that are a function of input %ariables and2. Label the gates that are a function of input %ariables and

    pre%iously labeled gates with other arbitrary symbols.pre%iously labeled gates with other arbitrary symbols.

    $ind the oolean functions for these gates.$ind the oolean functions for these gates.

    ). epeat the process outlined in step 2 until the outputs of the). epeat the process outlined in step 2 until the outputs of the

    circuit are obtained.circuit are obtained.

    . y repeated substitution of pre%iously defined functions" obtain. y repeated substitution of pre%iously defined functions" obtain

    the output oolean functions in terms of input %ariables.the output oolean functions in terms of input %ariables.

    A / A L S ! S 3 C ' 4 5 'A / A L S ! S 3 C ' 4 5 '

  • 7/25/2019 Combinational Logic.pdf

    6/34

    CS1026 6

  • 7/25/2019 Combinational Logic.pdf

    7/34

    CS1026 9

    #he deri%ation of the truth table for a circuit is a straightforward#he deri%ation of the truth table for a circuit is a straightforward

    process once the output oolean functions are nownprocess once the output oolean functions are nown

    1. 4etermine the number of input %ariables in the circuit. $or n1. 4etermine the number of input %ariables in the circuit. $or n

    inputs" form the 2&n possible input combinations and list the binaryinputs" form the 2&n possible input combinations and list the binary

    numbers from 0 to +2&n * 1- in a table.numbers from 0 to +2&n * 1- in a table.

    2. Label the outputs of selected gates with arbitrary symbols.2. Label the outputs of selected gates with arbitrary symbols.

    ). 3btain the truth table for the outputs of those gates which are). 3btain the truth table for the outputs of those gates which are

    a function of the input %ariables only.a function of the input %ariables only.

    . roceed to obtain the truth table for the outputs of those gates. roceed to obtain the truth table for the outputs of those gates

    which are a function of pre%iously defined %alues until the columnswhich are a function of pre%iously defined %alues until the columns

    for all outputs are determined.for all outputs are determined.

  • 7/25/2019 Combinational Logic.pdf

    8/34

    CS1026 :

    0 0 00 0 0

  • 7/25/2019 Combinational Logic.pdf

    9/34

    CS1026 ;

  • 7/25/2019 Combinational Logic.pdf

    10/34

    CS1026 10

    4'S!

  • 7/25/2019 Combinational Logic.pdf

    11/34

    CS1026 11

    =eighted codes> !n weighted codes" each digit is assigned a specific=eighted codes> !n weighted codes" each digit is assigned a specific

    weight according to its position. $or e(ample" in :21C4 code" 1001weight according to its position. $or e(ample" in :21C4 code" 1001

    the weights of 1" 0" 0" 1 +from left to right- are :" " 2 and 1 respecti%ely.the weights of 1" 0" 0" 1 +from left to right- are :" " 2 and 1 respecti%ely.

    /on*weighted codes> #he non*weighted codes are not positionally/on*weighted codes> #he non*weighted codes are not positionally

    weighted. !n other words" each digit position within the number is notweighted. !n other words" each digit position within the number is notassigned a fi(ed %alue + or weight -.assigned a fi(ed %alue + or weight -.

    '(cess*) and gray code are non*weighted codes.'(cess*) and gray code are non*weighted codes.

    A binary code represents numbers" te(t" computer processor instructions"A binary code represents numbers" te(t" computer processor instructions"

    images etc using the binary number system?s two binary digits" 0 and 1.images etc using the binary number system?s two binary digits" 0 and 1.

  • 7/25/2019 Combinational Logic.pdf

    12/34

    CS1026 12

    eflecti%e codes> A code is reflecti%e when the code is selfeflecti%e codes> A code is reflecti%e when the code is self

    complementing. !n other words" when the code for ; is the complementcomplementing. !n other words" when the code for ; is the complement

    the code for 0" : for 1" 9 for 2" 6 for ) and 7 for .the code for 0" : for 1" 9 for 2" 6 for ) and 7 for .

    221C4" 721C4 and '(cess*) code are reflecti%e codes.221C4" 721C4 and '(cess*) code are reflecti%e codes.

    Sequential codes> !n sequential codes" each succeeding ?code is oneSequential codes> !n sequential codes" each succeeding ?code is one

    binary number greater than its preceding code. #his property helps inbinary number greater than its preceding code. #his property helps in

    manipulation of data.manipulation of data.

    :21 C4 and '(cess*) are sequential codes.:21 C4 and '(cess*) are sequential codes.

  • 7/25/2019 Combinational Logic.pdf

    13/34

    CS1026 1)

    Alphanumeric codes> Codes used to represent numbers" alphabeticAlphanumeric codes> Codes used to represent numbers" alphabetic

    characters" symbols and %arious instructions necessary for con%eyingcharacters" symbols and %arious instructions necessary for con%eying

    intelligible information.intelligible information.

    ASC!!" 'C4!C" 5/!C34' are the most*commonly usedASC!!" 'C4!C" 5/!C34' are the most*commonly usedalphanumeric codes.alphanumeric codes.

    'rror defecting and correcting codes> Codes which allow error'rror defecting and correcting codes> Codes which allow error

    defection and correction are called error detecting and? correcting codes.defection and correction are called error detecting and? correcting codes.@amming code is the mostly commonly used error detecting and@amming code is the mostly commonly used error detecting and

    correcting code.correcting code.

  • 7/25/2019 Combinational Logic.pdf

    14/34

    CS1026 1

    #he word codec is a portmanteau of coder*decoder is a de%ice or#he word codec is a portmanteau of coder*decoder is a de%ice or

    computer program capable of encoding or decoding a digital datacomputer program capable of encoding or decoding a digital data

    stream or signal.stream or signal.

    C34'CC34'C

  • 7/25/2019 Combinational Logic.pdf

    15/34

    CS1026 17

    #he a%ailability of a large %ariety of codes for the same discrete#he a%ailability of a large %ariety of codes for the same discrete

    elements of information results in the use of different codes byelements of information results in the use of different codes by

    different digital systems. !t is sometimes necessarydifferent digital systems. !t is sometimes necessary

    to use the output of one system as the input to anotherto use the output of one system as the input to another

    #o con%ert from binary code A to binary code " the input lines#o con%ert from binary code A to binary code " the input lines

    must supply the bit combination of elements as specified bymust supply the bit combination of elements as specified by

    code A and the output lines must generate the correspondingcode A and the output lines must generate the corresponding

    bit combination of code .bit combination of code .

    A combinational circuit performs this transformation by means ofA combinational circuit performs this transformation by means of

    logic gates.logic gates.

    Code Con%ersion '(ampleCode Con%ersion '(ample

  • 7/25/2019 Combinational Logic.pdf

    16/34

    CS1026 16

    Binary-coded decimalBinary-coded decimal

    !n computing and electronic systems"!n computing and electronic systems"

    binary*coded decimal" C4 isbinary*coded decimal" C4 is

    a class of binary encodings ofa class of binary encodings of

    decimal numbers where each decimaldecimal numbers where each decimal

    digit is represented by a fi(ed numberdigit is represented by a fi(ed number

    of bits" usually four +:21 code- or eight"of bits" usually four +:21 code- or eight"

    although other siBes +such as si( bits-although other siBes +such as si( bits-

    ha%e been used historically.ha%e been used historically.

  • 7/25/2019 Combinational Logic.pdf

    17/34

    CS1026 19

    C4?s main %irtue is a more accurate representation and rounding ofC4?s main %irtue is a more accurate representation and rounding of

    decimal quantities as well as an ease of con%ersion into human*readabledecimal quantities as well as an ease of con%ersion into human*readable

    representations.representations.

    As compared to binary positional systems" C4?s principal drawbacsAs compared to binary positional systems" C4?s principal drawbacs

    are a small increase in the comple(ity of the circuits needed toare a small increase in the comple(ity of the circuits needed to

    implement basic arithmetics and a slightly less dense storage.implement basic arithmetics and a slightly less dense storage.

    C4 was used in many early decimal computers. Although C4 isC4 was used in many early decimal computers. Although C4 isnot as widely used as in the past" decimal fi(ed*point andnot as widely used as in the past" decimal fi(ed*point and

    floating*point formats are still important and continue to be used infloating*point formats are still important and continue to be used in

    financial" commercial" and industrial computing" where subtlefinancial" commercial" and industrial computing" where subtle

    con%ersion and rounding errors that are inherent to floating pointcon%ersion and rounding errors that are inherent to floating point

    binary representations cannot be tolerated.binary representations cannot be tolerated.

  • 7/25/2019 Combinational Logic.pdf

    18/34

    CS1026 1:

    C4 is %ery common inC4 is %ery common in

    electronic systems where aelectronic systems where a

    numeric %alue is tonumeric %alue is to

    be displayed" especially inbe displayed" especially insystems consisting solely ofsystems consisting solely of

    digital logic" and not containingdigital logic" and not containing

    a microprocessor.a microprocessor.

  • 7/25/2019 Combinational Logic.pdf

    19/34

    CS1026 1;

    ,any non*integral %alues" such as decimal 0.2" ha%e an infinite,any non*integral %alues" such as decimal 0.2" ha%e an infinite

    place*%alue representation in binary +.001100110011...- but ha%e a finiteplace*%alue representation in binary +.001100110011...- but ha%e a finite

    place*%alue in binary*coded decimal +0.0010-.place*%alue in binary*coded decimal +0.0010-.

    Consequently a system based on binary*coded decimal representations ofConsequently a system based on binary*coded decimal representations of

    decimal fractions a%oids errors representing and calculating such %alues.decimal fractions a%oids errors representing and calculating such %alues.

    Scaling by a factor of 10 +or a power of 10- is simple this is useful whenScaling by a factor of 10 +or a power of 10- is simple this is useful when

    a decimal scaling factor is needed to represent a non*integer quantitya decimal scaling factor is needed to represent a non*integer quantity+e.g." in financial calculations-+e.g." in financial calculations-

    ounding at a decimal digit boundary is simpler.ounding at a decimal digit boundary is simpler.

    Addition and subtraction in decimal does not require rounding.Addition and subtraction in decimal does not require rounding.

    Alignment of two decimal numbers +for e(ample 1.) D 29.0:- is a simple"Alignment of two decimal numbers +for e(ample 1.) D 29.0:- is a simple"

    e(act" shift.e(act" shift.

  • 7/25/2019 Combinational Logic.pdf

    20/34

    CS1026 20

    y utiliBing C4" the manipulation of numerical data for display can bey utiliBing C4" the manipulation of numerical data for display can be

    greatly simplified by treating each digit as a separate single sub*circuit.greatly simplified by treating each digit as a separate single sub*circuit.

    #his matches much more closely the physical reality of display#his matches much more closely the physical reality of display

    hardware8a designer might choose to use a series of separate identicalhardware8a designer might choose to use a series of separate identicalse%en*segment displays to build a metering circuit" for e(ample.se%en*segment displays to build a metering circuit" for e(ample.

    !f the numeric quantity were stored and manipulated as pure binary"!f the numeric quantity were stored and manipulated as pure binary"

    interfacing to such a display would require comple( circuitry.interfacing to such a display would require comple( circuitry.

    #herefore" in cases where the calculations are relati%ely simple woring#herefore" in cases where the calculations are relati%ely simple woring

    throughout with C4 can lead to a simpler o%erall system thanthroughout with C4 can lead to a simpler o%erall system than

    con%erting to binary.con%erting to binary.

  • 7/25/2019 Combinational Logic.pdf

    21/34

    CS1026 21

    Some operations are more comple( to implement. Adders require e(traSome operations are more comple( to implement. Adders require e(tra

    logic.logic.

    17E20 percent more circuitry is needed for C4 add compared to pure17E20 percent more circuitry is needed for C4 add compared to purebinary.binary.

    ,ultiplication requires the use of algorithms that are somewhat more,ultiplication requires the use of algorithms that are somewhat more

    comple( than shift*mas*add +a binary multiplication" requiring binarycomple( than shift*mas*add +a binary multiplication" requiring binary

    shifts and adds or the equi%alent" per*digit or group of digits is required-shifts and adds or the equi%alent" per*digit or group of digits is required-

    Standard C4 requires four bits per digit" roughly 20 percent more spaceStandard C4 requires four bits per digit" roughly 20 percent more space

    than a binary encoding.than a binary encoding.

    =hen paced so that three digits are encoded in ten bits" the storage=hen paced so that three digits are encoded in ten bits" the storage

    o%erhead is greatly reduced" at the e(pense of an encoding that iso%erhead is greatly reduced" at the e(pense of an encoding that is

    unaligned with the :*bit byte boundaries common on e(isting hardware"unaligned with the :*bit byte boundaries common on e(isting hardware"

    resulting in slower implementations on these systems.resulting in slower implementations on these systems.

  • 7/25/2019 Combinational Logic.pdf

    22/34

    CS1026 22

  • 7/25/2019 Combinational Logic.pdf

    23/34

    CS1026 2)

    '(cess*)'(cess*)

    '(cess*) was used on some older computers as well as in cash registers'(cess*) was used on some older computers as well as in cash registersand hand held portable electronic calculators of the 1;90?s" amongand hand held portable electronic calculators of the 1;90?s" among

    other uses.other uses.

  • 7/25/2019 Combinational Logic.pdf

    24/34

    CS1026 2

    #o encode a number such as 129" then" one simply encodes each of the#o encode a number such as 129" then" one simply encodes each of the

    decimal digits as abo%e" gi%ing +0100" 0101" 1010-.decimal digits as abo%e" gi%ing +0100" 0101" 1010-.

    #he primary ad%antage of FS*) coding o%er non*biased coding is that#he primary ad%antage of FS*) coding o%er non*biased coding is that

    a decimal number can be nines? complemented +for subtraction- as easilya decimal number can be nines? complemented +for subtraction- as easily

    as a binary number can be ones? complemented Gust in%ert all bits.as a binary number can be ones? complemented Gust in%ert all bits.

    !n addition" when the sum of two FS*) digits is greater than ;" the carry!n addition" when the sum of two FS*) digits is greater than ;" the carrybit of a four bit adder will be set high.bit of a four bit adder will be set high.

    '(cess*)'(cess*)

    #he ey feature of the e(cess ) code is that it is self complementing#he ey feature of the e(cess*) code is that it is self*complementing

  • 7/25/2019 Combinational Logic.pdf

    25/34

    CS1026 27

    #he ey feature of the e(cess*) code is that it is self*complementing.#he ey feature of the e(cess*) code is that it is self*complementing.

    #his means that the 1?s complement of an e(cess*) number is the#his means that the 1?s complement of an e(cess*) number is the

    e(cess*) code for the ;?s complement of the corresponding decimale(cess*) code for the ;?s complement of the corresponding decimal

    number.number.

    #he ;?s complement of a decimal number is found by subtracting each#he ;?s complement of a decimal number is found by subtracting eachdigit in the number from ;. $or e(ample" the ;?s complement of is 7.digit in the number from ;. $or e(ample" the ;?s complement of is 7.

    #he e(cess*) code for decimal is 0111. #he 1?s complement of this is#he e(cess*) code for decimal is 0111. #he 1?s complement of this is

    1000" which is the e(cess*) code for the decimal 7 +and 7 is the ;?s1000" which is the e(cess*) code for the decimal 7 +and 7 is the ;?s

    complement of -.complement of -.

    #he usefulness of the ;?s complement and thus e(cess*) stems from the#he usefulness of the ;?s complement and thus e(cess*) stems from the

    fact that subtraction of a smaller decimal number from a larger one canfact that subtraction of a smaller decimal number from a larger one can

    be accomplished by adding the ;?s complement +1?s complement of thebe accomplished by adding the ;?s complement +1?s complement of the

    e(cess*) code- of the subtrahend +in this case the smaller number- to thee(cess*) code- of the subtrahend +in this case the smaller number- to the

    minuend and then adding the carry to the result. =hen subtracting aminuend and then adding the carry to the result. =hen subtracting alarger number from a smaller one" there is no carry" and the result is inlarger number from a smaller one" there is no carry" and the result is in

    ;?s complement form and negati%e.;?s complement form and negati%e.

    #his procedure has a distinct ad%antage o%er C4 in certain types of#his procedure has a distinct ad%antage o%er C4 in certain types of

    arithmetic logic.arithmetic logic.

  • 7/25/2019 Combinational Logic.pdf

    26/34

    CS1026 26

  • 7/25/2019 Combinational Logic.pdf

    27/34

    CS1026 29

  • 7/25/2019 Combinational Logic.pdf

    28/34

    CS1026 2:

  • 7/25/2019 Combinational Logic.pdf

    29/34

    CS1026 2;

  • 7/25/2019 Combinational Logic.pdf

    30/34

    CS1026 )0

    inary*coded decimal +C4- is ainary*coded decimal +C4- is a

    class of binary encodings ofclass of binary encodings of

    decimal numbers where eachdecimal numbers where each

    decimal digit is represented by adecimal digit is represented by a

    fi(ed number of bitsfi(ed number of bits

    '(cess*) equi%alent of a decimal number is obtained by adding ) and'(cess*) equi%alent of a decimal number is obtained by adding ) and

    then con%erting it to a binary format. $or instance to find e(cess*)then con%erting it to a binary format. $or instance to find e(cess*)representation of decimal number " first ) is added to to get 9representation of decimal number " first ) is added to to get 9

    and then binary equi%alent of 9 i.e. 0111 forms the e(cess*)and then binary equi%alent of 9 i.e. 0111 forms the e(cess*)

    equi%alentequi%alent

  • 7/25/2019 Combinational Logic.pdf

    31/34

    CS1026 )1

    #he si( bit combinations not listed for the input %ariables are#he si( bit combinations not listed for the input %ariables are

    donHt care combinations.donHt care combinations.

    #hese %alues ha%e no meaning in C4 and we assume that they#hese %alues ha%e no meaning in C4 and we assume that they

    will ne%er occur in actual operation of the circuit.will ne%er occur in actual operation of the circuit.

    #herefore" we are at liberty to assign to the output %ariables either#herefore" we are at liberty to assign to the output %ariables either

    a 1 or a 0" whiche%er gi%es a simpler circuita 1 or a 0" whiche%er gi%es a simpler circuit

  • 7/25/2019 Combinational Logic.pdf

    32/34

    CS1026 )2

    A two*le%el logic diagramA two*le%el logic diagram

    for each output may befor each output may be

    obtained directly from theobtained directly from the

    oolean e(pressionsoolean e(pressionsderi%ed from the maps.deri%ed from the maps.

    #he e(pressions obtained abo%e may be manipulated#he e(pressions obtained abo%e may be manipulated

  • 7/25/2019 Combinational Logic.pdf

    33/34

    CS1026 ))

    #he e(pressions obtained abo%e may be manipulated#he e(pressions obtained abo%e may be manipulated

    algebraically for the purpose of using common gatesalgebraically for the purpose of using common gates

    for two or more outputs.for two or more outputs.

    /ot counting input in%erters" the implementation in sum*of*products/ot counting input in%erters" the implementation in sum*of*products

    form requires se%en A/4 gates and three 3 gates. #his implementationform requires se%en A/4 gates and three 3 gates. #his implementation

    requires four A/4 gates" four 3 gates" and one in%erter.requires four A/4 gates" four 3 gates" and one in%erter.

  • 7/25/2019 Combinational Logic.pdf

    34/34

    CS1026 )


Recommended