Logic Gates(new)

  • Upload
    ngoune

  • View
    221

  • Download
    0

Embed Size (px)

Citation preview

  • 8/4/2019 Logic Gates(new)

    1/19

    Digital Electronics_Jean-Paul NGOUNE 1

    Courses In

    Electrical

    Engineering

    Volume II

    DIGITAL ELECTRONICS

    CHAPTER TWO : LOGIC GATES

    By

    J-P. NGOUNE

    DIPET I (Electrotechnics), DIPET II (Electrotechnics)

    DEA (Electrical Engineering)

    Teacher in the Electrical Department, GTHS KUMBO, Cameroon.

  • 8/4/2019 Logic Gates(new)

    2/19

    Digital Electronics_Jean-Paul NGOUNE 2

    Chapter Two

    LOGIC GATES2.0 Specific objectives:

    At the end of this chapter, the student will be able to:

    - Understand the functioning of the logic gates;

    - Draw the truth table of simple logic circuits;

    - Know logic voltage levels for TTL and CMOS technologies;

    - Design a simple logic circuit using logic gates.

    2.1 Introduction:

    Logic gates are elementary bricks used in the construction of digital circuits.

    While the binary numeration system studied in the precedent chapter was an

    interesting mathematical abstraction, we have not yet seen its practical application to

    electronics. This chapter is devoted to practically apply the concept of binary digits to

    circuits. A logic gate is a special type of circuit designed to accept (inputs) and

    generate (outputs) voltages signals corresponding to binary digits (1 and 0).

    2.2 Digital signals and gates:

    Let us consider the following circuit:

    SR

    LED

    Vcc

    1

    0

    Figure 2.1: Logic circuit.

  • 8/4/2019 Logic Gates(new)

    3/19

    Digital Electronics_Jean-Paul NGOUNE 3

    When the switch is connected to the ground (0V), the light emitting diode

    (LED) does not shine. If we were using this circuit to represent binary digits, we

    would say that the input signal is a binary 0 and that the output is a binary 0 or that

    the output is at the low logic level. Moving the switch to the other position (Vcc), we

    apply a binary 1 to the input and receive a binary 1 at the output. The output is

    also said to be at the high logic level.

    The gate shown by this simple circuit is a buffer or yes gate, because the

    logic state of its input is identical to that of its output. Many types of gates are used in

    digital electronics: single input gates like the buffer and the NOT gates; multiple

    inputs gates like AND, NAND, OR, NOR, and XOR gates. The aim of this chapter is

    to study the functioning of each of those logic gates and also how they can be

    combined to design a simple logic function.

    2.3 The NOT gate:

    The NOT gate or Inverter is a logic gate which functions in such a way that the

    logic state of the output is exactly the opposite of that of the input.

    Remark 2.1: The truth table

    A truth table is a standard way of representing the Inputs/outputs relationships

    of a digital circuit, listing all the possible input logic level combinations with their

    respective output logic levels.

    The NOT gate truth table:

    Input Output

    0 1

    1 0

    Symbol

    Input Output

    Remark 2.2: the buffer gate

    If we were to connect two inverter gates together so that the output of one fed

    into the input of another, the two inversion functions would cancel each other out so

    that there would be no inversion from input to final output.

  • 8/4/2019 Logic Gates(new)

    4/19

    Digital Electronics_Jean-Paul NGOUNE 4

    0

    1

    0

    Figure 2.2: Principle of the buffer gate

    A buffer is a special logic gate manufactured to perform the same function as

    two inverters connected together. Buffer gates serve to amplify signals, taking a weak

    signal source that is not capable of providing much current, and boosting the current

    capacity of the signal so as to be able to drive a load.

    Symbol of a buffer gate:

    Input Output

    Truth table of the buffer gate:

    Input Output

    0 0

    1 1

    2.4 Multiple input gates:

    With a single input gate such as the inverter or buffer, there can only be two

    possible input states: either 1 or 0. With multiple input gates, many possibilities are

    available for input states. The number of possible input states is equal to two to the

    power of the number of inputs. So, if a gate has n inputs, therefore there are 2n

    possible input combinations.

    2.4.1 The AND gate:

    The output of the AND gate is high if and only if all inputs are high. If any input

    is low, the output is guaranteed to be in a low state as well.

    Truth table:

    Let us draw the truth table of a two inputs AND gate.

    A B A.B

    0 0 0

    0 1 0

    1 0 0

    1 1 1

  • 8/4/2019 Logic Gates(new)

    5/19

    Digital Electronics_Jean-Paul NGOUNE 5

    As you can notice on the truth table above, the output is high only when all the

    two inputs are high.

    Symbol

    AB

    Output

    Exercise 2.1:

    Draw the truth table of a three inputs AND gate.

    Exercise 2.2:

    Complete the chronogram of the output Q of a two inputs AND gate.

    A

    B

    Q

    t

    t

    t

    The following solution can be given for the exercise 2.2 above:

    A

    B

    Q

    t

    t

    t

    0

    1

    0

    1

    0

    1

    2.4.2 The NAND gate:

    The word NAND is a verbal contraction of the words NOT and AND.

    Essentially, a NAND gate behaves the same as an AND gate with a not gate

    connected to the output terminal.

    Symbol

    A

    BOutput

  • 8/4/2019 Logic Gates(new)

    6/19

    Digital Electronics_Jean-Paul NGOUNE 6

    Truth table:

    Let us draw the truth table of a two inputs NAND gate.

    A B BA.

    0 0 10 1 1

    1 0 1

    1 1 0

    As with AND gates, NAND gates can be made with more than two inputs.

    Exercise 2.3:Complete the chronogram of the output Q of a two inputs NAND gate.

    A

    B

    Q

    t

    t

    t

    2.4.3 The OR gate:

    The output of the OR gate is high if any of the inputs is high. The output of an

    OR gate goes low if and only if all inputs are low.

    Truth table:

    A B A + B

    0 0 0

    0 1 1

    1 0 1

    1 1 1

    Symbol:

    A

    BOutput

  • 8/4/2019 Logic Gates(new)

    7/19

    Digital Electronics_Jean-Paul NGOUNE 7

    Exercise 2.4:

    Draw the truth table of a three inputs OR gate.

    Exercise 2.5:

    Complete the chronogram of the output Q of a two inputs OR gate.

    A

    B

    Q

    t

    t

    t

    Exercise 2.6:

    Let us consider the following digital circuit:

    A

    B

    C

    EX

    a. Give the expression of the output X.

    b. Draw the truth table of the digital circuit.

    Exercise 2.7:

    Draw the truth table of the digital circuit described by the following equation:

    ACCBAABX++=

    Exercise 2.8:

    Let us consider the following digital circuit:

    A

    B

    C

    D

    EX

    a. Give the expression of the output X.

  • 8/4/2019 Logic Gates(new)

    8/19

    Digital Electronics_Jean-Paul NGOUNE 8

    b. Draw the truth table of the circuit.

    c. Answer the two previous questions considering the following digital circuit:

    A

    B

    C

    X

    2.4.4 The NOR gate:

    The NOR gate is an OR gate with its output inverted.

    Truth table:

    A B BA +

    0 0 1

    0 1 0

    1 0 0

    1 1 0

    Symbol:

    A

    BOutput

    The NOR gate can also be manufactured with more than two inputs.

    Exercise 2.9:

    Let us consider the following digital circuit:

    AB

    C

    D

    EX

    a. Give the expression of the output X.

    b. Draw the truth table of the circuit.

  • 8/4/2019 Logic Gates(new)

    9/19

    Digital Electronics_Jean-Paul NGOUNE 9

    Remark 2.3: The negative AND gate, the negative OR gate.

    Let us consider the following digital circuit:

    A

    B

    X

    a. Draw the truth table of this circuit.

    b. Show that this circuit is equivalent to a NOR gate.

    The expression of the output X can be written as follow: BAX .= . Therefore,

    the truth table of the circuit can be easily deduced:

    A B X

    0 0 1

    0 1 0

    1 0 0

    1 1 0

    We can notice that the truth table of this circuit is identical to that of a NOR

    gate. The gate described in this exercise is called the negative AND gate and its

    symbol is given as follow:

    AB

    Output

    Let us consider the following gate circuit:

    A

    B

    X

    a. Draw the truth table of the circuit.

    b. Show that the circuit is equivalent to a NAND gate.

  • 8/4/2019 Logic Gates(new)

    10/19

    Digital Electronics_Jean-Paul NGOUNE 10

    The expression of the output X can be written as follow: BAX += . . Therefore,

    the truth table of the circuit can be easily deduced:

    A B X

    0 0 10 1 1

    1 0 1

    1 1 0

    We can notice that the truth table of this circuit is identical to that of a NAND

    gate. The circuit described in this exercise is called the negative OR gate. Its symbol

    is given as follow:1

    2

    3A

    BOutput

    Remark 2.4:

    The previous remark leads us to two important theorems of the Boolean

    algebra (the Boolean algebra will be studied in detail in the next chapter). Those

    theorems are called De Morgans theorems:

    BABA

    BABA

    +=

    =+

    .

    ..

    Where A and B are two Boolean variables (A Boolean variable is that which

    can only take values 0 and 1).

    2.4.5 The exclusive-OR gate:

    The exclusive-OR gate outputs a high level only if the inputs are at different

    logic levels, either 0 and 1 or 1 and 0. Conversely, its output is low if the inputs are at

    the same logic levels. The exclusive-OR gate is sometimes called XOR gate.

    Truth table:

    A B BA

    0 0 0

    0 1 1

    1 0 1

    1 1 0

  • 8/4/2019 Logic Gates(new)

    11/19

    Digital Electronics_Jean-Paul NGOUNE 11

    Symbol:

    A

    BOutput

    Exercise 2.10:

    Let us consider following gate circuit:

    A

    B

    Y

    a. Determine the expression of the output.

    b. Deduce the truth table.

    c. Conclude.

    Remark 2.5:From the exercise above the following property can be deduced:

    BABABA =+ ..

    2.4.6 The exclusive-NOR gate:

    The exclusive-NOR gate is equivalent to an exclusive OR gate with an

    inverted output. The truth table is exactly opposite as for the exclusive-OR gate. The

    exclusive-NOR gate also known as the XNOR gate.

    Truth table:

    A B BA

    0 0 1

    0 1 0

    1 0 0

    1 1 1

  • 8/4/2019 Logic Gates(new)

    12/19

    Digital Electronics_Jean-Paul NGOUNE 12

    Symbol:

    1

    2

    3A

    BOutput

    Exercise 2.11:

    Let us consider the following gate circuit:

    A

    B

    X

    a. Determine the expression of the output.

    b. Deduce the truth table.

    c. Conclude.

    Remark 2.6:

    From the previous exercise, the following property can be deduced:

    BABABA =+ ...

    The exclusive-OR and exclusive-NOR gates are very useful for circuits where

    two or more binary numbers are to be compared bit-for-bit, and also for error

    detection (parity check).

    2.5 Gate universality:

    NAND and NOR gates posses a special property: they are universal. That is,

    given enough gates, either type of gate is able to mimic the operation of any other

    gate type. This ability for a single gate type to be able to mimic any other gate type is

    enjoyed only by the NAND and the NOR gate.

  • 8/4/2019 Logic Gates(new)

    13/19

    Digital Electronics_Jean-Paul NGOUNE 13

    2.5.1 Constructing the NOT function:

    InputOutput

    Vcc

    Input Output

    InputOutput

    InputOutput

    2.5.2 Constructing the buffer function:

    InputOutput

    InputOutput

    Vcc Vcc

    2.5.3 Constructing the AND function:

    A

    B

    Output

    A

    B

    Output

    2.5.4 Constructing the NAND function:

    A

    B

    Output

  • 8/4/2019 Logic Gates(new)

    14/19

    Digital Electronics_Jean-Paul NGOUNE 14

    2.5.5 constructing the OR function:

    Vcc

    Vcc

    A

    B Output

    A

    B

    Output

    2.5.6 Constructing the NOR function:

    Vcc

    VccOutput

    Vcc

    A

    B

    2.6 Voltages for logic states:

    Logic gate circuits are designed to input and output only two types of signals;

    high (1) and low (0), as represented by a variable voltage: Full power supply

    voltage for a high state and zero voltage for a low state. However, in reality, logic

    state voltage levels rarely attain these perfect limits.

    TTL gates (Transistor Transistor Logic) operate on a nominal power supply

    voltage of 5 volts+/- 0.25 volts. Acceptable input signal voltages range from 0 volt to

    0.8 volt for low logic state, and 2 volts to 5 volts for high logic state. Acceptable

    output signal voltages range from 0 volt to 0.5 volt for low logic state and 2.7 volts to

    5 volts for high logic state.

  • 8/4/2019 Logic Gates(new)

    15/19

    Digital Electronics_Jean-Paul NGOUNE 15

    High

    Low

    High

    low

    High level noise margin

    Low level noise margin

    Figure 2.3: Voltage levels for TTL gates

    The noise margin of a gate is the difference between the tolerable output andinput ranges.

    For CMOS gates (Complementary Metal Oxide Semiconductor) operating at a

    power supply of 5 volts, the acceptable input signal voltages range from 0 volt to 1.5

    volts for low logic state, and 3.5 volts to 5 volts for a high logic state. Acceptable

    output signal voltages range from 0 volt to 0.05 volt for a low logic state and 4.95

    volts to 5 volts for a high logic state.

    Exercise 2.12:

    Calculate the high level noise margin and the low level noise margin for CMOS

    circuits operating at a power supply of 5 volts. Compare that noise margin with that of

    a TTL circuit.

    Remark 2.7:

    Unlike TTL, which is restricted to a power supply voltage of 5 V, CMOS may

    be powered by voltages as high as 15 volts or 18 volts.

    2.7 DIP gate packaging:

    Digital logic gates are manufactured as integrated circuits: all the constituent

    transistors and resistor built on a single piece of semiconductor material. The

    technicians and engineers find logic gates enclosed in DIP (Dual Inline Package)

    housing.

    Part numbers given to these DIP packages specify what type of gates are

    enclosed, and how many. These part numbers are industry standards.

  • 8/4/2019 Logic Gates(new)

    16/19

    Digital Electronics_Jean-Paul NGOUNE 16

    A 74LS02 manufactured by Motorola will be identical in function to a 74LS02

    manufactured by Fairchild or by other manufacturers. Letter codes added to the part

    number are unique to the manufacturer and are not industry standard codes. For

    instance, a SN74LS02 is a quad-2 inputs TTL NOR gate manufactured by Motorola

    while a DM74LS02 is the exact same circuit manufactured by Fairchild.

    Logic circuit part numbers beginning with 74 are commercial-grad TTL. If the

    part number begins with the number 54, the chip is a military grad unit having a

    greater operating temperature range, and typically more robust in regard to allowable

    power supply and signal voltage levels.

    The letters LS immediately following the 74 or 54 prefix indicate low power

    shottky circuitry.

    Figure 2.4: Examples of TTL DIP circuit packages:

  • 8/4/2019 Logic Gates(new)

    17/19

    Digital Electronics_Jean-Paul NGOUNE 17

    Figure 2.5: Examples of CMOS DIP circuit package

    2.8 Conclusion:

    In this chapter, we have studied the functioning of logic gates which are basic

    tools used in the design of any logic circuit. An introduction has also been made

    concerning the input and output voltage levels for TTL and CMOS circuits. The aim of

    the next chapter is the study of the Boolean algebra. It is a set of mathematical

    properties and identities governing the functioning of logic circuits.

  • 8/4/2019 Logic Gates(new)

    18/19

    Digital Electronics_Jean-Paul NGOUNE 18

    REVIEW QUESTIONS

    1. Consider the following gate circuit:

    A

    B

    C

    D

    X

    a. Give the expression of the output X.

    b. Draw the truth table of the circuit.

    2. Draw the gate circuits corresponding to the following expressions:

    ( ) DCQPBAZ

    DBCEDCBAY

    DCBAX

    ++=

    +

    ++=

    += )(.

    3. For each of the following circuits, give the expression of the output and drawthe truth table.

    A

    B

    C

    A

    B

    C

    X

    Y

  • 8/4/2019 Logic Gates(new)

    19/19

    Z

    A

    B

    C

    D

    References:

    1. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition,

    Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985.

    2. Lessons In Electric Circuits Volume IV Digital, Tony R. Kuphaldt, Fourth

    Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits.