Professional Documents
Culture Documents
12a Date:26/7/21
IMPLEMENTATION OF SWITCH CONTROLLED LEDS ON SPARTAN 6 FPGA
Aim : To activate and deactivate the LEDS’ interfaced to Spartan 6 FPGA whenever the
slide switch gets activated and deactivated.
Software Requirements:
i) Xilinx ISE 14.7
ii) ISim Simulator
Hardware Requirements:
i) Universal Development FPGA Board
ii) 9V 1A Power Adaptor
iii) JTAG Cable
Theory:
Digital Inputs Toggle Switch:
The Universal Development Board has 16-slide switches, indicated as in Figure 1. The
switches connect to an associated pin name, as shown in Table 1. A detailed schematic
appears in Figure 1.
Procedure:
i) Open Xilinx ISE 14.7 Project Navigator
ii) Create a New Project in the desired location with top level source type as HDL
iii)Device Properties window opens
Select Family - Spartan6
Device : XC6SLX9
Package : CSG324
Simulator : ISim (VHDL / Verilog)
Preferred Language : Verilog
iv)Create New Source File
v) Select Verilog module with a preferred file name.
vi)Click Next
vii) Click Finish
viii) Design the circuit with Verilog HDL
ix)Set the design as top-level module
x) Synthesize the design
xi)Create a User Constraint File by double clicking Post-Synthesis.
The circuit has been implemented but the Xilinx tools still need to know what
physical pins on the FPGA the input and output ports are mapped to. The UCF file
will give the tools for this information.
xii) Implement the design
xiii) Generate a bit file
xiv) Connect the 9V 1A Power Supply to the Spartan -6 Starter Kit
xv) Connect the JTAG cable from JTAG port on the FPGA to the PC parallel port
xvi) Switch ON the power switch on the FPGA. The Power LED will be illuminated
xviii) Double Click Boundary Scan on left pane and then Right Click right pane and select
Initialize chain.
xx) After bit file selection, right click XCLSX9 and click Program.
Program:
module switchled(
output [15:0] led,
input [15:0] switch
);
assign led = switch;
endmodule
DESIGN SUMMARY:
Top Level Output File Name : switchled.ngc
IO Utilization:
Number of IOs: 32
---------------------------
Partition Resource Summary:
---------------------------
---------------------------
=========================================================================
Timing Report
Clock Information:
------------------
No clock signals found in this design
Timing Summary:
---------------
Speed Grade: -3
Timing Details:
---------------
All values displayed in nanoseconds (ns)
=========================================================================
Timing constraint: Default path analysis
Total number of paths / destination ports: 16 / 16
-------------------------------------------------------------------------
=========================================================================
=========================================================================
-->
Result : Thus the leds were controlled by activating the switches and the results were verified
by programming it on Spartan6 FPGA.
Program:
module buzzer(
input clk,
output reg buzzer
);
always@(posedge clk)
begin
buzzer<=1'b1;
end
endmodule
OUTPUT:
DESIGN SUMMARY:
Top Level Output File Name : buzzer.ngc
IO Utilization:
Number of IOs: 2
Number of bonded IOBs: 1 out of 102 0%
---------------------------
Partition Resource Summary:
---------------------------
---------------------------
=========================================================================
Timing Report
Clock Information:
------------------
No clock signals found in this design
Timing Summary:
---------------
Speed Grade: -3
Timing Details:
---------------
All values displayed in nanoseconds (ns)
=========================================================================
=========================================================================
-->
Power Settings
Turn ON 7SEG DIP Switch located at SW35 to Provide 5V Supply to Seven Segment
Display.
FPGA Pin Connections to Digit Enable (Anode Control) Signals (Active High)
Program:
module sevensegmentdisplay(
input [3:0] bcd,
output reg [7:0] decoder,
output [5:0] a
);
assign a = 6'b111111;
always@(bcd)
begin
case(bcd)
4'b0000:decoder=7'b00000011;
4'b0001:decoder=7'b10011111;
4'b0010:decoder=7'b00100101;
4'b0011:decoder=7'b00001101;
4'b0100:decoder=7'b11011001;
4'b0101:decoder=7'b01001001;
4'b0110:decoder=7'b01000001;
4'b0111:decoder=7'b00011111;
4'b1000:decoder=7'b00000001;
4'b1001:decoder=7'b00001001;
endcase
end
endmodule
OUTPUT:
IO Utilization:
Number of IOs: 18
Number of bonded IOBs: 18 out of 102 17%
IOB Flip Flops/Latches: 6
---------------------------
Partition Resource Summary:
---------------------------
---------------------------
=========================================================================
Timing Report
Clock Information:
------------------
-----------------------------------+------------------------+-------+
Clock Signal | Clock buffer(FF name) | Load |
-----------------------------------+------------------------+-------+
_n0037<0>(_n0037<0>1:O) | NONE(*)(decoder_6) |6 |
-----------------------------------+------------------------+-------+
(*) This 1 clock signal(s) are generated by combinatorial logic,
and XST is not able to identify which are the primary clock signals.
Please use the CLOCK_SIGNAL constraint to specify the clock signal(s) generated by combinatorial logic.
INFO:Xst:2169 - HDL ADVISOR - Some clock signals were not automatically buffered by XST with BUFG/BUFR
resources. Please use the buffer_type constraint in order to insert these buffers to the clock signals to help prevent skew
problems.
Timing Details:
---------------
All values displayed in nanoseconds (ns)
=========================================================================
Timing constraint: Default OFFSET IN BEFORE for Clock '_n0037<0>'
Total number of paths / destination ports: 24 / 6
-------------------------------------------------------------------------
Offset: 2.483ns (Levels of Logic = 2)
Source: bcd<2> (PAD)
Destination: decoder_6 (LATCH)
Destination Clock: _n0037<0> falling
=========================================================================
Timing constraint: Default OFFSET OUT AFTER for Clock '_n0037<0>'
Total number of paths / destination ports: 6 / 6
-------------------------------------------------------------------------
Offset: 3.648ns (Levels of Logic = 1)
Source: decoder_6 (LATCH)
Destination: decoder<6> (PAD)
Source Clock: _n0037<0> falling
=========================================================================
Cross Clock Domains Report:
=========================================================================
Total REAL time to Xst completion: 7.00 secs
Total CPU time to Xst completion: 7.23 secs
-->
Total memory usage is 4498824 kilobytes
Number of errors : 0 ( 0 filtered)
Number of warnings : 14 ( 0 filtered)
Number of infos : 1 ( 0 filtered)
Result: Thus the characters were displayed on the seven segment led interfaced with
Spartan6 FPGA.