University of Engineering and
Technology, Mardan
Lab task 3:
OBJECT AND ORIENTED
PROGRAMMING
Name:Sara Fazal
Section: “A”
Registration No: 24MDBCS0541
Date: 17/feb/2025
Department of Computer Science
NAND GATE:
A NAND gate (short for “Not AND”) is a digital logic gate that performs the inverse of the AND
operation. It has two or more inputs and one output. The output is LOW (0) only when all inputs
are HIGH (1). In all other cases, the output is HIGH (1).
The truth table for a 2-input NAND gate is as follows:
Input A Input B Output
0 0 1
0 1 1
1 0 1
1 1 0
.
DIAGRAM OF NAND GATE:
LAB EXPEREMENT:
NOR GATE:
A NOR gate is a digital logic gate that performs the inverse of the OR operation. It has two or
more inputs and one output. The output of a NOR gate is HIGH (1) only when all inputs are
LOW (0). In all other cases, the output is LOW (0).
The truth table for a 2-input NOR gate is as follows:
Input A Input B Output
0 0 1
0 1 0
1 0 0
1 1 0
DIAGRAM OF NOR GATE:
LAB EXPERIMENT :