0% found this document useful (0 votes)
13 views8 pages

Applications of NAND Logic Gates

The document discusses logic gates, particularly focusing on the NAND gate, which is fundamental in digital circuits for making decisions based on binary inputs. It explains various types of logic gates (NOT, AND, OR, etc.) and their applications in real-world scenarios, such as alarms and automated systems. Additionally, it covers the construction of other gates using NAND gates and introduces concepts like half adders and full adders for binary addition.

Uploaded by

troyer236
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views8 pages

Applications of NAND Logic Gates

The document discusses logic gates, particularly focusing on the NAND gate, which is fundamental in digital circuits for making decisions based on binary inputs. It explains various types of logic gates (NOT, AND, OR, etc.) and their applications in real-world scenarios, such as alarms and automated systems. Additionally, it covers the construction of other gates using NAND gates and introduces concepts like half adders and full adders for binary addition.

Uploaded by

troyer236
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

LOGIC GATES

The switching action of a transistor makes it especially suitable for use in digital logic circuits
where the output is either 0 or 1 depending on the input. Applications of such circuits are to:

Switch on a water pump on a hot sunny day.


Sound an alarm if the pilot light of a boiler went off
Sound an alarm if a burglar stepped on a pressure pad or shone his torch.
Switch a light on if it was a cloudy day.
Add two simple binary numbers together.
Switch on a fan if a darkroom door was shut and it was warm inside.

All these things and indeed many more can be done with ELECTRONIC LOGIC CIRCUITS.
These circuits are ones that can make decisions. Different decisions need different circuits.
If you refer to the switching circuit for the transistor you will see that the output voltage is
high (consider this as 1) when the input voltage is low (consider this as 0). This is the basic
NOT gate
- there is an output when there is not an input.

Combinations of these switching circuits can be made into logic gates that will perform
simple decisions within a microprocessor. These logic gates are the basis of all decisions
within computers and from now on we will consider their effects rather then their internal
structure. We will consider the following types of logic gate:
(a) NOT gate - this gives an output 1 for an input of 0
(b) NOR gate - this gives an output 1 for neither of two inputs 1
(c) OR gate - this gives an output 1 for either of two inputs 1 and both inputs 1
(d) AND gate - this gives an output 1 for both two inputs 1
(e) NAND gate - this gives an output I for either but not both of two inputs 1 or both inputs 0
(f) EXCLUSIVE-OR - this gives an output I for either but not both of two inputs 1
(g) EXCLUSIVE-NOR - this gives an output 1 when both inputs are 0 or 1

Because of its wide use in modern digital electronics the NAND gate will be considered as a
basic building block for a variety of logic circuits. In fact a number of other logic gates can be
constructed from NAND gates as is shown below. The circuit in Figure 1 shows how a NAND
gate might be constructed from discrete components, although it would normally be in the
form of an integrated circuit.

+6V
Figure 1
R2
R1
A F

0
There will be a large output voltage across the transistor as long as at least one of the inputs
is made low.

Think about just two of the examples:

1
The hot sunny day.
To switch on the pump it must be hot AND sunny. This needs an AND circuit.

The burglar alarm.


To sound the alarm the burglar has to step on the pressure pad OR switch on his torch. This
needs an OR circuit.

A summary of how each circuit behaves is called a TRUTH TABLE and the circuits
themselves are usually called LOGIC GATES.
The truth tables and symbols for the most common logic gates are shown below.

Input Output Inputs Output


I F A B F
0 1 0 0 0
1 0 1 0 0
NOT
AND 0 1 0
1 1 1
Inputs Output
A B F
Inputs Output
0 0 1
A B F
1 0 1
0 0 0
0 1 1
OR 1 0 1
NAND 1 1 0
0 1 1
1 1 1
Inputs Output
A B F
0 0 1
1 0 0
NOR 0 1 0
1 1 0

Inputs Output Inputs Output


A B F A B F
0 0 0 0 0 1
0 1 1 0 1 0
1 0 1 1 0 0
EXCLUSIVE NOR
1 1 0 1 1 1
EXCLUSIVE OR

SUMMARY OF THE USE OF THE NAND GATE


One of the most useful circuits in school electronics is the NAND gate and so we will think
about what it does in a little more detail.
(a) it has two inputs - if either (or both) these are 0 then the output is 1 (high) , but if both are
1 the output is 0 (low)
(b) a flying lead (unconnected input) is high (1)

2
a few milliamps. It will therefore operate a buzzer with difficulty but will NOT operate a motor
(the motor will need hundreds of milliamps)

MAKING OTHER LOGIC GATES FROM NAND GATES


The circuits below show you how to make a NOT, OR, NOR and AND gate using NAND
gates.

NOT AND
OR

Figure 2

NOR

STUDENT INVESTIGATIONS
Design and construct circuits using NAND gates that will do the following things:
(a) switch a light on when it gets dark
(b) switch a light on when it gets light
(c) detect when an object is longer than a certain length
(d) switch on a warning light when either of the two front doors of a car are open
(e) sound a buzzer if there is a person sitting on the front seat of a car and the ignition key is turned
(f) sound a buzzer when all three coconuts on a coconut shie have been knocked off
(g) switch a light on if a safe door has been closed but not locked
(h) switch on a buzzer when the temperature of a room falls below a certain value

Op amp uses
Two practical uses of the voltage comparator are as a flame sensor and as a heat sensor.

(i) Flame sensor


The circuit in Figure 1 might be used in a gas boiler to monitor the pilot light. The alarm is
required to sound when the flame of the pilot light goes out.

R2
R1

Figure 1 P
alarm
Q

LDR R3

3
A light-dependent resistor (LDR) is the sensor: its resistance is low in light and high in the
dark.

When the flame is on the resistance of the LDR is low, the voltage at Q (V 2) is low, (V2 - V1)
is negative and the alarm is off. If the flame goes out, however, V 2 rises such that (V2 - V1)
becomes positive, the op amp switches to positive saturation and the alarm is switched on.

(ii) Heat sensor


This sensor (Figure 2) is designed to operate one of two LEDs to show whether the heat
sensor, the thermistor, is hot or cold.

LED 1
P Figure 2

Q
LED 2

When the thermistor is cold its resistance is large, the voltage at Q (V2) is large, and the op
amp is in a positively saturated condition, that is, the output voltage (VO) is positive. LED 1
therefore conducts.

When the thermistor warms up a point will be reached when the voltage at Q falls below that
at P; (V2 - V1) is therefore negative, the output voltage is negative and LED 2 conducts

Applications of the NAND gate


(a) Burglar alarm
When the switch is closed one input of the NAND
gate is LOW. When the LDR is in the light the
other input is LOW. This means that if either of
these things happen, i.e. the switch is closed or
the light is on one of the inputs is LOW, the output
is HIGH and the buzzer sounds.

Figure 1

(b) Freezer warning buzzer


When the thermistor is COLD its resistance is
LARGE and the input to the NAND gate is high.
Since the NAND gate is connected as an
INVERTER the output is LOW.
As the thermistor warms up its resistance
decreases, the voltage across it falls and the input
to the NAND gate falls.
When it becomes low enough the output becomes
HIGH and the buzzer sounds. Figure 2

4
How would you adjust the temperature at which the buzzer came on?

Further circuits using logic gates


The following four circuits demonstrate some further practical applications of logic gates, the
function of each circuit being explained.

A push-button lock
To open the lock the solenoid must be activated and this can be done by pressing both
switches A and B. If B is pressed before A, however, the buzzer will sound.

+5V
A B

LOCK

A light-activated burglar alarm


When the switch is in position A the buzzer +5V
stays off whatever the illumination of the
light-dependent resistor. If the switch is
closed in position B the buzzer will come on,
however, and stay on when a brief flash of
light (perhaps from the torch of a burglar)
falls on the light-dependent resistor. The A
buzzer may only be turned off by returning R B
the switch to position A.
0
A safety thermostat
The two contacts X and Y are near the top of
the hot water tank and are normally covered X +5V
with water so that there is a contact between contacts
them. The thermistor is also in the water. If R
Y
the water is too cold and if the contacts are
also covered the heater comes on. The
temperature at which this occurs may be set
by the variable resistor R.

An automatic watering system

5
This is designed to water plants only if the contacts, which may be buried in the soil, are too
dry and it is night-time. The relay closes and starts the pump only if both these conditions
are fulfilled. (Presumably somebody waters the plants in the daytime because if the switch is
pressed the water pump works regardless.)

+5V

R
M
pump

The bistable circuit


A very useful electronic circuit is one which is set into one of two stable states by one input
switch and will not change its state until the other input switch is pressed. An example of a
use of such a circuit is a burglar alarm fitted to a car, the alarm comes on when the burglar
opens the door and does not go off until the owner presses a reset switch within the car.

The NAND gate bistable multivibrator


Such a circuit may be made with two NAND gates
connected as shown in Figure 1 S R B C P Q
1 1 1 0 0 1 +6V
The two inputs are two simple push 0 1 0 1 1 0
switches, they will be LOW when the switch 1 1 0 1 1 0
is pressed but spring open to become 1 0 1 0 0 1 P
B
HIGH when the switch is released.
We will call the inputs S (set) and R (reset) S
and the two outputs P and Q. The other
inputs to the NAND gates are labelled B
and C. C Q

Initially suppose that P is LOW (0) and Q is R 0


HIGH (1). Now if S is pressed the output P
becomes HIGH (1) and the output Q Figure 1
becomes LOW (0) since C becomes 1. The
input B therefore becomes LOW (0).

Releasing S and then pressing it again will not alter the output states. This can only be done
by pressing R.

The truth table for the bistable circuit is shown here.

The fire alarm


+6V
A 6
A circuit using a NAND gate bistable that will act as a fire alarm is shown IN Figure 2.

To start with the buzzer is off and so the output from gate A must be 0. This means that the
output from gate B must be 1. The thermistor is cold, its resistance is high and so the two
inputs to gate A are both 1. When the thermistor is warmed its resistance falls and the lower
input to gate A becomes 0. Gate A now switches and its output becomes high (1) and the
buzzer sounds.

See if you can show that cooling the thermistor will not switch the alarm off.
To do this the reset switch R must be pressed.
Figure 2

The NAND gate astable multivibrator


In the section on transistors we considered the transistor astable multivibrator. Figure 3
shows the NAND gate version of this useful circuit.

B
Figure 3

R
We will call the output voltage from the circuit V. Imagine that initially the input to A is high,
this means that the output from A is low and the output from B is high. If the output from B is
high the input to B must be low.

The capacitor C therefore charges up through R and the potential at the input to B rises.
When this potential is high enough B switches making the output to B low. This means that
the input to A is low and therefore the output from A is high. C now discharges through R
until B switches to a high output; the process then repeats itself. The switching rate and
therefore the output frequency depends on the values of R and C.

Half adder

By a small extension of the EXCLUSIVE-OR gate we can obtain a circuit that will not only
add two simple binary digits but also give a carry bit.

We need a circuit where the sum bit is 0 if the two inputs are either both 0 or both 1 and
where the carry bit is 1 only if both inputs are 1.

SUM

B
Figure 1
7

CARRY
Using Boolean algebra notation and taking the inputs as A and B we can obtain the following
equations for the sum bit (S) and the carry bit (C):

The sum bit (S) is given by S = A.B + A.B The carry bit (C) is given by C = A.B

You should see that the sum bit will be given by an EXCLUSIVE-OR gate and the carry bit
by an AND gate. A version of the half adder circuit is shown in Figures 1.

You should follow through the circuit checking the condition at A B SUM CARRY
each NAND gate to see that it produces the required output. 0 0 0 0
The truth table for the half adder is given below. 0 1 1 0
1 0 1 0
1 1 0 1

An alternative version of the half adder circuit is shown in Figure 2.

SUM

Figure 2
B

CARRY

Adder circuit
Using two half adders and an OR gate a full adder circuit may be produced that will add
three bits A, B and C. The circuit for the full adder is shown in Figure 3.

A SUM
Half adder Half adder
B
Figure 3

CARRY IN

CARRY OUT

The Boolean notation for such a circuit is:

SUM bit = A.B.C + A.B.C + A.B.C + A.B.C

CARRY bit = A.B.C + A.B.C + A.B.C + A.B.C

The truth table for the A B CARRY IN SUM CARRY OUT full adder is shown
below. 0 0 0 0 0
0 1 0 1 0
1 0 0 1 0
1 1 0 0 1 8
0 0 1 1 0
0 1 1 0 1
1 0 1 0 1
1 1 1 1 1

You might also like