You are on page 1of 19

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.

Digital Electronics_Jean-Paul NGOUNE

Chapter Two

LOGIC GATES
2.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:
Vcc

1
S R

LED

Figure 2.1: Logic circuit.

Digital Electronics_Jean-Paul NGOUNE

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 0 1 Output 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.

Digital Electronics_Jean-Paul NGOUNE

1 0 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.
Input

Symbol of a buffer gate:


Output

Truth table of the buffer gate: Input 0 1 Output 0 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 0 0 1 1 B 0 1 0 1 A.B 0 0 0 1

Digital Electronics_Jean-Paul NGOUNE

As you can notice on the truth table above, the output is high only when all the two inputs are high.
A B

Symbol
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

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

B
1

Q
1 0

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.
A B

Symbol
Output

Digital Electronics_Jean-Paul NGOUNE

Truth table:

Let us draw the truth table of a two inputs NAND gate. A 0 0 1 1 B 0 1 0 1

A.B
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

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 0 0 1 1
A B

B 0 1 0 1

A+B 0 1 1 1

Symbol:
Output

Digital Electronics_Jean-Paul NGOUNE

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

Exercise 2.6: Let us consider the following digital circuit:


A B C X E

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:

X = AB + ABC + AC
Exercise 2.8: Let us consider the following digital circuit:
A B C D E X

a. Give the expression of the output X.

Digital Electronics_Jean-Paul NGOUNE

b. Draw the truth table of the circuit. c. Answer the two previous questions considering the following digital circuit:
A B X

2.4.4 The NOR gate: The NOR gate is an OR gate with its output inverted. Truth table: A 0 0 1 1

A B

B 0 1 0 1

A+ B

1 0 0 0

Symbol:
Output

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

Exercise 2.9: Let us consider the following digital circuit:


A B C D E X

a. Give the expression of the output X. b. Draw the truth table of the circuit.

Digital Electronics_Jean-Paul NGOUNE

Remark 2.3: The negative AND gate, the negative OR gate. Let us consider the following digital circuit:

A X B
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: X = A.B . Therefore, the truth table of the circuit can be easily deduced: A 0 0 1 1 B 0 1 0 1 X 1 0 0 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:
A B Output

Let us consider the following gate circuit:

A X B
a. Draw the truth table of the circuit. b. Show that the circuit is equivalent to a NAND gate.

Digital Electronics_Jean-Paul NGOUNE

The expression of the output X can be written as follow: X = A. + B . Therefore, the truth table of the circuit can be easily deduced: A 0 0 1 1 B 0 1 0 1 X 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:

A B

1 3 2

Output

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:

A + B = A..B A.B = A + B
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 0 0 1 1 B 0 1 0 1
A B

0 1 1 0

Digital Electronics_Jean-Paul NGOUNE

10

Symbol:

A B

Output

Exercise 2.10: Let us consider following gate circuit:

A B
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:

A.B + A.B = A B
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 0 0 1 1 B 0 1 0 1

A B
1 0 0 1

Digital Electronics_Jean-Paul NGOUNE

11


A B
1 2

Symbol:
3

Output

Exercise 2.11: Let us consider the following gate circuit:

A B

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:

A..B + A.B = A B
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.

Digital Electronics_Jean-Paul NGOUNE

12

2.5.1 Constructing the NOT function:


Vcc Input

Output Input

Output

Input

Input Output

Output

2.5.2 Constructing the buffer function:


Vcc Vcc

Output Input

Input Output

2.5.3 Constructing the AND function:


A B Output

Output B

2.5.4 Constructing the NAND function:


A

Output B

Digital Electronics_Jean-Paul NGOUNE

13

2.5.5 constructing the OR function:


Vcc

Vcc

Output

A B

Output

2.5.6 Constructing the NOR function:


Vcc

Vcc A

Vcc

Output

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.

Digital Electronics_Jean-Paul NGOUNE

14

High

High
High level noise margin

Low
Low level noise margin

low

Figure 2.3: Voltage levels for TTL gates

The noise margin of a gate is the difference between the tolerable output and input 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.

Digital Electronics_Jean-Paul NGOUNE

15

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:

Digital Electronics_Jean-Paul NGOUNE

16

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.

Digital Electronics_Jean-Paul NGOUNE

17

REVIEW QUESTIONS
1. Consider the following gate circuit:
A X

B C

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:


X = A.B(C + D) Y = A + B + C D E + BC D Z = A + B + PQ C D

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

A B

Digital Electronics_Jean-Paul NGOUNE

18

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.

Digital Electronics_Jean-Paul NGOUNE

19

You might also like