Lab2.logic gates.EMT
Lab2.logic gates.EMT
Magnetism
Lab 2
Logic gates
Date:10-10-2022
Group 1
Group members:
(i) Ali Raza
(ii) Syed Husnain Raza
(iii) Muhammad Zeeshan Ayyub khan
(iv) Mian Muhammad Bilal
(v) Muhammad Asad Saeed
(vi) Syed Asad Hussain Bukhari
Experiment no.1
Objective:
The goal of this experiment is to test AND, OR and NOT logic gates by constructing
circuits using a Bread board and ICs of respective gates.
Theory:
A logic gate is a device that acts as the building block of a circuit. They
perform basic logical operations. They are based on Boolean Algebra. It can take inputs
of 1 (representing ‘voltage on’) or 0 (representing ‘voltage off’). The output is also any of
the two. A truth table is used to show the different combinations of inputs and the
corresponding outputs of the circuit.
The AND Gate takes two inputs and gives one output. The output is 1 or True
when both the inputs are 1. Otherwise, the output is 0 if either one or both the inputs are
0.
The symbol and truth table for the AND Gate is:
A B Y
1 0 0
0 1 0
1 1 1
0 0 0
The OR gate also takes two inputs and has a single output. The output is true or 1 if any
of the input is 1. Else, the output is false or 0.
The symbol and truth table for the OR gate is
A B Y
1 0 1
0 1 1
1 1 1
0 0 0
The NOT gate takes one input and one output. The output is True or 1 if input is false or
0. In other words we can say that NOT date simply inverts the input.
Symbol and truth table for NOT gate
X Z
1 0
0 1
Apparatus:
➢ Bread board
➢ ICs (7408,7432,7404)
➢ Resistor
➢ Small bulb
➢ Power supply (battery)
➢ Wires
Procedure:
➢ The goal of this experiment is to test different logic gates by constructing circuits
using a Bread board and IC, varying the inputs and seeing if the experimental output
is the same as the theoretical one. We test three gates, the AND, OR, and NOT.
➢ We use a Bread board to connect different ICs that represent different logic gates.
Ensuring the notch coincides to tell us where pin 1 is. The 7th pin of the IC is
connected to the negative terminal as it is the ground pin. The 14th pin represents the
control voltage and is connected to the positive terminal.
➢ For the AND and OR gates, pin 1 and pin 2 represent input A and input B
respectively. While pin 3 represents the output. While the NOT gate has a single input
at pin 1, and output at pin 2.
➢ The output pin is connected to a 1kΩ resistor connected to a small bulb, which will
serve as an indicator for our output. An output of 1 will turn the small bulb on, an
output of 0 will make it off.
Data analysis:
AND Gate:
To construct an AND gate, we plug the IC with code 7408 and construct the rest of the
circuit as outlined above. The pin 3, the output, of the AND gate is connected the resistor
and the small bulb. We then alternate the inputs at pin 1 and 2, trying every combination
as outlined in the truth table, by connecting the wires with the positive terminal to
represent a 1, and with the negative terminal to represent a 0.
A B Output=A×B=Y
1 0 0
0 1 0
1 1 1
0 0 0
OR Gate:
To construct the OR gate, we plug the IC with code 7432,
and construct the rest of the circuit as outlined by above.
The pin 3, the output, of the OR gate is connected the
resistor and small bulb. We then alternate the inputs at
pin 1 and 2, trying every combination as outlined in the
truth table, by connecting the wires with the positive
terminal to represent a 1, and with a negative terminal to
represent a 0.
A B Output=A+B=Y
1 0 1
0 1 1
1 1 1
0 0 0
NOT Gate:
To construct the NOT gate, we plug the IC with code
7404, and construct the rest of the circuit as outlined by above. The pin 2, the output, of
the NOT gate is connected the resistor and small bulb. We then alternate the inputs at pin
1, trying every combination as outlined in the truth table, by connecting the wire with the
positive terminal to represent a 1, and with a negative terminal to represent a 0.
A Output=A̅
0 1
1 0
Discussion:
The experiment results are in line with our expectations since if either one or both the
inputs were connected to the positive terminal, the bulb would turn on (not in AND and
NOT gate), resulting in an output of 1. If and only if both the inputs were 0, would the
bulb stay off. This is reminiscent of the ‘or’ logical function. It is used, for example, in an
intrusion detection system. If any of the sensors (motion sensor, pressure sensor, noise
sensor) register a value greater than the maximum safe value, a signal of 1 is sent to the
gate and the output will be ‘on’ which will sound the alarm.
Precautions:
➢ Ensure the IC is aligned properly by looking at the notch on the side
➢ Do not let the two terminal wires of the battery touch as it will short the battery
➢ Ensure the battery hasn’t run out, or the LED will be too dim to read
➢ Use a resistor in series with the LED, or the LED will blow
➢ Connect the LED properly as the longer leg represents the positive terminal.
____________