Exp3
Exp3
OBJECTIVES
1. To construct digital logic circuits with NPN transistors.
2. To verify the truth table of logic gates.
INTRODUCTION
All modern computers today use binary digital logic circuits. These circuits have just two
possible output voltages, which can be denoted by any contrasting terms; the most common are
“HIGH/LOW”, or “TRUE/FALSE”, or “ONE/ZERO.”. Such an output is called a “binary
digit,” or bit. The decimal numbers and alphabet characters we are familiar with are converted
to binary bits before they are fed into a computer’s arithmetic logic unit (ALU).
Inside the ALU, the computer executes a program and generates results in binary. The results
are then converted back to decimal numbers, alphabet letters, graphics, or sound so we can
understand them. Inside the computers, the fundamental data processing is done through the
use of logic gates. Logic gates combine individual bits according to certain rules, which forms
the basis of Boolean algebra, which you had or will study in depth in SIF2021 Digital
Electronics elective course.
Logic Gates
In this section, we will introduce the most common logic gates, including the AND, OR, XOR,
NOT, NOR, and NAND. For each gate, it has its own circuit symbol, Boolean algebra logic,
and truth table. The truth table lists all possible combinations of inputs, and the resulting output
for each gate.
The three most common gates are the NOT gate (also known as inverter), the OR gate and the
AND gate, from which any digital logic circuit can be constructed. These gates are summarized
below in terms of their logic symbol, logic equation, and truth table, where it should be noted
that the NOT gate has only one input while the AND and OR gates can have two or more
inputs.
Page 1 of 8
Logic Gate NOT (inverter) AND OR
A Y A A
Symbol Y Y
B B
Logic Equation ̅ =Y
A AB=Y A+B=Y
Other common gates include the NAND, NOR, exclusive-OR (XOR), and exclusive-NOR
(XNOR) gates. While the NAND and NOR gates are functionally complete (meaning that any
digital logic circuit can be constructed from either one of these gates), the XOR and XNOR
gates are not functionally complete and, therefore, are not considered to an elementary logic
gate by most designers.
These gates are summarized below in terms of their logic symbol, logic equation, and truth
table where it should be noted that the NAND and NOR gates (like their AND and OR
counterparts) can have two or more inputs, while the XOR and XNOR gates generally have
only two inputs. The NAND and NOR gates are a combination of an AND gate and NOT gate
and a combination of an OR gate and NOT gate, respectively, as can be observed by comparing
their truth tables. Similarly, the exclusive-NOR (XNOR) gate has the inverse output of the
XOR gate truth table.
DeMorgan’s Theorem
DeMorgan proposed two theorems that are used frequently in Boolean algebra. The first
theorem states:
The complement of two variables ANDed is equivalent to the OR of the complements of
the individual variables.
In this experiment, you will design electronics circuits using NPN transistors to realize each of
the logic gates as discuss above.
Page 2 of 8
PROCEDURE
NOT GATE
1. Construct a NOT GATE circuit as shown in Figure 3.1 (a). Set the DC supply to have
5V. Use common ground.
2. Use switch (A) as a logic input where switch on (closed) means A=1 and switch off
(opened) means A = 0.
3. Observe the output from LED light, if the LED light is on then means 𝐴̅ = 1, otherwise
𝐴̅ = 0 if the LED light is off.
4. Fill the truth table below
AND GATE
1. Construct an AND GATE circuit as shown in Figure 3.1 (b). Set the DC supply to have
5V. Use common ground.
2. Use switch (A) and switch (B) as a logic input where switch on (closed) means A=1
and switch off (opened) means A = 0.
Page 3 of 8
Figure 3.1 (b) AND GATE circuit using NPN transistor
3. Run the circuit by pushing the switch A and B following Truth table 2.
OR GATE
1. Construct an OR GATE circuit as shown in Figure 3.1 (c). Set the DC supply to have
5V. Use common ground.
2. Use switch (A) and switch (B) as a logic input where switch on (closed) means A=1
and switch off (opened) means A = 0.
3. Run the circuit by pushing the switch A and B following Truth table 3.
Page 4 of 8
Table 3: Truth table OR GATE
NOR GATE
1. Construct a NOR GATE circuit as shown in Figure 3.1 (d). Set the DC supply to have
5V. Use common ground.
2. Use switch (A) and switch (B) as a logic input where switch on (closed) means A=1
and switch off (opened) means A = 0.
3. Run the circuit by pushing the switch A and B following Truth table 4.
NAND GATE
1. Construct a NAND GATE circuit as shown in Figure 3.1 (e). Set the DC supply to have
5V. Use common ground.
Page 5 of 8
2. Use switch (A) and switch (B) as a logic input where switch on (closed) means A=1
and switch off (opened) means A = 0.
3. Run the circuit by pushing the switch A and B following Truth table 5.
XOR GATE
1. Construct an XOR GATE circuit as shown in Figure 3.1 (f). Set the DC supply to have
5V. Use common ground.
2. Use switch (A) and switch (B) as a logic input where switch on (closed) means A=1
and switch off (opened) means A = 0.
Page 6 of 8
Figure 3.1 (f) XOR GATE circuit using NPN transistor
3. Run the circuit by pushing the switch A and B following Truth table 6.
XNOR GATE
1. Construct an XNOR GATE circuit as shown in Figure 3.1 (g). Set the DC supply to
have 5V. Use common ground.
2. Use switch (A) and switch (B) as a logic input where switch on (closed) means A=1
and switch off (opened) means A = 0.
Page 7 of 8
Figure 3.1 (f) XNOR GATE circuit using NPN transistor
Questions:
1. Compare all the output from truth tables (1-7) with theoretical truth tables and give
explanations about each logic gates?
2. Why NAND and NOR GATE are called universal gate?
3. Realize NOT, AND and OR gate only using NAND in logic equation and the Morgan’s
law and verify the truth tables!
4. Realize NOT, AND and OR gate only using NOR in logic equation and the Morgan’s
law and verify the truth tables!
5. Realize XOR GATE only using NAND GATE through logic equation and the
Morgan’s law and verify the truth table!
6. Realize XOR GATE only using NOR GATE through logic equation and the Morgan’s
law and verify the truth table!
7. Give your thoughts about the experiments and further applications of logic gates!
Page 8 of 8