Lab 14 Verilog HDL 27092020 050232pm
Lab 14 Verilog HDL 27092020 050232pm
EQUIPMENT:
Personal Computer
Xilinx ISE Design Suite 14.2
Spartan-3A FPGA Kit
THEORY:
1. SPARTAN-3A FPGA KIT Key Features.
Fig. 1.13: NOR Gate Symbol & TTL IC
TABLE 14.1: SPARTAN-3A Package Specifications
Xilinx Clocks Memory Analog Connectors and Interfaces Display
Device Interface
Devices
2. Xilinx Software.
The Xilinx ISE 14.2 software will be used in this manual. All menus structures and screen shots
are taken from the ISE 14.2 version.
To start the ISE Design Suite 14.2software, double-click the ISE Design Suite 14.2 Icon on your
desktop, or Select Start > All Programs > Xilinx ISE Design Suite 14.2> ISE Design Tools >
Project Navigator, as shown in Fig. 14.2.
60
LAB# 14
Transcript
Toolbar Sources window Processes window Workspace
window
To create a new project using the New Project Wizard, do the following:
From Project Navigator, select File > New Project. The New Project Wizard appears. See figure
5. Enter the project path and name as shown below. Click Next.
61
LAB# 14
Select the following values in the New Project Wizard—Device Properties page:
Product Category: All
Family: Spartan3A and Spartan3AN
Device: XC3S700A
Package: FG484
Speed: -4
Synthesis Tool: XST (VHDL/Verilog)
Simulator: ISim (VHDL/Verilog)
Preferred Language: Verilog
62
LAB# 14
2.3 Adding Source Files Using the New Source Wizard and ISE Text Editor.
In this section, you create a file using the New Source wizard, specifying the name and ports of
the component. The resulting HDL file is then modified in the ISE Text Editor.
1. Select Project > New Source. The New Source Wizard opens in which you specify the
type of source you want to create.
2. In the Select Source Type page, select Verilog Module.
3. In the File Name field, enter logic_gates.
1. Click Next.
2. In the Define Module page, enter two input ports named a, b and c as an output port.
63
LAB# 14
64
LAB# 14
In the ISE Text Editor, the ports are already declared in the HDL file, and some of the basic file
structure is already in place. Keywords are displayed in blue, comments in green, and values are
black. The file is color-coded to enhance readability and help you recognize typographical errors.
AND Gate.
The AND function is similar to the multiplication in mathematics. This is the all or
nothing operator and it provides a logic 1 output only when all the inputs of the gate are
at logic 1, and logic 0 output for all other input combinations. The logic operator for the
AND function is a dot (∙) sign. The AND function is described in terms of the following
“truth table”. In terms of logic symbols, OUT = A●B.
OR Gate.
The OR function is similar to the mathematical function of addition and the output for the
OR gate may be analyzed using the laws of addition. The logic operator for the OR function is a
plus (+) sign. The output will be logic 0 only if all the inputs are logic 0, and the output will be
logic 1 anytime any input is at logic 1. Here, OUT = A+B.
65
LAB# 14
Exercises:
1. Write the Verilog Codes for the Basic Gates (2 – Inputs). i.e. AND, OR, NOT, NOR, NAND,
XOR and XNOR and verify through Test Bench / Timing Diagram.
2. Write the Verilog Code for the Full Adder Circuit as shown below. Attach the RTL
Schematic and Timing Diagram with this Lab.
66
LAB# 14
67