Top Banner

of 15

Lecture notes on Logic Circuits

Jun 03, 2018

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/12/2019 Lecture notes on Logic Circuits

    1/15

    +5

    V

    5

    T ime

    +5

    V

    5

    1 0 1

    Time

    Logic Circuits and Switching Theory

    Module 1Review on Digital CircuitsIntroduction

    Digital computers have made possible many scientific, industrial, andcommercial advances that would have been unattainable otherwise. Ourspace program would have been impossible without real time, continuous

    computer monitoring, and many business enterprises function efficiently onlywith the aid of automatic data processing.Logic Design vs. Computer DesignLogic designdeals with the basic concepts and tools used to designdigital hardware consisting of logic circuits.Computer designdeals with additional concepts and tools used to designcomputers and other complex digital hardware.Numerical Representations

    Almost all the fields of endeavor are dealing with quantities.Quantitiesare measured, monitored, recorded, manipulated arithmetically,observed, and utilized in most physical systems.There is a need to represent these quantities/values efficiently andaccurately.Ways to represent numerical valuesAnalog representationrepresented by a voltage, current, or metermovement proportional to the value of that quantity.Digital representationrepresented not by continuously variable indicatorsbut by symbols called digits.

    Analog Examples:Automobile speedometerdeflection of the needle is proportional to the speed of the

    auto.Mercury thermometerheight of the column of mercury is proportional to the room

    temperature.Audio microphoneoutput voltage is generated in proportion to the amplitude ofthe sound waves that impinge on the microphone.

    Analog AC-powered wall clocktime of the day changes continuously as the needle reading

    changes continuously.Analog Signal CharacteristicsHaving acont inuous range of valuesand can be associated withcontinuous physical phenomena.Cont inuoussignal- smooth connected, an unbroken series of consecutivevalues with no instantaneous changes.

    Digital ExampleDigital watch

    provides time of the day in the form of digital digits that representshours and minutes (and sometimes seconds). The watch readingchanges in discrete steps of one per minute (or per second).

    Digital signalTypically has two discrete values (or states)and are appropriate for any

    phenomena involving counting or integer numbers.Discretes ignal- separated into distinct segments or pieces, a series ofdiscontinuous values.

    Major differences:Analog and Digital quantities:

    Analog continuously variable defined values

    Digital vary only by discrete steps

    Analog DigitalContinuously variable Discrete stepsAmplification SwitchingVoltages Numbers

    No ambiguityin reading the value of a digital quantityValue of analog quantity is often open to interpretation, thus we alwaysround to a convenient level of precision.Points to Ponder:

    Real life is full of analog signals.Analog systems: slight error in input, large error in output.General purpose computers: digitalSensors & actuators- interface circuits are often analog.Digital systems:more accurate, reliable and deal better withdegraded signals.Digital signals- easier to process, used as an approximation to realanalog signals.Binary digital systems -has only two discrete values that makedigital systems easier to decode.Two discrete values:1. High voltage, high current flowing, ON, TRUE, YES, "1"2. Low voltage, low current flowing, OFF, FALSE, NO, "0"Digital logic levels

    Voltage that represents a defined digital state in anelectronic circuit.Logic LOW (or logic 0)

  • 8/12/2019 Lecture notes on Logic Circuits

    2/15

    lower of two voltages (usually 0V) in a digital system withtwo logic levels.Logic HIGH (or logic 1)

    higher of two voltages (traditionally 5V, but in some systemsa specific value such as 1.8V, 2.5V or 3.3V) in a digital system withtwo logic levels.Digital logic levels

    Digital SystemDevices designed to manipulate logical information or physical

    quantities that are represented in digital form. Most often electronic, but theycan also be mechanical, magnetic, or pneumatic.Analog system

    Devices that manipulate physical quantities that are represented inanalog form.Advantages of digital techniques

    Reproducibility of resultsEasier to designFlexibility and functionalityProgrammabilitySpeedEconomySteadily advancing technologyStorage is easy

    Limitations of Digital TechniquesThe real world is analogmost physical quantities are analog innature.Processing digitized signals takes time.

    Digital Conversion:when dealing with analog inputs and outputs:Convert the real-world analog inputs to digital form.Process (or operate on) the digital informationConvert the digital outputs back to real-world analog form.

    Block diagram

    Digital CircuitInherently binary in nature, but several types of representations of numericaldata are in use.The representation of an unsigned integer can be done in binary, octal,decimal or hexadecimal.

    For display purposes, each decimal digit is often represented by a four-bitbinary number in a system called binary coded decimal (BCD).Digital Representation

    Number SystemsDecimal Numbering System

    Uses ten (10) as a base, also called base-10 system. It uses ten digit symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Each number position represents a weighting factor (positional value

    system) which is a power of the base ten. (1, 10, 100, 1000, etc.)Why do we use 10 digits, anyway?

    Digit is derived from the Latin word for fingerDecimal: Example

    4175.8610can be computed as:=(4 x 103) + (1 * 102) + (7 * 101) + (5 * 100) + (8 * 10-1) + (6 * 10-2)

    7,392.42 is equal to:= (7 * 103) + (3 * 102) + (9 * 101) + (2 * 100) + (4 * 10-1) + (2 * 10-2)

    Octal Numbering System A base-eight numbering system with eight digits of 0,1,2,3,4,5,6,7.

    Decimal Octal-------- ------

    0 01 1

    7 78 109 11

    For example to count in octal the digits combine after reaching acount of 7

    1,..7,10,11,12,,17,20,21,,75,76,77,100

  • 8/12/2019 Lecture notes on Logic Circuits

    3/15

    For two octal digits the largest number is 77 so the two octal digitsend after at 77.

    To find the decimal number equal to an octal number: (127.4)8

    = (1* 82) +(2 * 81) + (7 * 80) +(4 * 8-1 )

    = (87.5)10 (4536)8

    = (4x83) + (5x82) + (3x81) + (6x80)= (1362)10Summary: Octal

    In the octal system, a number with digitsXYZcan be written as: XYZ8

    = (Xx 82) + (Yx 81) + ( Zx 80)Sixty fours Eights Ones

    32768 4096 512 64 8 1

    Hexadecimal Numbering System Has a base-16 There are 16 digits in this system: 0, 1..9, and A, B, C, D, E, F)

    Hexadecimal Decimal----------- -------

    0 01 1..

    9 9A 10B 11

    .. E 14F 15

    To count in hexadecimal: 0..F,10,11,19,1A,1B,..,1E,1F,20,21,.99,9A,,9F,A0,A1..,FE,FF,100

    For two hexadecimal digits the largest number is FF so the twohexadecimal digits end after at FF.

    To find the decimal number equal to a hexadecimal number:

    (B65F)16= (11 * 163)+ (6 * 162)+ (5 * 161)+ (5 * 160)= (46,687)10

    Try this (BCF) 16 (FA.CE) 16

    XYZ16 = Xx 162 +Yx 161 + Zx 160256s 16s 1s

    1048576 65536 4096 256 16 1

    Binary Numbering System Uses two (2) as a base, made of binary digits (bits): 0 and 1; useful

    to represent switch positions (open or closed). Leftmost bit position is called Most Significant Bit (MSB). Right most bit position is called Least Significant Bit (LSB).

    Conversion of Integer fromDecimal to other Bases

    For each digit position:1. Divide decimal number by the base.2. The remainder is the lowest-order digit3. Repeat first two steps until no div isorremains.4.

    Example: (13)10= _____ 2

    Operations on NumbersBinary AdditionMultiplication of Binary numbersComplements Common use of complement: subtraction operation. Perform subtraction through the addition operation. Two types of complements for each r system:

    rs complement ( radix complement )(r-1)s complement ( diminished radix complement)

    (r-1)s Complements

  • 8/12/2019 Lecture notes on Logic Circuits

    4/15

    (r-1)s complement for a number N with n digits in base-r numbering systemis defined as: (rn-1 )N Example #1: Find the 9s complement of 12389:

    = (105 -1 ) - 12389= 99999 -12389 = 87610

    Example #2: Find the 9s complement of1234:= (104 -1)1234 = 9999 -1234

    = 8765

    Example #3: Find the 1s complement of 1011001:= (271 )101 1001= 111 1111101 1001 = 010 0110

    Notice that the 1s complement of binary numbers is formed by changing1sto 0s and 0s to 1s Example: 1s complement of 0001111 is 1110000.

    (rs complement) (rs) complement for number N in base r with n digits is defined as rn N Also, rs complement= ( r-1)s complement +1

    Example #1: Find the 10s complement of 2389:=9999 - 2389 = 7610 + 1 = 7611

    Example #2: Find the 2s complement of 10 1100:= 11 1111 - 10 1100 = 01 0011 + 1= 010100

    Subtraction with complements(Unsigned Numbers) Use the following algorithms:1. Add M to rscomplement of N

    2. If M>=N, then subtract the sum to rn to form the result.

    3. if M M the result is:- (10s complement 30718) =-69282

    Perform the operation using 2s complement: 1010100 - 1000011

    Solution:

    X = 1010100 = 101 0100 (copy)- Y = 1000011 =+ 011 1101 (2s)

    1 001 0001- 1 000 0000

    001 0001

    Signed Binary Numbers

    01001 canbe considered unsigned binary = 9 or signed binary = +9 But, 11001 can be considered unsigned binary = 25 or signed binary = -9 Signed numbers uses 0 for + and 1 for - , this system is calledSigned-magnitude convention All negative numbers have 1 in leftmost bit Signed magnitude is mostly used in ordinary arithmetic. The 1s complement is mostly used in logical operations. The 2s complement is mostly used in computer arithmetic.

    Binary Coded Decimal (BCD) Uses 4 bits to encode one decimal digit Example: (4321)10

    = 0100 0011 0010 0001 Invalid digits: 1010, 1011,1100,1101,

    1110,and 1111.

    Character Representation ASCIIAmerican Standard Code for Information Interchange 128 characters(7 bits required)

    Contains: Control characters (non-printing) Printing characters (letters, digits, punctuation)

    Error-Detecting Code To detect the error in data communication, an 8th bit is added to ASCIIcharacter to indicate its parity. Parity bit - extra bit included with a message to make the total number of 1seither even or odd The 8-bit characters included parity bits (with even parity) are transmitted totheir destination. If the parity of receivedcharacter is not even it means at least one bits has been changed.

    Binary Storage and Registers Register -group if binary cells that are responsible for storing and holdingthe binary information.

  • 8/12/2019 Lecture notes on Logic Circuits

    5/15

    Register transfer operation is transferring binary operation from one set ofregisters to another set of registers. Digital logic circuits process the binary information stored in the registers.

    Boolean Algebra

    Invented by George Boole in 1854 Considered as the backbone of computer circuitanalysis and design It is a branch of mathematics that is directlyapplicable to digital design. It is a set of elements, a set of operators that acton these elements, and a set of axioms orpostulates that govern the actions of theseoperators on these elements.

    Theorems and Postulates The postulates are basic axioms of the algebraicstructure and need no proof.Basic Identity (a) x+ 0 = x (b) x. 1 = xCommutativeProperty(a) x + y = y + x (b) xy = yxDistributiveProperty(a) x(y+z) = xy+xz (b) x+yz = (x+y )(x+z)Basic Identity (a) x+ x = 1 (b) xx = 0Postulates of Boolean Algebra

    The theorems must be proven from thepostulatesTheorem 1. Identity x + x = x xx = xTheorem 2. Identity x+ 1= 1 x.0 = 0Theorem 3. Involution (x) = xTheorem 4.

    Associativex+(y+z) = (x+y) + z x(yz) = (xy)zTheorem 5. DeMorgans(x+y) = x.y (xy) = x + yTheorem 6.

    Absorptionx + xy = x x(x+y) = x

    Operations with Boolean Algebra

    Complementation ()To complement a variable is to reverse itsvalue

    Represented by placing a bar over thevariable or by the () symbol after the variable.

    Addition (+)Boolean Addition is equivalent to logicalOR.

    The (+) plus symbol is used to indicatethe addition or ORing Multiplication (.)

    Boolean multiplication is equivalent to alogical AND operation

    Truth Table It lists every possible combination of inputs and theoutput corresponding to each combination of inputs. Given a function N inputs, the possible combinations willthen be equal to 2N. Example: using a truth table prove that x (x+y) = x.

    x y x+y x(x+y)0 0 0 00 1 1 01 0 1 1

    1 1 1 1

    Boolean Functions It is defined using an equal sign and anexpression comprise of binary variables,two binary operators OR and AND, theunary operator NOT and the parentheses. It may also be represented by a truthtable, showing all the possible 1s and 0scombination of the N binary variable

    Algebraic Manipulation A Boolean function may be transformedfrom an algebraic expression into a logicdiagram composed of AND, OR and NOT. There is an AND gate for each term in theexpression, and an OR gate is used tocombined two or more terms.

  • 8/12/2019 Lecture notes on Logic Circuits

    6/15

    Complement of a Function The function F and F are complementaryif:

    they depend on the same set of inputvariables

    for every combination of values of the inputvariables, the values of F and F are inversesto each other.

    The complement of a function may be derivedalgebraically using De Morgans theorem.

    Canonical Forms A binary variable may appear either in its normalform (x) or in its complemented form (x). Combining x and y with the AND operator, thefollowing 4 combinations will result: xy, xy, xyand xy.

    Minterm or Standard ProductsObtained from an AND terms of the Nvariables

    It is represented by the symbol mjwhere jdenotes the decimal equivalent of the binaryvalue Maxterm or Standard Sums

    Obtained from an OR term of the N variablesIt is represented by the symbol Mjwhere jdenotes the decimal equivalent of the binaryvalue

    Sum of Minterms The ORing of terms which result ina 1-value of the function. Ex.

    Boolean Function:F1=xyz + xyz + xyz=m1 + m4 +m5

    or F1=(1, 4, 5)

    Complement of the FunctionF1=xyz + xyz + xyz + xyz + xyz

    = m0, m2, m3, m6, m7

    or F1 =(0, 2, 3, 6, 7)x y z F10 0 0 00 0 1 10 1 0 00 1 1 01 0 0 11 0 1 11 1 0 01 1 1 0

    Product of MaxtermsThe ANDing of terms whicheach result in a 0-value of thefunctionEx. Express the Booleanfunction F= AB + AC as aproduct of maxterms

    F= (M0,M1, M2,M3,M5)F=(A + B +C) (A+B+C)(A+B+C) (A+B+C) (A+B+C)

    A B C F0 0 0 00 0 1 00 1 0 00 1 1 01 0 0 11 0 1 01 1 0 1

    1 1 1 1

    Standard Forms: Two types of Standard Form

    Sum of Products A Boolean expression containing AND terms of one or moreliterals each. The sum denotes the ORing of the AND terms. Ex. F1= y + xyz + xz

    Product of Sums A Boolean expression containing OR terms of one or moreliterals each. The sum denotes the ANDing of the OR terms. Ex. F2=y (x+z) (x+y+z) (x+y+z+w)

  • 8/12/2019 Lecture notes on Logic Circuits

    7/15

    Binary Logic and Gates Integrated CircuitsCircuits implemented using transistors andinterconnections (semiconductor devices). Logic Gate basic circuit

    Karnaugh Map Proposed by Veitch and modified byKarnaugh A diagram made up of squares, eachsquares represents one minterm The map presents a visual diagram of allpossible ways a function may beexpressed in a standard form.

    Pairs Group of two 1s that are vertically or horizontallyadjacent. It is customary to encircle a pair of adjacent 1sfor easy identification. If one variable changes its value, that variablecan be eliminated. (The variable and itscomplement will be eliminated.) If more than one group exists on a map, you canOR the simplified product to get the simplifiedBoolean equation.

    Quads A group of four 1s that are end to end or inthe form of square. Two variables and their complements canbe dropped.

    Octets A group of eight adjacent 1s. It eliminates three variables and theircomplements.

    Overlapping Groups When you encircle groups, you areallowed to use the same 1 more thanonce. Always overlap groups when possibleto get the largest groups you can.

    Rolling the Map

    Group the 1s just like by imagining rollingthe map so that the left side touches theright side or the upper touches the lowerside. Draw half-circles around each group.

    Redundant Groups A group whose 1s are completelyoverlapping by other groups. The inner pair in (a) are completelyoverlapped by the outside pairs, and canbe eliminated to get the simpler map asshown in (b).

    Dont-Care Conditions Represented by x in the truth table, itsbecause they can be treated as 0s or 1s,whichever leads to a simpler circuit. In K-map, treat xs as 1s and try to formthe largest groups to include with the real1s. The remaining xs will be treated as 0s

    Combinational CircuitA combinational circuit consists of logic gates whose outputs at any time aredetermined directly from the present combination of inputs without regard toprevious inputs. A combinational circuit performs a specific information-processing operation fully specified logically by a set of Boolean function.

    Combinational Circuit Consists of input variables, logic gates and

    output variables. The logic gates accept signals from theinputs and generate signals to the outputs. inputs and generate signals to theoutputs.

    Design Procedure The design of combinational circuits starts from theverbal outline of the problem and ends in a logic circuitdiagram or a set of Boolean functions from which thelogic diagram can be easily obtained. The procedureinvolves the following steps: involves the following steps:1. The problem is stated.

    2. The number of available input variables and required output variables

  • 8/12/2019 Lecture notes on Logic Circuits

    8/15

    is determined.3. The input and output variables are assigned letter symbols.4. The truth table that defines the required relationships between inputsand output is derived.5. The simplified Boolean function for each output is obtained.6. The logic diagram is drawn.

    ArithmeticArithmetic circuits are the ones whichperform arithmetic operations like addition,subtraction, multiplication, division, paritycalculation. calculation.

    Adders Adders are the basic building blocks of allarithmetic circuits; adders add two binarynumbers and give out sum and carry asoutput. Basically we have two types of output. Basically we have two typesofadders.

    Half Adder.Full Adder.

    Half Adder Use a combinational circuit that performsaddition on two bits Boolean Equation: SUM= X XOR YCARRY = XY CARRY = XY

    Truth Table

    X Y SUM CARRY0 0 0 0

    0 1 1 01 0 1 01 1 0 1

    Full-Adders Uses a combinational circuit that performsthe addition on three bits. It consists of three inputs and two outputs.Boolean Equation: Boolean Equation:SUM= A XOR B XOR CCARRY= AB + AC + BC

    Truth TableX Y Z SUM CARRY0 0 0 0 00 0 1 1 00 1 0 1 00 1 0 1 00 1 1 0 11 0 0 1 01 0 1 0 11 1 0 0 11 1 1 1 1

  • 8/12/2019 Lecture notes on Logic Circuits

    9/15

    4-bit Carry Ripple AdderAdds two 4-bit numbers: X = X3 X2 X1 X0, Y = Y3 Y2 Y1 Y0producing the sum S = S3 S2 S1 S0 , C-out = C4 from the mostsignificant position j=3

    BCD Adder BCD addition is the same as binary addition witha bit of variation: whenever a sum is greater than1001, it is not a valid BCD number, so we add0110 to it, to do the correction. This will producea carry, which is added to the next BCD position. a carry, which is added tothe next BCD position.

    Add the two 4-bit BCD code inputs.Determine if the sum of this addition is greater than1001; if yes, then add 0110 to this sum and generatea carry to the next decimal position.

    Subtracters Subtracter circuits take two binarynumbers as input and subtract one binarynumber input from the other binarynumber input. Similar to adders, it gives number input. Similar to adders, itgivesout two outputs, difference and borrow(carry-in the case of Adder). There are twotypes of subtracters.

    Half-Subtracters A combinational circuit that performs subtraction on twobits and produces their difference.Boolean Equation:Difference= AB + AB = A XOR BBorrow= ABwhere Differenceis an output where Differenceis an outputvariable that holds the difference.Borrowa variable that holds the binarysignal that informs the next stage that 1 has beenborrowed.

    A- minuend bitB- subtrahend

    Truth Table and K-mapX Y Borrow Difference0 0 0 00 1 1 11 0 0 11 1 0 0

  • 8/12/2019 Lecture notes on Logic Circuits

    10/15

    Block and Logic Diagram

    Full Subtracter A full subtracteris a combinational circuit that performssubtraction involving three bits, namely minuend, subtrahend,and borrow-in. The logic symbol and truth table are shownbelow.Truth TableX Y Bin Diff Bout0 0 0 0 00 0 1 1 10 1 0 1 10 1 1 0 11 0 0 1 01 0 1 0 01 1 0 0 0

    1 1 1 1 1

    Analysis of a Combinational Circuit The analysis of a combinational circuitstarts with the given logic diagram andculminates with the set of Booleanfunctions, or truth table, or a verbal functions, or truth table, or a verbalexplanation of the circuit operation. To obtain the output Boolean functionsfrom a logic diagram, proceed as follows:

    Label with arbitrary symbols all gate outputs that are

  • 8/12/2019 Lecture notes on Logic Circuits

    11/15

    a function of the input variables. Obtain the Booleanfunctions for each gate.

    Label with other arbitrary symbols those gates whichare a function of input variables and / or previouslylabeled gates. Find the Boolean functions for these labeled gates. Find theBoolean functions for thesegates.

    Repeat the process outlined in step 2 until the outputsof the circuit are labeled.

    By repeated substitution of previously definedfunctions, obtain the output Boolean functions interms on input variables only.

    MSI and PLD Components

    Parallel Binary Subtracter Parallel binary subtracter can be implementedby cascading several full-subtracters.Implementation and associated problems arethose of a parallel binary adder, seen before inparallel binary adder section. parallel binary adder section. The next slide is the block level representation ofa 4-bit parallel binary subtracter, which subtracts4-bit Y3Y2Y1Y0 from 4-bit X3X2X1X0. It has 4-bit difference output D3D2D1D0 with borrowoutput Bout.

    Block diagram of a 4-bit parallelbinary subtracter

    Serial Binary Subtracter A serial subtracter can be obtained byconverting the serial adder using the 2'scomplement system. The subtrahend isstored in the Y register and must be 2'scomplemented before it is added to the complemented before it is added totheminuend stored in the X register. The circuit for a 4-bit serial subtracterusing full-adder is shown in the figurebelow.

    DecodersA decoder is a combinational circuit that converts binaryinformation from n input lines to a maximum of 2n uniqueoutput lines. If the n bit decoded information has unusedor dont care combinations, the decoder output will havefewer than 2n outputs.

    A decoder is a multipleinput, multipleoutput logic circuitthat converts coded inputs into coded outputs, where the

    A decoder is a multipleinput, multipleoutput logic circuit

    that converts coded inputs into coded outputs, where theinput and output codes are different; e.g. nto2n, BCDdecoders.Decoding is necessary in applications such as data

    multiplexing, 7 segment display and memory addressdecoding. Figure below shows the pseudo block of adecoder.

    Basic Binary Decoder And AND gate can be used as the basic decodingelement, because its output is HIGH only when all itsinputs are HIGH. For example, if the input binary

    number is 0110, then, to make all the inputs to the

  • 8/12/2019 Lecture notes on Logic Circuits

    12/15

    AND gate HIGH, the two outer bits must be inverted AND gate HIGH, thetwo outer bits must be invertedusing two inverters as shown in figure below.

    Binary n-to-2n Decoders A binary decoder has n inputs and 2n outputs. Only one output is active at anyone time, corresponding to the input value.Figure below shows a representation ofBinary nto2ndecoder Binary nto2ndecoder

    Example - 2-to-4 Binary Decoder A 2 to 4 decoder consists of two inputs andfour outputs, truth table and symbols of whichis shown below.X Y F0 F1 F2 F30 0 1 0 0 00 1 0 1 0 01 0 0 0 1 01 1 0 0 0 1Truth Table

    3-to-8 Binary Decoder A 3 to 8 decoder consists of three inputs andeight outputs, truth table and symbols of which isshown below.Truth TableX Y Z F0 F1 F2 F3 F4 F5 F6 F70 0 0 1 0 0 0 0 0 0 00 0 1 0 1 0 0 0 0 0 0

    0 1 0 0 0 1 0 0 0 0 00 1 1 0 0 0 1 0 0 0 01 0 0 0 0 0 0 1 0 0 01 0 1 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 01 1 1 0 0 0 0 0 0 0 1

  • 8/12/2019 Lecture notes on Logic Circuits

    13/15

    Implementing Functions UsingDecoders Any nvariable logic function, in canonical sumof

    minterms form can be implemented using a single nto2n decoder to generate the minterms, and an OR gate toform the sum.

    The output lines of the decoder corresponding to the minterms ofthe function are used as inputs to the or gate. the function are used as inputsto the or gate. Any combinational circuit with n inputs and m outputscan be implemented with an nto2ndecoder with m ORgates. Suitable when a circuit has many outputs, and eachoutput function is expressed with few minterms.

    Encoders An encoder is a combinational circuit thatperforms the inverse operation of a decoder. If adevice output code has fewer bits than the inputcode has, the device is usually called anencoder. e.g. 2nton, priority encoders. encoder. e.g. 2nton, priorityencoders. The simplest encoder is a 2nton binaryencoder, where it has only one of 2n inputs = 1and the output is the nbit binary numbercorresponding to the active input.

    Example - Octal-to-BinaryEncoder OctaltoBinary take 8 inputs and provides3 outputs, thus doing the opposite of whatthe 3to8 decoder does. At any one time,

  • 8/12/2019 Lecture notes on Logic Circuits

    14/15

    only one input line has a value of 1. The only one input line has a value of 1.Thefigure below shows the truth table of anOctaltobinary encoder.

    Truth TableI0 I1 I2 I3 I4 I5 I6 I7 Y2 Y1 Y01 0 0 0 0 0 0 0 0 0 00 1 0 0 0 0 0 0 0 0 10 0 1 0 0 0 0 0 0 1 00 0 1 0 0 0 0 0 0 1 00 0 0 1 0 0 0 0 0 1 10 0 0 0 1 0 0 0 1 0 00 0 0 0 0 1 0 0 1 0 10 0 0 0 0 0 1 0 1 1 00 0 0 0 0 0 0 1 1 1 1

    DecimaltoBinary take10 inputs and provides4 outputs, thus doingthe opposite of whatthe 4to10 decoderdoes. At any one time, does. At any one time,only one input line hasa value of 1. The figureon the right shows thetruth table of aDecimaltobinaryencoder.

    I0 I1 I2 I3 I4 I5 I6 I7 I8 I9 Y3 Y2 Y1 Y01 0 0 0 0 0 0 0 0 0 0 0 0 00 1 0 0 0 0 0 0 0 0 0 0 0 10 0 1 0 0 0 0 0 0 0 0 0 1 00 0 0 1 0 0 0 0 0 0 0 0 1 1

    0 0 0 1 0 0 0 0 0 0 0 0 1 10 0 0 0 1 0 0 0 0 0 0 1 0 00 0 0 0 0 1 0 0 0 0 0 1 0 10 0 0 0 0 0 1 0 0 0 0 1 1 00 0 0 0 0 0 0 1 0 0 0 1 1 10 0 0 0 0 0 0 0 1 0 1 0 0 00 0 0 0 0 0 0 0 0 1 1 0 0 1

    From the above truth table , we can derivethe functions Y3, Y2, Y1 and Y0 as givenbelow.

    Y3 = I8 + I9 Y3 = I8 + I9 Y2 = I4 + I5 + I6 +I7 Y1 = I2 + I3 + I6 + I7 Y0 = I1 + I3 + I5 + I7 + I9

    Priority Encoder If we look carefully at the Encoder circuits that we got,we see the following limitations. If more than two inputsare active simultaneously, the output is unpredictable orrather it is not what we expect it to be. This ambiguity is resolved if priority is established so thatonly one input is encoded, no matter how many inputs only one input is

    encoded, no matter how many inputs

  • 8/12/2019 Lecture notes on Logic Circuits

    15/15

    are active at a given point of time. The priority encoder includes a priority function. Theoperation of the priority encoder is such that if two ormore inputs are active at the same time, the input havingthe highest priority will take precedence.

    Example4 to 3 PriorityEncoder The truth table of a 4 input priority encoder is asshown below. The input D3 has the highestpriority, D2 has next highest priority, D0 has thelowest priority. This means output Y2 and Y1 are0 only when none of the inputs D1, D2, D3 are 0 only when none of theinputs D1, D2, D3 arehigh and only D0 is high. A 4 to 3 encoder consists of four inputs andthree outputs, truth table and symbols of whichis shown below.

    Truth TableD3 D2 D1 D0 Y2 Y1 Y0

    0 0 0 0 0 0 00 0 0 1 0 0 10 0 1 x 0 1 00 0 1 x 0 1 00 1 x x 0 1 11 x x x 1 0 0

    Multiplexer Digital multiplexer is a combinationalcircuit that selects binary information fromone of many input lines and directs it to a

    single output line. The selection of aparticular input line is controlled by a set of particular input line is controlledby a set ofselection lines. The block diagram of MUX with n datasources of b bits wide and s bits wideselect line is shown in below figure.

    Larger Multiplexers Larger multiplexers can be constructedfrom smaller ones. An 8to1 multiplexercan be constructed from smaller

    multiplexers as shown below. multiplexers as shown below.