Professional Documents
Culture Documents
LAB 0
DESIGN AND SIMULATE GATES
Fundamentals of Digital and Computer Design with VHDL
Experiment 0A & 0B
Anees Abrol (aabrol@unm.com)
Eric Hamke (ehamke@unm.com)
Steven Seppala (sseppala@unm.edu)
Amir Raeisi Nafchi (amirorn@unm.edu)
Bhuwan Babu Bastola (bhuwanbabu@unm.edu)
LEARNING OBJECTIVES
Enter
AND_3
Enter
working directory
on your
computer or
Flashdrive
(Flashdrive is
better)
ALWAYS Check
These
- Spartan 6
- XC6SLX16
- CSG324
- VHDL
Debugging Tip:
The fields marked in
yellow are not
always populated
with data specific to
the boards in the
lab.
and_3
3. Select
VHDL module
4. Enter
AND_3
5. Check path
is correct.
Debugging tip:
The assignment
VHDL deals with data
flows so you need to
be aware that
F<=A
Is not the same as
A <=F
If something failed the check, a message indicating the line number and
a hint as to what failed.
Debugging Tip: Always fix the first item on the list first. Some of the
other messages may have been a result of the first lines error,
4. Enter
AND_3_TB
3. Select
VHDL Test
Bench
When done
entering data
Click on Next>
Debugging Tip: Do not name the test bench file exactly the same name
as the module. You will over write the module and have to reenter it.
When done
checking data
Click on Finish
3. Choose
Comment
from pop-up
menu
4. Choose
Lines from
pop-up
menu
RUN SIMULATION
1. Select the simulation mode
radio button in the upper left hand
panel
2. Select test bench file to be
used by the simulation.
se the
icon to expand the view so that you can see the wave forms.
Test sequence
A low (0);
B high (1);
C low (0);
Function output (F) is Low
4. Click OK to
continue
. Double click on the black box drawing to see the next layer (Look Up Table) dra
2. Double click on
the lut drawing to
see the design
summary windows
3. Select
Implementation
Constraints File
4. Enter
AND_3
When done
checking data
Click on Next>
ACCEPT SUMMARY
When done
checking data
Click on Finish
Working directory on
your computer or
Flashdrive
(Flashdrive is better)
EDIT UCF
1. Double-click AND_3.ucf
2. Assign as follows:
KNOWN ISSUE
Please use the file NEXSYS3 MASTER FILE as a template.
Note, the Nexys 3 board will pick either form.
Try one and if it doesnt work try the other.
Input A
SW2
#NET "sw<2>"
LOC = "V9" | IOSTANDARD = "LVCMOS33"; #Bank = 2, Pin name = IO_L32N_GCLK28,
Sch name = SW2
NET A"
LOC = "V9" | IOSTANDARD = "LVCMOS33"; #Bank = 2, Pin name = IO_L32N_GCLK28,
Sch name = SW2
Or
NET A"
LOC = "V9" ; # | IOSTANDARD = "LVCMOS33"; #Bank = 2, Pin name = IO_L32N_GCLK28,
Sch name = SW2
input B
SW1,
#NET "sw<1>"
LOC = "T9" | IOSTANDARD = "LVCMOS33"; #Bank = 2, Pin name = IO_L32P_GCLK29,
Sch name = SW1
NET B"
LOC = "T9" | IOSTANDARD = "LVCMOS33"; #Bank = 2, Pin name = IO_L32P_GCLK29,
Sch name = SW1
Or
NET B" LOC = "T9" ; #| IOSTANDARD = "LVCMOS33"; #Bank = 2, Pin name = IO_L32P_GCLK29,
Sch name = SW1
input C
SW0,
#NET sw<0>"
LOC = "T10" | IOSTANDARD = "LVCMOS33"; #Bank = 2, Pin name = IO_L29N_GCLK2,
Sch name = SW0
NET C"
LOC = "T10" | IOSTANDARD = "LVCMOS33"; #Bank = 2, Pin name = IO_L29N_GCLK2,
Sch name = SW0
Or
NET C"
LOC = "T10" ; # | IOSTANDARD = "LVCMOS33"; #Bank = 2, Pin name = IO_L29N_GCLK2,
1.
2.
3.
4.
5.
6.
7.
Write the VHDL that performs the NOT, AND, OR operations on two
input values.
Input signals: A and B
Output signal: F_NOT, F_AND, F_OR.
A to SW1, B to SW0
F_NOT to LD0, F_AND to LD1, F_OR to LD2.
Inpu
ts
Output
F_NOT
Input Outpu
s
t
A B
F_AN
D
Input Outpu
s
t
A B F_OR
1 0 0
2 0 1
3 1 0
3 1 0
4 1 1
4 1 1
1 0 0
2 0 1
LAB 0 PROJECT B
NAND, NOR, XOR, XNOR, BUFFER
Create a new project. Name it Lab0A.
1.
2.
3.
4.
5.
6.
7.
Write the VHDL that performs the NAND, NOR, XOR, XNOR and Buffer
operations on input values.
Input signals: A and B
Output signal: F_NAND, F_NOR, F_XOR, F_XNOR, F_BUFF.
A to SW1, B to SW0
F_NAND to LD0 ,F_NOR to LD1, F_XOR to LD2, F_XNOR to LD3, F_BUFF
to LD4
Outpu
t
Inpu
ts
Outpu
t
F_NO
R
F_XN
OR
Inpu
ts
Outpu
t
Inpu
ts
Outpu
t
Inpu
ts
Output
F_NAN
D
F_XOR
F_BUFF
2.
3.
4.
5.
6.
7.
Write VHDL for a not, and, and or gates using only nand gates.
Input signals: X, Y for the three gates.
Output signals: F_NOT, F_AND and F_OR
(Review chapter 1 pages 26 to 32. (Especially Figures 1.15 and 1.16)
X to SW7
Y to SW6
F_NOT to LD7
F_AND to LD4
F_OR to LD0
Generate and download program file (.bit) to FPGA
Verify that the hardware works as expected based on your truth tables from #32.
NOT Gate
F_NOT
F_AND
F_NOT
A
B
F_OR
B
F_OR
LAB REPORT
Cover page:
Course Title
Lab Number, Letter
Team Names
VHDL Module
Black Box
Truth Table
Simulation Waveform
UCF
Project 0B:
VHDL Module
Black Box
Truth Table
Simulation
UCF
Project 0C:
Project 0A:
VHDL Module
Black Box
Truth Table
Simulation
UCF
Summary paragraph
Work completed
Any problems
Helpful Hints
Suggested
Improvements