VHDL is one of the most famous design hardware description languages.
If you are interested to know how to switch on your first LED in VHDL, let's get started!
For this tutorial we are going to use the Altera DE1 FPGA board.
And we'll switch on LED 0 and 1, to understand how it works.
First of all, we have to tells which library and packages to use.
library ieee; use ieee.std_logic_1164.all;
Then we have to declare the entity (it's where you declare every component of your board to interact with).
In our example, we utilize two LEDs of the board, so we declare the LED number 0 and number 1.
The name of the port are important here, because it's to be exactly the same as on the assignement pins.
So if you have a look on them, you'll see that the red LEDs are called LEDR[0-7].
In VHDL, we use only paranthesis instead of square brackets for arrays.
entity main is port ( LEDR: out std_logic_vector(1 downto 0) ); end main;
And finally the architecture, where you create interactions between components declared in the entity.
It's necessary to assign value to each LED by the bit '1' (meaning switch on!).
If you wanted to switch off the LED, just assign it '0'.
architecture switch_me_on of main is begin LEDR(0) <= '1'; LEDR(1) <= '1'; end architecture switch_me_on;
library ieee; use ieee.std_logic_1164.all; entity main is port ( LEDR: out std_logic_vector(1 downto 0) ); end main; architecture switch_me_on of main is begin LEDR(0) <= '1'; LEDR(1) <= '1'; end architecture switch_me_on;
A good start.
At least for blinking LEDs for Christmas.
Well done, you've just made it.