ECE 274 Report Template: Lab 1 Report Example: Lance Saldanha
ECE 274 Report Template: Lab 1 Report Example: Lance Saldanha
Lance Saldanha
Department of Electrical and Computer Engineering
University of Arizona
[email protected]
inverter will output 0, and vice versa. The truth table for an
Abstract inverter is provided in Figure 6.
Lab 1 provides an introduction to the Verilog hardware
description language (HDL), simulation and synthesis of digital Figure 5: Inverter (NOT gate).
circuits using Xilinx Integrated Software Environment (ISE), and
implementation of a digital circuit using a field-programmable
gate array (FPGA). The lab familiarizes students with the design,
simulation, and synthesis of basic logic gates, including a 2-input
AND gate, a 2-input OR gate, and an inverter (NOT gate), onto
Figure 6: Truth table for inverter (NOT gate).
the Xilinx Spartan-3E Starter Board.
INPUT OUTPUT
1. INTRODUCTION
A basic two-input AND gate, as shown in Figure 1, has two A F
inputs, A and B, and a single output, F. An AND gate will output 0 1
1 only if both A and B are 1. The truth table for a two-input AND 1 0
gate is provided in Figure 2.
// case 1
A_t<=0; B_t<=1;
#1 $display("F_t = %b", F_t);
// case 2
A_t<=1; B_t<=0;
#1 $display("F_t = %b", F_t);
// case 3
A_t<=1; B_t<=1; Figure 11 presents the simulation waveform for the two-input OR
#1 $display("F_t = %b", F_t); gate design and illustrates the correct operation of an OR gate.
end The OR gate design correctly outputs 1 whenever at least one of
endmodule
the inputs, A or B is a 1.
Implementing the design onto the Xilinx Spartan-3E FPGA
Starter Board requires the design to be synthesized for the target Figure 11: Simulation waveform verifying correct behavior
FPGA. This process includes selecting the appropriate Spartan-3E of two-input OR design.
FPGA devices within the project’s properties. The basic
procedure involved in implementing a design on an FPGA
includes specifying user constraints, synthesizing the design,
implementing the design, and downloading the resulting bitstream
to the FPGA. A User Constraints File (UCF) is needed to assign
the and2gate’s inputs and outputs to the appropriate pins of the
FPGA. The simplify this process, the Xilinx Spartan-3E FPGA
Starter Board includes the FPGA pins numbers printed on the
board next to the various components, such as LEDs, buttons, Figure 12 illustrates the simulation waveform for the inverter
connectors, switches, etc. For the 2-input AND gate, the inputs design and correctly demonstrates that an input of 1 will result in
were connected to switches on the board, and the single output an output of 0, and vice versa.
was connected to an LED. The resulting UCF file is presented in
Figure 9. Figure 12: Simulation waveform verifying correct behavior of
inverter design.
Figure 9: UCF file.
NET "A" LOC = "N17";
NET "B" LOC = "H18";
NET "F" LOC = "F12";