Professional Documents
Culture Documents
LAB Report#01
Class EEE-7
Date 9/30/2021
LAB # 01 Introduction to Verilog, ModelSim, Xilinx ISE
Design Suite and FPGA
In-Lab Task:
Verilog Code:
module Lab1_T1(
input A,
input B,
output S,
output C );
xor G1(S,A,B);
and G2(C,A,B);
endmodule
Test Bench:
module DUT_LAB1;
// Inputs
reg A;
reg B;
// Outputs
wire S;
wire C;
integer a;
integer b;
initial begin
// Initialize Inputs
$finish;
end
endmodule
UCF File:
NET "A" LOC=H18;
NET "B" LOC=G18;
NET "S" LOC=J15;
NET "C" LOC=J14;
Simulation:
// Inputs
reg [9:0] A;
// Outputs
wire [3:0] Unit;
wire [3:0] Ten;
wire [3:0] Hund;
integer i=0;
end
endmodule
Simulation:
Conclusion:
In this lab I revised how to use Xilinx ISE Design suite software to write Verilog code,
simulate it and burn code on the Nexys 2 board. There are three types of coding levels in
Verilog which are as follows:
1. Gate Level:
We make individual gates and connect the according to our circuit.
2. Data Flow:
We write the final equation of our circuit and the CAD tool makes the circuit according
to the equation.
3. Behavioral Level:
We use this when we don’t know the circuit diagram or final equation of our circuit but
know the output for each input. We tell the CAD tool the behavior of our circuit and ot
develops the circuit itself.
Verilog is a non-sequential programming language meaning that all the lines in our code are
executed at the same time. Therefore we avoid using Loops in our code as there is no hardware
representation of Loop.