MUCLecture 2022 8175442

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Digital Techniques

Lecturer: Ali Jawad Kadhim Alrubaie


E-mail: [email protected]

TA: Eng. Esraa Hussein

Experiment No.1
Logic Gates
1. Introduction
1.1 Objective:
Study the operation of all logic gates.

1.2 Components:
 TESCA board 38609.
 Set of connecting wires.

1.3 Theory:
There is a computer logic training board has been designed specifically to study simple Logic
Functions and Theorems of Boolean Algebra and to compare the truth table with experimental
results it’s made by TESCA. This training board offers a method of training students in the basic
theory of digital circuits and make them familiar with basic experiments in digital circuits. The
board is absolutely self-contained and requires no other apparatus.

Figure 1: TESCA Board

Al-Mustaqbal University College 1/13 http://www.mustaqbal-college.edu.iq/


A logic gate is an electronic circuit/device which makes the logical decisions. To arrive at this
decisions, the most common logic gates used are OR, AND, NOT, NAND, and NOR gates. The
NAND and NOR gates are called universal gates. The exclusive-OR gate is another logic gate which
can be constructed using AND, OR and NOT gate.
Logic gates have one or more inputs and only one output. The output is active only for certain input
combinations. Logic gates are the building blocks of any digital circuit. Logic gates are also called
switches. With the advent of integrated circuits, switches have been replaced by TTL (Transistor-
Transistor Logic) circuits and CMOS circuits.

AND Gate
The AND gate performs logical multiplication, commonly known as AND function. It has two or
more inputs and single output. The output of AND gate is HIGH only when all its inputs are HIGH
(i.e. even if one input is LOW, Output will be LOW).
If X and Y are two inputs, then output F can be represented mathematically as F = X.Y, here dot (.)
denotes the AND operation sometime X=A & B. The symbol and Truth table of the AND gate are
shown in the Figure (2) and Table (1) respectively.

Figure 2: AND Gate Symbol

Inputs Output
X Y F=X.Y
0 0 0
0 1 0
1 0 0
1 1 1
Table 1: Truth Table of AND Gate

Example waveforms:

A
B
X

Al-Mustaqbal University College 2/13 http://www.mustaqbal-college.edu.iq/


OR Gate
The OR gate performs logical addition, commonly known as OR function. It has two or more inputs
and single output. The output of OR gate is high only when any one of its inputs are high (i.e. even if
one input is high, Output will be high).
If X and Y are two inputs, then output F can be represented mathematically as F = X+Y. Here plus
sign (+) denotes the OR operation. The symbol and Truth table of the OR gate are shown in the
Figure (3) and Table (2) respectively.

Figure 3: OR Gate Symbol

Inputs Output
X Y F=X+Y
0 0 0
0 1 1
1 0 1
1 1 1
Table 2: Truth Table of OR Gate

Example waveforms:

The Inventor (NOT Gate)


The NOT gate performs the basic logical function called inversion or complementation. NOT gate is
also called inverter. The purpose of this gate is to convert one logic level into the opposite logic
level. It has one input and one output. When a high level is applied to an inverter, a low level appears
on its output and vice versa.
If X is the input, then output F can be represented mathematically as F = X', Here apostrophe (')
denotes the NOT (inversion) operation. There are a couple of other ways to represent inversion,
Al-Mustaqbal University College 3/13 http://www.mustaqbal-college.edu.iq/
F=! X, here! Represents inversion. The symbol and Truth table of the NOT gate are shown in the
Figure (4) and Table (3) respectively.

Figure 4: NOT Gate Symbol

Input Output
X F=X’
0 1
1 0
Table 3: Truth Table of NOT Gate

NAND Gate
NAND gate is a cascade of AND gate and NOT gate, as shown in the Figure (5). It has two or more
inputs and only one output. The output of NAND gate is high when any one of its input is low (i.e.
even if one input is low, Output will be high).

Figure 5: NAND Gate from AND Gate and NOT Gate

Al-Mustaqbal University College 4/13 http://www.mustaqbal-college.edu.iq/


If X and Y are two inputs, then output F can be represented mathematically as F = (X.Y)', here dot (.)
denotes the AND operation and (') denotes inversion. The symbol and Truth table of the NAND gate
are shown in the Figure (6) and Table (4) respectively.

Figure 6: NAND Gate Symbol

Inputs Output
X Y F=(X.Y)’
0 0 1
0 1 1
1 0 1
1 1 0
Table 4: Truth Table of NAND Gate

Example waveforms:

NOR Gate
NOR gate is a cascade of OR gate and NOT gate. It has two or more inputs and only one output. The
output of NOR gate is high when any all its inputs are low (i.e. even if one input is high, output will
be low).
If X and Y are two inputs, then output F can be represented mathematically as F = (X+Y)'; here plus
(+) denotes the OR operation and (') denotes inversion. The symbol and Truth table of the NOR gate
are shown in the Figure (7) and Table (5) respectively.

Al-Mustaqbal University College 5/13 http://www.mustaqbal-college.edu.iq/


Figure 7: NOR Gate Symbol

Inputs Output
X Y F=(X+Y)’
0 0 1
0 1 0
1 0 0
1 1 0
Table 5: Truth Table of NOR Gate

Example waveforms:

EX-OR Gate
An Exclusive-OR (EX-OR) gate is gate with two or three or more inputs and one output. The output
of a two-input EX-OR gate assumes a high state if one and only one input assumes a HIGH state.
This is equivalent to saying that the output is high if either input X or input Y is high exclusively and
low when both are 1 or 0 simultaneously.
If X and Y are two inputs, then output F can be represented mathematically as F = X ⊕Y, here ⊕
denotes the EX-OR operation. X ⊕Y is equivalent to X.Y' + X'.Y. The symbol and Truth table of the
EX-OR gate are shown in the Figure (8&9) and Table (6) respectively.

Al-Mustaqbal University College 6/13 http://www.mustaqbal-college.edu.iq/


Figure 8: EX‐OR from Simple Gate

Figure 9: EX‐OR Gate Symbol

Inputs Output
X Y F = (X ⊕Y)
0 0 0
0 1 1
1 0 1
1 1 0
Table 6: Truth Table of EX‐OR Gate

Example waveforms:

Al-Mustaqbal University College 7/13 http://www.mustaqbal-college.edu.iq/


EX-NOR Gate
An Exclusive-NOR (EX-NOR) gate is gate with two or three or more inputs and one output. The
output of a two-input EX-NOR gate assumes a high state if all the inputs assume same state. This is
equivalent to saying that the output is high if both inputs X and input Y is high exclusively or same
as input X and input Y is low exclusively and low when both are not same.
If X and Y are two inputs, then output F can be represented mathematically as F = (X ⊕Y)’, Here ⊕
denotes the EX-OR operation and (‘) denotes the inversion. (X ⊕Y)’ is equivalent to X.Y + X'.Y'.
The symbol and Truth table of the EX-NOR gate are shown in the Figure (10) and Table (7)
respectively.

Figure 10: EX‐NOR Gate Symbol

Inputs Output
X Y F=(X ⊕Y)’
0 0 1
0 1 0
1 0 0
1 1 1
Table 7: Truth Table of EX‐NOR Gate

Example waveforms:

Al-Mustaqbal University College 8/13 http://www.mustaqbal-college.edu.iq/


Universal gates are the ones which can be used for implementing any gate like AND, OR and NOT,
or any combination of these basic gates; NAND and NOR gates are universal gates. But there are
some rules that need to be followed when implementing NAND or NOR based gates.
To facilitate the conversion to NAND and NOR logic, we have two new graphic symbols for these
gates.

Figure 11:Another NAND Gate Symbol

Figure 12: Another NOR Gate Symbol

Now, keep in your mind the shape of the following logic gates because you will use them in the next
steps.

Figure 13: Logic diagrams and IC Pin diagrams

Al-Mustaqbal University College 9/13 http://www.mustaqbal-college.edu.iq/


2. Experiments:
2.1 Exercise 1 AND Gate:
1. Provide a power supply for TESCA board by connecting the board cable to a socket switch of
220V AC.
2. Connect the input switches which are pins A, B, C on the bottom of the board to A, B, C input
pins of AND gate respectively on the top middle of the TESCA board.
3. Connect the output pin of AND gate of the TESCA board to the output pin L1 LED Display on
the middle of the board.
4. Make sure all your connections are right then turn on the power supply from the socket switch.
5. Turn A, B, C switches to position 1 then observe output of AND Gate on the LED display L1.
6. Observe the output for different input combination as shown in truth table of OR gate.
7. Compare the practical results with the truth table of AND gate.

2.2 Exercise 2 OR Gate:


1. Provide a power supply for TESCA board by connecting the board cable to a socket switch of
220V AC.
2. Connect the input switches which are pins A, B, C on the bottom of the board to A, B, C input
pins of OR gate respectively on the top left of the TESCA board.
3. Connect the output pin of OR gate of the TESCA board to the output pin L1 LED Display on the
middle of the board.
4. Make sure all your connections are right then turn on the power supply from the socket switch.
5. Turn A, B, C switches to position 1 then observe output of OR Gate on the LED display L1.
6. Observe the output for different input combination as shown in truth table of OR gate.
7. Compare the practical results with the truth table of OR gate.

2.3 Exercise 3 NOT Gate:


1. First you should provide a power supply for TESCA board by connecting the board cable to a
socket switch of 220V AC.
2. Then, connect the input switch which is pin A on the bottom of the board to A/B/C pin of NOT
gate on the top right of the TESCA board.
3. Connect the output pin of NOT gate of the TESCA board to the output pin L1 LED Display on
the middle of the board.
4. Make sure all your connections are right then turn on the power supply from the socket switch.
5. Turn A switch to position 0 then observe output of NOT gate.
6. Turn A switch to position 1 then observe output of NOT gate.
7. Compare the practical results with the truth table of NOT gate.

Al-Mustaqbal University College 10/13 http://www.mustaqbal-college.edu.iq/


2.4 Exercise 4 NAND Gate:
1. Provide a power supply for TESCA board by connecting the board cable to a socket switch of
220V AC.
2. Connect the input switches which are pins A, B, C on the bottom of the board to A, B, C input
pins of NAND gate respectively on the top middle of the TESCA board.
3. Connect the output pin of NAND gate of the TESCA board to the output pin L1 LED Display on
the middle of the board.
4. Make sure all your connections are right then turn on the power supply from the socket switch.
5. Turn A, B, C switches to position 1 then observe output of NAND Gate on the LED display L1.
6. Observe the output for different input combination as shown in truth table of NAND gate.
7. Compare the practical results with the truth table of NAND gate.

2.5 Exercise 5 NOR Gate:


1. Provide a power supply for TESCA board by connecting the board cable to a socket switch of
220V AC.
2. Connect the input switches which are pins A, B, C on the bottom of the board to A, B, C input
pins of NOR gate respectively on the top left of the TESCA board.
3. Connect the output pin of NOR gate of the TESCA board to the output pin L1 LED Display on
the middle of the board.
4. Make sure all your connections are right then turn on the power supply from the socket switch.
5. Turn A, B, C switches to position 1 then observe output of NOR Gate on the LED display L1.
6. Observe the output for different input combination as shown in truth table of NOR gate.
7. Compare the practical results with the truth table of NOR gate.

2.6 Exercise 6 EX-OR Gate:


1. Place the DB02 board on the trainer shown in Figure (14) .
2. Provide power to the board by connecting +5 V pin from the trainer on the left side to +5V pin
on the DB03 using a wire.
3. Connect GND pin from the trainer on the left side to ground symbol pin on the DB03.
4. Connect the input switches which are pins no. D1 and D2 of the trainer to X and Y pins of EX-
OR gate on the top of the DB03 board.
5. Connect the pin no. Z of EX-OR gate of the DB03 board to the output pin no. 0 of the 8-bit LED
Display on the right side of the trainer.
6. Make sure all your connections are right then turn on the power supply.
7. Turn D1 and D2 switches to position 0 then observe output of EX-OR Gate on 8-bit LED
display.
8. Observe the output for different input combination as shown in truth table of EX-OR gate.
Al-Mustaqbal University College 11/13 http://www.mustaqbal-college.edu.iq/
9. Verify Truth Table for EX-OR gate

.
Figure 14: EX‐OR Gate

2.7 Exercise 7 EX-NOR Gate:

1. Place the DB02 board on the trainer .


2. Provide power to the board by connecting +5 V pin from the trainer on the left side to +5V pin on the
DB03 using a wire.
3. Connect GND pin from the trainer on the left side to ground symbol pin on the DB03.
4. Connect the input switches which are pins no. D1 and D2 of the trainer to X and Y pins of EX-NOR
gate on the top of the DB03 board.
5. Connect the pin no. Z of EX-NOR gate of the DB03 board to the output pin no. 0 of the 8-bit LED
Display on the right side of the trainer.
6. Make sure all your connections are right then turn on the power supply.
7. Turn D1 and D2 switches to position 0 then observe output of EX-NOR Gate on 8-bit LED display.
8. Observe the output for different input combination as shown in truth table of EX-NOR gate.
9. Verify Truth Table for EX-NOR gate

Al-Mustaqbal University College 12/13 http://www.mustaqbal-college.edu.iq/


3. Discussion:
1. Explain how you can get a logical high output when using OR gate?
2. Explain how you can get a logical low output when using AND gate?
3. How you can distinguish NOT gate from other logic gates introduced in this experiment?
4. Compare the truth table of NOR & AND gates? Explain the similarities & differences?
5. Write the truth table and draw the logical symbol for NAND gate? and Explain how you can get
a logical high output when using NAND gate?
6. What is the output F for the circuit shown in Figure (15) ?, consider all the input X possibilities.

Figure 15: Belong to Question 6.

7. For the logic circuit shown in Figure (16), write the required input condition (A,B,C) to make the
output X =1.

Figure 16: Belong to Question 7.

8. When the output of an X-NOR gate with two inputs, A and B, is HIGH ?
9. What is the gate if a signal passing through it is inhibited by sending a LOW into one of the
inputs, and the output is HIGH ?
10. Create a truth table for the following logic gate circuit shown in Figure (17) ?

Figure 17: Belong to Question 10.

Al-Mustaqbal University College 13/13 http://www.mustaqbal-college.edu.iq/

You might also like