-
-
Save Aeva/28e0981e7845cc0e4e2ba3e698a9942f to your computer and use it in GitHub Desktop.
simple blink light for the arty 35 thing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library ieee; | |
use ieee.std_logic_1164.all; | |
use ieee.numeric_std.all; | |
entity blinkfrien is | |
port ( | |
i_clock : in std_logic; | |
o_led : out std_logic | |
); | |
end blinkfrien; | |
architecture rtl of blinkfrien is | |
constant CLOCK_HZ : integer := 1e8; | |
constant TARGET : integer := (CLOCK_HZ / 2)-1; -- twice a second | |
signal counter : integer range 0 to TARGET := 0; | |
signal blink_status : std_logic := '0'; | |
begin | |
process(i_clock) is | |
begin | |
if rising_edge(i_clock) then | |
if counter = TARGET then | |
blink_status <= not blink_status; | |
counter <= 0; | |
else | |
counter <= counter+1; | |
end if; | |
end if; | |
end process; | |
o_led <= blink_status; | |
end rtl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment