Sie sind auf Seite 1von 16

UNIT 16 LOGIC GATES

Structure
Introduction
Objectives

Boolean Algebra
Logic Gates
AND Gate
OR Gate
NOT Gate
NAND Gate
NOR Gate
NAND and NOR Gates as Universal Gates

Circuits for Logic Gates


Elementary Ideas about ICs
Applications of Logic Gates
Summary
Terminal Questions
Solutions and Answers

16.1 INTRODUCTION
So far your students have been dealing with analog quantities, without, of course,
knowing the term. The signals that they have been using are analog signals - their
values vary in a continuous fashion over a broad range with respect to time. Now you
will be introducing another way of representing physical quantities: the digital mode.
In the digital mode of representation, physical quantities assume only discrete values
called digits. Your students are now going to l e a n about an important part of
electronics, which involves such discrete signals or digits - that is why it is called
digital electronics. Digital electronics is based on the binary number system that
involves only two digits 0 and 1.
Digital Systems
Assume only discrete values

Analog systems
Values vary over a broad range continuously

Fig.16.1: Digital systems and analog systems

The digital representation based on two numbers (0,l)is the basis for sophisticated
computers. Logically. these numbers can be used to perform varying operations that
involve even mimicking the functions of the human brain. The Binary digiTs together
form what is referred to as the "bit" in digital logic. Under the positive system of
logic, we can identify the following operations:

0 = False = Off = No, and


1 = True = On = Yes.

Atomic,. Nuclear Physics


and Electronics

The "on" and "off' are used to represent flow and stoppage of current in any arcjog
circuit. In most circuits 5V (analog DCV) represents it as being switched ON and 0'8;
(analog (DCV) or ground as switched OFF. Using this two-valued logic system, every
statement or condition must either be "true" or "false"; it cannot be partly true and
partly false. While this approach may seem limited, it actually works quite nice!y, and
can be expanded to express very complex relationships and interactions among any
number of individual conditions. In fact, digital'or binary logic is the basis of al:
digital electronics today.
One essential reason for basing logical operations on the binary number systen: .;k!#-,,
it is easy to design simple, stable electronic circuits that can switch back and f-4between two clearly defined states, with no ambiguity attached. It is also possible to
design and build circuits that will remain indefinitely in one state unless and until they
are deliberately made to switch over to the other. Examples from analog electronics
include thep-n junction diode (in its forward and reverse bias) and the bi-polar
junction transistor (BJT) between its saturation and cut-off values. We can connect
these devices to form logic gates, the basic components of digital circuits.
A digital circuit is designed for a desired application by a combination of several logic
gates. In this unit, we discuss the teaching of the basic concepts of Boolean algebra,
different logic gates: AND, OR, NOT, NAND and NOR, and electronic circuits for
logic gates. We also deal with integrated circuits in brief and give some real world
applications of logic gates, which you can use in your teaching.
Objectives
After studying this unit, you should be able to:
a

explain better to your students;

- the concepts of boolean algebra,


- the operation of basic logic gates (AND, O R , NOT) and their truth tables,
- the NAND and NOR gates and truth tables,
. - The electronic circuits of logic gates,
- integrated circuits,
- the applications of logic gates.
devise practical activities for helping students learn about logic gates; and
assess how well your strategies have worked.

16.2 BOOLEAN ALGEBRA


You know that Boolean algebra forms the basis of digital electronics. It is used to
represent logic operations. Boolean algebra can be used to simplify logic circuits, as
normal algebra is used to simplify mathematical expressions.
anecdotes about his life on the following URLs:

You could tell your students that


b Boolean algebra is a way of describing a circuit in the form of a mathematical
formula. It refers to the use of Boolean expressions to describe the relationship
between the input and the output.

Logic Gates

It is based on only two numbers, 0 and I , commonly thought of as "low or false" and
"high or true", respectively. Binary numbers and Boolean algebra are natural to use
with modern digital computers, which deal with switches and electrical currents that
.
are either on or off.

Tt involves the use of three basic operations on the binary digits 0 and 1. These are
called the

NOT, AND and OR operations and defined as follows:

>

The NOT operator operates on one value (the operand) (0 or 1) and negates it:
NOT 0 is 1 and NOT 1 is 0. It is represented by a bar over the Boolean variable.
For example:
= Not X.

(Explain to your students that operand means the value operated upon).

The OR operator operates on at least two operands, and yields a high value if
any of its operands (or both) are high (1 or true). It is represented by a + sign.
For example: X + Y = X OR Y.

P
'

The AND operator operates o,n at least two operands, and yields a high (1 or true)
value if all of its operands are high (1 or true.) It is represented by a dot ( 0 ) .
For example: X Y = X AND Y.

You can explain the NOT, AND and OR operations using Fig. 16.2.

0..
........................
NOT*

0 -.............................
1

AND+

0 ....................................

0R+l

Fig.16.2: Pictorial representation of NOT, AND and OR operations

These basic operations can be combined in many ways to give different outputs for
combinations of inputs. You can tell your students that just as we carry out arithmetic
operations on algebraic'functions, we can carry out these three operations on Boolean
functions for several practical applications. The three operations can be carried out
practically using electronic logic gates. Any Boolean function can be practically
implemented by using these logic gates.

16.3 LOGIC GATES


I
I

By definition, a logic gate is a circuit with one or more input voltages but only one
output voltage. Logic gates work according to some logical relationship (involving
the three logical operations AND, OR and NOT) between input and output voltages.
The gates are used in digital electronics to change one voltage level (input voltage)
into another (output) according to the logical relationship between them.

We express the relation between possible values of input and output voltages in the
,form of a table called the Truth table.

Atomic, Nuclear Physics


and Electronics

These basic logic circuits perform the logical operations of AND, OR and NOT.
Do tell your students the following points so that they have a better understanding of
logic gates:
Electronic logic gates require a power supply to function.
INPUTS to the gates are voltages having two discrete values, e.g., OV and 5V
representing logic 0 and logic 1, respectively (under positive logic of
operation).
The OUTPUT of a gate provides one of the two values of voltage only, e.g.
OV and 5V representing logic 0 and logic 1, respectively.
There exist other logical gates, like the NAND, NOR, and XOR gates. NAND
and NOR gates are also known as universal gates since all other operations like
NOT, AND, OR, XOR and XNOR can be simulated using them.
After a basic introduction to logic gates, you can go into the details of the basic logic
gates AND, OR and NOT as follows:

16.3.1 AND Gate


The AND gate implements the Boolean AND function.
The standard symbol of AND gate is given in Fig. 16.3. (In the symbol, the input
terminals (A and B) are at left and the output terminal is at right.)

Fig.16.3: Symbol of AND gate

You can ask your students to construct the truth table for a two-input AND gate on the
basis of its definition

The Boolean expression for the AND gate is

Point out that

>

The AND gate gives a high output (1) only if all its inputs are high.

The AND gate is so named because it acts in the same way as the logical
"AND" operator.

Logic Gates

16.3.2 OR Gate
The OR gate implements the Boolean-ORfunction where the output is 1 when any one
input is logical 1.

OR gate is so named as it implements the logical "OR" operation.


The standard symbol for OR gate is shown in Fig. 16.4.

Fig.16.4: Symbol of OR gate

You can have your students arrive at the truth table for a two-input OR gate using its
definition.
-

The Boo1,ean expression for the OR gate is

Point out that

1>

The OR gate gives a high output if one or more of its inputs are high.

16.3.3 NOT Gate


The NOT gate implements the Boolean NOTfunction where the output is the inverse
or complement of the input. It is also known as an inverter. If the input variable is A,
the inverted output is known as NOT A. This is also shown as A', or A with a bar over
the top (A).
Tell students that
Tbe NOT gate has only one input.

The standard symbol for NOT gate is given in Fig. 16,5.

Atomic, Nuclear Physics


and Electronics

NOT Gate (an-inverter)

INPUT
X=Af

Presence of small circle always


denotes inversion
Fig.16.5: Symbol of NOT gate

Let students write the truth table for the NOT gate

The Boolean expression for the NOT gate is

Now you can introduce some simple combinations of the basic gates such as the
NAND gate and the NOR gate.

16.3.4 NAND Gate


The NAND gate is an AND gate followed by a NOT gate.
The symbol of the NAND gate is shown in Fig. 16.6.
Two Inputs NAND Gate

INPUTS

OUTPUTS

- X = (AB)'

A-

~enbtesInversion
X

B-

= (AB)'

II

Fig.16.6: Symbol of NAND gate

It acts in the mznner of the logical operation "AND" followed by negation.


Let your students construct the truth table for the NAND gate:

Logic Gates

Point out that

The output of NAND gate is high if any of the inputs are low.

16.3.5 NOR Gate


The NOR gate is a combination OR gate followed by a NOT gate. NOR means
'neither A nor B'. Thus, the output is 1 only when neither A nor B is I.
The symbol for NOR gate is shown in Fig. 16.7
Two Inputs NOR Gate
INPUTS

OUTPUTS
' : = ( A +B)'

Denotes Inversion

Fig.16.7: Symbol of NOR gate

The truth table for the NOR gate can be determined by your students

Point out that

P the output is 1 when none of the inputs are 0. In other words, the outputs of all
NOR gates are low if any of the inputs is high.
J

Tell your students that if n is the number of input variables the total number
of possible input combinations ( N ) is given by: N = 2".

You can give your students some quick problems to solve before you proceed further.
SAQ 1

Devise a set of questions to help students check their understanding. You could
include questions like the following:

a) Fill in the blanks


i) In --------- gate an output 1 is obtained when both inputs are at 1 state.
ii) In NOR gate a high output is obtained when inputs are at ---- state etc.
b)

What will be the boolean expression for the following circuits?

Give a few circuits.

Atomic, Nuclear Physics


and Electronics

You can make use of Table 16.1 to compare different logic gates.
Table 16.1: Comparison of logic gates
Basic Logic Gates

Logic

Boolean
Expression

Symbol

Dy

Y = A+B

OR

.B
A

NOT

Table

ay
Y = A-B

AND

English

Truth
A
0
0
1

B
0
1
01

0
0
01

B
0
1
0
1 .A 1 Y

A
0
0
1

0
1

Y=A

Y
0
1

1
1

Expression
The only time the
output is HIGH is
when all the inputs
are high.

The output will be


HIGH when any
one or all inputs are
high.
The output is the
opposite of the
input.

Y = A-B

NAND

A
0
0

B
0
1

Y
1
1

1
1

0
1

The output is HIGH


provided all the
inputs are not highs

1
16.3.6 NAND and NOR Gates as Universal Gates
You could explain the NAND Gate Operations as a universal gate, as follows:
NAND gates can be used as NOT, AND and OR gate as shown below in Fig.16.8:
-

a) When the same input is given at both terminals, the output is A .


b) The use of two NAND gates in succession yields the output A.B.
c) Two single input NAND gates followed by another NAND gate result in the
output A+ B.

Explain each of these operations to your students. Ask them to construct the
truth tables for each case and verify the results for themselves.

y-.Am

NAND

Fig.16.8: Construction of NOT, AND and OR gates from NAND gates

NOR gate operations

NOR gates can also be used as NOT, AND and OR gate as shown in Fig. 16.9.
Explain each of these operations to your students. Ask them to construct the truth
tables for each case and verify the results for themselves.

Fig.16.9: Construction of NOT, AND and OR gates frdm NOR gate

You can also do the following activity to show these gates to your students.
Activity 1

Take a 7400 IC (Quad 2 input NAND gates) and show the realization of all other
gates (NAND, NOT, OR, AND, NOR, XOR, XNOR). It is a 14 pin DIP (Dual in line
package) IC. You will need the following components to show the working of the
gates:
Bread-board 1PCB (Printed Circuit Board) 1 Chassis
14 pin or greater IC base
LEDs (Green, Red, Orange, Yellow) -to differentiate between the input states and
output states.
5V dc supply, Connecting wires
Resistance - 1K, 3.3K to fiction as current limiting resistors
Typical cost of the 7400 IC is Rs.71We give in the margin the diagram of the 7400 IC with the interconnections:
Connect the pin 14 of the 7400 IC to the positive of the 5V dc supply and pin 7 to the
ground terminal (negative in this case). The binary high (1) and low (0) states will be
+5V and OV, respectively. Now connect the NAND gates as in Fig. 16.8 to show the basic gates: AND, OR and

This activity should help stydents acquire a feel for what logic gates are about: they
allow an output for given inputs according to certain logical operations.
Now you could explain the electronic circuits that make up these gates.

. ~ o ~Gates
i c

Atomic, Nuclear Physics


and Electronics

16.4 CIRCUITS FOR LOGIC GATES


We give the electronic circuits for the basic logic gates. AND, OR and NOT.
a) AND gate

The circuit for the two input AND gate is shown in Fig. 16.10. It has two p-n
junction diodes (of silicon).

+5v

L
-T

A.

--

Output
'Y

Fig.16.10: Circuit of AND gate using diodes

The resistor in the circuit controls the current passing through the diodes. Repeat
to your students that a low value (0 bit) is assigned OV and high value (1 bit) is
assigned 5V. But point out that such accurate values are not possible at the output
in practical electronic circuits. In fact, a low value is assigned a'voltage range OV
to 0.8 V and a high value is assigned a voltage range of 3 V to 5V.
You can explain the operation of this circuit as follows:

1 ) A=O and B=O.


When the inputs are connected to ground terminal or OV, then both the diodes are
forward biased and hence conduct. The entire voltage appears across R. Thus the
output voltage which is the voltage drop across each diode is low (0.7V) or 0.
2) A=O and B=l.

When input A is connected to the ground terminal and input B is connqcted to the
positive terminal of the battery (5V), then diode Dl is forward biased ut diode D2
is not biased (as both p and n sides of diode are connected to the Sam voltage
5V). Thus output voltage is voltage drop across diode Dl (which is 0.7 V). It is
thus low or 0.

3) A=l and B=O.


When input A is connected to the 5V battery and input B is connected to ground,
then like the previous case only one diode is forward biased or conducts which in
this case is diode D2 The output voltage is the voltage drop across this diode and
is 0.7 V, i.e., low or 0.
4 ) A=l and B=l.

When both the inputs are connected to the 5V battery then both the sides of the
diodes (Dl and D2) are at same voltage and hence both diodes are not conducting.
Therefore the output voltage is the battery voltage which is 5V, i.e., high or 1.

Draw all four circuit diagrams on the board or an OHP transparency and explain each
step clearly.

All these four cases satisfy the truth table of AND gate.
~ o ; m o r e input AND gate the number of diodes will be more. There will be as many
diodes as the number of inputs.
You can show your students an AND gate in the lab.
You can use the following components:
Diodes - IN4001
R-lKc2
The power supply is a 5V dc source
Use LEDs along with the diodes to show which of the signal diodes (lN4001) is
actually conducting.
b) OR gate

The circuit of an OR gate has two p-n junction diodes as shown in Fig. 16.1 1.

+re'
Dl

+5v

1,
__

Be

Output
'Y

Fig.16.11: Circuit of OR gate using diodes

The input voltage is applied to the terminals A and B. It can be either 0 or 5V. You can
again explain the following cases:
1) A=O and B=O.

When the inputs are connected to ground terminal or OV, then both the diodes are
not biased or do not conduct (as both p and n sides of diode are connected to same
voltage OV) and hence no current flows through the diodes. Thus the output
voltage is l o p or 0.

2 ) A=O and B=l.

When input A is connected to the ground terminal and input B is connected to the
positive terminal of the battery (5V), then diode Dl is not biased or does not
conduct (as both p and n sides of diode are connected to same voltage OV) but
diode D2 is forward biased with 0.7 V voltage drop across it and 4.3 V(5-0.7 V)
across the resistor. Point out that the output in this case is the voltage drop across
the resistor. Thus output voltage is high or 1 .

Logic Gates

Atomic, Nuclear Physics


and Electronics '

3 ) A=l and B=O.

When input A is connected to the 5V battery and input B is connected to ground,


then like the previous case only m e diode is forward biased or conducts which in
this case is diode D l Thus output voltage is high or I .
4) A = l and B=l.
When both the inputs are connected to the 5V battery then both the sides of the
diodes (Dl and D2) are at same voltage and hence both diodes are forward biased
or conducting and the voltage drop across the resistor.R continues to be 4.3 V.
Therefore, the output voltage is high or I .
All these four cases satish the truth table of OR gate.

The components used to set up the AND gate can be used here also. You can
demonstrate the OR gate to your students or ask them to connect the circuit and
verify its operation.
c) NOT gate

The circuit for the NOT gate has a transistor as shown in Fig. 16.12.

Fig.16.12: Circuit for NOT gate using transistor in CE configuration

The base of the transistor is connected to input A fhrough the resistor RB,while the
emitter is earthed. The collector is earthed through a resistor Rc and 5V battery. You
can explain the operation of this circuit as follows:

When the input A is connected to the ground terminal of the battery, then the base
of the transistor also gets earthed. Therefore, emitter-base junction is not forward
biased (as both the emitter and base are earthed or connected to same OV).
Moreover since the base current is zero, the collector current is also zero. This is
said to be the cut-off mode of the transistor. Since there is no voltage drop across
Rc, the output voltage will be equal to the voltage of the battery (5V) connected to
the collector, i.e., high or 1.

When the input A is connected to the positive terminal.of battery (5V), then the
emitter base junction gets forward biased. It leads to a very large base current
resulting in a very large collector current. The transistor is then in the saturation
mode. This indicates that most of the bias voltage (-5V) drops across Rc and the
output voltage is low or 0.

Logic Gates

To demonstrate the NOT gate, use a transistor in BC 148 series. The main idea is to
switch the transistor between its saturation and cut-off values based on the input and
not allow it to function in the active region. You can use the following components:
Rc=1KRto1OKl2
Rb=lOKR
The voltage source can be a 5V dc supply.

SAQ 2
Demonstrate the working of logic gates to your students.. Write a report on how well
these worked in helping them understand the concept better.

16.5 ELEMENTARY IDEAS ABOUT ICs


All the logic elements and most of the circuits we have looked at so far are available
in off-the-shelf packages called integated circuits (ICs). In an integrated circuit, all
components are fabricated on a single, semiconductor silicon wafer (a few microns
thick) by the method of diffusion. The components and interconnections (achieved
through metallic coatings) are an integral part of the chip and hence the name
integrated circuit. Pins are provided on the IC to Connect the circuit to external
signals.
An IC may contain up to lakhs of individual gates on a silicon chip in a plastic or a
metallic package. The first integrated ciricuit (IC) on a silicon wafer was fabricated in
the 1960s having only a few gates. IC chips are usually de$ned in terms of the number
of logic gates that they contain and the complexity.increases with the number of gates.
Table 16.2 shows the classification of ICs according to the number of gates in them.

able 16.2: Classification of ICs


'

Classification

Complexity

Examples

SSI (Small Scale


Integration)

Less than 10 gates Independent logic gates like 2 input OR or


NAND gates etc.

MSI(Medium Scale
integration)

10 to 100 gates

IC's that perform one standard function


(Adders, Flip Flops, Counters, Decoders)

LSI (Large Scale


Integration)

I00 to 5000 gates

IC's that perform relatively complex


functions (Memory devices, Arithmetic
logic units (ALU))

VLSI (Very Large


Scale Integration)

More than 5000


gates

Microprocessors (32 and 64 bit), memory


chips.

ULSI( Ultra Large


Scale Integration)

More than 50,000 Random Access Memories (RAMS), ULSI


(50K) gates
technology is used mostly in Japan

You could tell your students that


*:*

In the real world of digital electronics it is simply impractical to produce single


logic gate structures and instead ICs are preferred which contain multiple logic
circuits.

Atomic, Nuclear Physics


and Electronics

Advantage of ICs on conventional electronic circuits:


Small size;
Low power consumption;
High speed;
Highly reliable because all components are fabricated simultaneously and there
are no soldered joints;
Low cost due to processing of large quantities of components.
You would have already shown ICs to your students while demonstrating NAND
gates. We now discuss some applications of Logic Gates.

16.6 APPLICATIONS OF LOGIC GATES


Logic gates form the building blocks of all digital systems. The basic logic gates
comprise of AND, OR and NOT. It is these gates, used in differing combinations, that
allow the computer to execute its operations using binary language. Today, all our
computers employ Boole's logic system - using microchips that contain thousands of
tiny electronic switches arranged into logical 'gates' that produce predictable and
reliable conclusions.
In recent years digital systems have become an integral part of our every day lives.
We wake up to the music of a digital alarm clock.
Cars have digitally controlled fuel injection systems and electronics.
There are computer-coded grocery items in shops.
Nowadays digital systems are extensively used as memory devices.
Digital systems are employed for storage and transmission of data.
In laboratories we make use of digital multimeters for checking electronic
components and digital CRO's for time and frequency measurement.
Computers are undoubtedly the best known and most prominent class of digital
systems.
Satellite communication systems, space vehicles, telephone networks, industrial
production lines and home appliances are some of the other application areas that
make use of digital electronics.
Digital traff~ccontrollers are used to measure traffic flow on crossroads and adjust
the period of traffic lights to maximize flow.
Digital anti-skid devices measure the speed of truck wheels and adjust braking
force to prevent skids.
Digital ignition controllers measure the carburetion and timing of airtomobiles
engine to reduce emission.
The flight pattern of a plane landing on an aircraft carrier takes on continuing
values but a digital pulse radar tracking system sends out radar pulses periodically
so that returning signals form a finite sequence of numbers that approximate the
planes present position, present velocity and future position.
We now summarise the contents of this unit.

Logic Gates

16.7 SUMMARY
Boolean algebra is used to describe the input and output relationship with the
help of boolean expression.
Logic gates are digital circuits that work according to some logical relationship
between input and output voltages.

Digital systems are constructed by using three basic logic gates viz. AND, O R
and NOT gate.
Output of AND gate is high (1) only when all the inputs are high.
The output of O R gate is low (0) only when all inputs are low.
The output of NOT,gate is inverse or complement of the input.
NOT gates can be cdmbined with AND or OR to give NAND (not and) or NOR
(not or) gates.
The NAND and NOR are called universal gates since with either one the AND,
OR and NOT gates can be generated.
In a truth table the total number of possible input combinations is 2" where n is
the number of input variables.
The circuits of logic gates can be made with the help of diodes or transistors etc.
An integrated circuit (IC) contains from several to millions of individual gates on
a silicon chip in a plastic package.
The different sizes of the integration (SSI, MSI, LSI, VLSI and ULSI) of IC chips
are usually defined in terms of the number of logic gates or number of
components fabricated on a chip.
Logic gates form the building blocks of a digital systems and have wide ranging
applications in life today.

16.8 TERMINAL QUESTIONS


1. Construct a set of problems for your students having questions of the following
kind:
a) Differentiate between digital and analog systems.
b) What is the output of following logic circuit? (Explain with the help of
boolean expression and truth table)
Give Logic circuits
c) Which of the following circuits will have high or 1 output?
Give circuits
d) Write the truth table for following combination of gates.
Give combinations
e) What arC the criteria of classifying the ICYs?
f) Explain the importance of logic gates in our lives.
And so on.

2. How did your students perform on the test? What were their difficulties? What
moredo you need to do to improve their understanding?

Atomic, Nuclear Physics


and Electronics

$6.9 SOLUTIONS AND ANSWERS


SAQs
1. (a) (i) AND

(ii) 0
(b) Depends on the circuit you used.
2. Bring your report to the ECP.

Terminal Questions
1. Bring the set of problems you designed and some responses of your students to
the ECP.

a) The digital system is one that processes a Gnite set of data in digital (numeric)
form rather than processing continuous variables and is capable of
manipulating discrete elements of information. Whereas in analog systems
data values show a continuous variation over a broad range. See details in Sec.
16.1.
2. Bring your report to the ECP.