Module 2

From Hamsterworks Wiki!

Revision as of 09:02, 15 December 2011 by User (Talk | contribs)
Jump to: navigation, search

Getting the first design to work is always the hardest.


Aim of project

To wire two switches up to the LEDs.

Learning outcomes

  • Create a new project
  • Create a new VHDL module
  • Enter basic code
  • Implement the design
  • Create an implementation constraints file
  • Try the programming tools
  • Test the design in hardware
  • Experience single wire inputs and outputs

Wow! That is a lot of learning for a second module


Step 1 - Create a new Project

- Click on "Xilinx ISE Design Suite 13.3" Studio Icon - From the "File" menu, choose "New Project" - Name the project "Switches+LEDs", and click on "Next".


- This screen is where you say what FPGA you are using. Choose the following settings to tell the design tools what chip you are using, then press the "Next" button.


- Click on the "Finish" button to create and open the new project

Step 2 - Create a new VHDL Module

- Right-click on the design window, on the FPGA device, and choose "New Source"


- Highlight "VHDL module" and in the file name enter "Switches_LEDs", then press the "Next button". - This next dialog box allows you to define what connections the module has. We need four connections - two the the switches and two for the LEDs:


- Click the "Next" button, then "Finish" to create the module and open it in the editor. To make things clearer, delete any line that starts with "--" - they are comments that do not influence the design.

 1: library IEEE;
 2: use IEEE.STD_LOGIC_1164.ALL;
 4: entity Switches_LEDs is
 5:    Port ( switch_0 : in  STD_LOGIC;
 6:           switch_1 : in  STD_LOGIC;
 7:           LED_0 : out  STD_LOGIC;
 8:           LED_1 : out  STD_LOGIC);
 9: end Switches_LEDs;
11: architecture Behavioral of Switches_LEDs is
12: begin
14: end Behavioral;

Personal tools