0% found this document useful (0 votes)
16 views

DLD Lab 02

KNN method

Uploaded by

f23mmg18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

DLD Lab 02

KNN method

Uploaded by

f23mmg18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Faculty of Artificial Intelligence & Multimedia Gamming

BS – Multimedia Gamming

Digital Logic Design Lab

Lab # 02: NAND, NOR, XOR, and XNOR Gate


Instructor: Dr. Santosh Kumar Banbhrani

1
Lab Learning Objectives:

Upon successful completion of this experiment, the student will be able:


• To explore the function of various different logic gates
• To create circuits with varying logic gates in theory and in practice

Lab Hardware and Software Required:

Platform: NI ELVIS III ✓ View User Manual:


http://www.ni.com/en-
us/support/model.ni-elvis-iii.html
✓ View Tutorials:
https://www.youtube.com/playlist?li
st=PLvcPIuVaUMIWm8ziaSxv0gwt
shBA2dh_M

Hardware: Digilent Digital Electronics Board for ✓ View NI DSDB Board Manual:
NI ELVIS III http://www.ni.com/pdf/manuals/376
627b.pdf

Software: NI Multisim 14.0.1 Education Version ✓ Install Multisim:


or newer http://www.ni.com/gate/gb/GB_AC
ADEMICEVALMULTISIM/US
✓ View Help:
http://www.ni.com/multisim/technic
al-resources/

Software: NI LabVIEW FPGA Vivado 2014.4 ✓ Install:


http://www.ni.com/download/labvie
w-fpga-module-2015-sp1/5920/en/

Note: Digilent Driver (The installer above


automatically downloads the installer below
onto your computer)

✓ Navigate to:
C:\NIFPGA\programs\Vivado2014_
4\data\xicom\cable_drivers\nt64\digi
lent
✓ Install: install_digilent.exe

2
Background Theory:

Figure 1-1 Video. View the video here: https://youtu.be/1wnztS6et0w

Video Summary

• NAND, NOR, XOR, and XNOR gates have at least two inputs, one output, and a unique
truth table
• NOT gate output is the inverse of the input

Inverters

• Inverters are also known as NOT gates.


• They have only one input and one output.
• The truth table for an inverter is simple. The output is always the opposite of the input.
• For example, if the input is 1, the output will be 0 and vice versa. Visually this is depicted
by a circle at the input and/or output ends of the logic gates.
• In this situation, the circle is at the output, which means that the output is inverted. If it was
at the input, then it is the input that would be inverted.
• Circuits with more than one input can use NAND or NOR logic gates which we will explore
next.

3
Figure 1-2 Inverter

NAND Logic Gates

• NAND gates invert the output of the AND gate.


• The inputs do not change from those of the AND truth table, but the output is the opposite.
• As a rule, if any of the inputs are 0, the output will always be 1.
• See below for the truth table and the symbol.

Figure 1-3 NAND gate truth table and symbol

NOR Logic Gates

• The NOR logic gate inverts the output of the OR gate.


• The inputs of the truth table for the OR gate do not change, but the output is the opposite.
• As a rule, if any of the inputs are 1, the output will always be 0.
• See below for the truth table and symbol.

4
Figure 1-4 NOR gate truth table and symbol

XOR Logic Gates

• An XOR gate is also known as an exclusive OR gate.


• The output will be 1 if only one of the inputs is 1. The output will be 0 if both inputs are 0
or both are 1.
• See below for the truth table and symbol.

Figure 1-5 XOR gate truth table and symbol

5
XNOR Logic Gates

• The XNOR gate does the opposite of the XOR gate.


• The output will be 1 if the inputs are the same and the output will be 0 if the inputs are not
the same.
• See below for the truth table.

Figure 1-6 XNOR gate truth table

Exercise 1: Implementation of following ICs’ on NI Elvis kit using Digital


Reader and Digital Writer

74LS00 2-input NAND gate IC:

74LS02 2-Input NOR Gate IC:

6
74LS86 2-Input XOR Gate IC:

74LS266 2-Input XNOR Gate IC:

Exercise 2: Building an XOR Logic Gate in Multisim

XOR Gate Circuit

Build the following circuit using an XOR gate:

Figure 1-18 XOR gate circuit

7
Configure the Digital Constants:

• Double-click the top Digital Constant.


• In the window that appears, select ‘A’ from the Key for toggle dropdown.
• Change the second constant to toggle with the ‘B’ key.
• Click the Run to begin simulating the circuit.

Figure 1-19 Run button

• Press the ‘A’ key on the keyboard to change the value of that input to 1.

1-9 Does the probe turn on?


A. Yes
B. No

• Press the ‘A’ key again to change the top input back to 0.
• Press the ‘B’ key to change the second input to 1.

1-10 Does the probe turn on?


A. Yes
B. No

• Press the ‘A’ key, so that both inputs are equal to 1.

1-11 Does the probe turn on?


A. Yes
B. No
1-12 How would you describe the behavior of this gate?
_____________________________________________________________________

_____________________________________________________________________

_____________________________________________________________________

_____________________________________________________________________

8
• When you’re done, stop the simulation by clicking the Stop button.

Figure 1-20 Stop button

Exercise 3: Building a NOR Logic Gate on the Digital Electronics Board

Using the switches, LEDs, and logic gates, create the following circuit:

Figure 1-21 PLD design

Configure the Digital Constants:

• Double-click the top Digital Constant.


• In the window that appears, select ‘A’ from the Key for toggle dropdown.
• Change the second constant to toggle with the ‘B’ key.
• Click the Run to begin simulating the circuit.

Figure 1-21 Run button

• Press the ‘A’ key on the keyboard to change the value of that input to 1.

1-9 Does the probe turn on?


C. Yes
D. No

• Press the ‘A’ key again to change the top input back to 0.

9
• Press the ‘B’ key to change the second input to 1.

1-10 Does the probe turn on?


C. Yes
D. No

• Press the ‘A’ key, so that both inputs are equal to 1.

1-11 Does the probe turn on?


C. Yes
D. No
1-12 How would you describe the behavior of this gate?
_____________________________________________________________________

_____________________________________________________________________

_____________________________________________________________________

_____________________________________________________________________

• When you’re done, stop the simulation by clicking the Stop button.

Figure 1-22 Stop button

10

You might also like