LED Blink program has a very simple program that can use a sequential circuit.
This program is used for better understanding of how to implement a piece of code in VHDL.
For implementation of an LED blink code in VHDL, we need 2 pins of FPGA
one for input clock (for calculating timing) and the other one for connecting to LED.
In the following Program, you can see an LED blink code in VHDL.
library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity gen_1hz is Port ( clk : in STD_LOGIC; one_hz : out STD_LOGIC); end gen_1hz; architecture Behavioral of gen_1hz is signal cnt:integer range 0 to 25000000; signal sig_one_hz:std_logic:='0'; begin process(clk) begin if(rising_edge(clk))then cnt<=cnt+1; if(cnt=24999999)then cnt<=0; sig_one_hz<=not sig_one_hz; end if; end if; end process; one_hz<=sig_one_hz; end Behavioral;
In the above code, we use 2 signals one signal for counting 25 million (suppose that input clock is 25MHz) and another signal for changing LED status every one second.
At the end of this program, signal “sig_one_hz” store in the output pin.