Sana'a University
Faculty of Engineering
Mechatronics Department
Third year
First Semester
Electronics Lab Report
Building Logic Gates Using Transistors
Name:
Dhia Ali Salah 202470066
Fares Salem Koleab 202470031
Farooq sewar 202470354
Supervised by:
Eng. Alia 'a jaghman
1
Table of Contents
Abstract …………………………………………………………………………………………………………3
Introduction…………………………………………………………………………………………….…….3
Tools and Components Uses……………………………………………………………………………….3
Methodology……………………………….…………………………………………………………………3
Procedure………………………………………………………………………………………………………………4
Simulation………………………………………………………………………………………………………………4
Results…………………………………………………………………………………………………………..4
Conclusion……………………………………………………………………………………………………..5
2
Abstract
In this experiment, we built four fundamental logic gates using 2N2222 transistors:
AND, OR, NAND, and NOR
The objective was to understand how basic logic operations are implemented at the hardware level using
transistors. The experiment was conducted using the Multisim simulation software, where transistors were
used as electronic switches controlled by input signals.
Each logic gate performs a specific binary operation commonly used in digital systems, and we verified their
function through input testing and output observation.
Introduction
Logic Gates:
Logic gates are the basic building blocks of digital circuits, used to process binary data (0s and 1s). In this
experiment, we implemented:
AND Gate: Outputs 1 only if all inputs are 1.
OR Gate: Outputs 1 if at least one input is 1.
NAND Gate: The inverse of AND; outputs 0 only if all inputs are 1.
NOR Gate: The inverse of OR; outputs 1 only if all inputs are 0.
Transistors:
A transistor is a semiconductor device used for amplification or switching. In digital logic circuits, it
functions as an electronic switch. In this experiment, we used the 2N2222 NPN transistor to control current
flow based on the base input voltage.
Tools and Components Used
The experiment was implemented using Multisim simulation software. The components used include:
2N2222 NPN transistors
Resistors (of various values for current limiting)
SPDT switches (Single Pole Double Throw) to simulate input logic levels
Green LED (to indicate output)
DC Voltage Source (5V)
Connecting wires (within the simulation environment)
Methodology
1. Circuit Design: Separate circuits were designed for each gate: AND, OR, NAND, and NOR.
2. Component Connections: Transistors were wired in specific configurations to achieve the desired logic
function.
3. Input Control: SPDT switches were used to toggle the logic input between HIGH (1) and LOW (0).
3
[Link] Control: Resistors were included to manage current flow and protect components.
5. Simulation: Circuits were simulated in Multisim and output was observed using an LED.
Result Recording:
Theoretical and simulated results were recorded for analysis.
Theoretical Results
AND Gate Truth Table:
A B X
0 0 0
1 0 0
0 1 0
1 1 1
OR Gate Truth Table:
A B X
0 0 0
1 0 1
0 1 1
1 1 1
4
NAND Gate Truth Table:
A B X
0 0 1
1 0 1
0 1 1
1 1 0
5
NOR Gate Truth Table:
A B X
0 0 1
1 0 0
0 1 0
1 1 0
Conclusion
In this experiment, we successfully implemented four basic logic gates—AND, OR, NAND, and NOR—
using 2N2222 transistors. The simulation results matched the expected truth tables, demonstrating how
transistors can be configured to perform logic operations without relying on premade integrated circuits.
This experiment provides foundational insight into how digital processors and systems are built at the
hardware level.
Recommendations and Tips
• Ensure correct pin connections for each transistor (Collector, Base, Emitter).
• Use suitable resistor values to protect LEDs and control current.
• Test all possible input combinations to verify the gate’s correct behavior.
• Use neat and organized circuit layouts for better understanding and debugging.
• Consider physically implementing the circuits on a breadboard in the lab for hand son experience.
• Future experiments may include implementing XOR and XNOR gates for deeper understanding.