Accessible to the PL:
Limited to the PS:
Lets blink, the available ones, around 1Hz +- 1.
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.NUMERIC_STD.all; -- Operations: addition/..
-- ------------------------------------------ --
-- = Entity = --
-- ------------------------------------------ --
-- Description: Functions:
-- Blink RGB and buzzer
-- Downscaler:
-- Count up to CLK's frequency. Keep the MSbits.
-- -
entity Blink is
Generic(
N: natural := 27); -- Primitive downscaling
Port(
CLK : in STD_LOGIC;
RESET : in STD_LOGIC;
--
BUZZER : out STD_LOGIC;
RGB : out STD_LOGIC_VECTOR(2 downto 0));
end Blink;
-- ------------------------------------------------ --
-- = Architecture = --
-- ------------------------------------------------ --
architecture Behavioral of Blink is
signal state : std_logic_vector(N - 1 downto 0) := (others => '0'); -- downscale to 1b0Hz
begin
-- Downscale: Count up to 2**N, close to CLK's frequency.
-- -
process (CLK, RESET)
variable v: natural range 2**N - 1 downto 0 := 0;
begin
state <= std_logic_vector(to_unsigned(v, N));
if rising_edge(CLK) then
-- if RESET = '1' then -- Reset
-- v := 0;
-- else
v := v + 1;
-- end if;
end if;
end process;
-- Blink around 1Hz +- 1, by following the MSB - 1 bit.
-- -
RGB <= state(N - 1 downto N - 3);
BUZZER <= state(N - 2);
end Behavioral;


SD enabled (used for transfer of VHDL to the PL).













constraints.xdc file.



