entity MercurioIV_Golden_Top is port ( CLOCK_50MHz : in bit; KEY : in bit_vector(11 downto 0); LEDM_C : out bit_vector(4 downto 0); LEDM_R : out bit_vector(7 downto 0); LED_R : out bit ); end MercurioIV_Golden_Top; architecture rtl of MercurioIV_Golden_Top is signal q_debounce : bit_vector(14 downto 0); signal clk_1_5kHz : bit; signal chave_limpa : bit; begin LEDM_C <= "11110"; -- Component Instantiation Statement ledm_r0: work.MercurioIV_counter(operadores) generic map ( WIDTH => 8 ) port map ( clk => chave_limpa, clr => KEY(8), q => LEDM_R(7 downto 0) ); -- Gerador de Clock para debouncer clk_1k5Hz: work.MercurioIV_counter(operadores) generic map ( WIDTH => 15 ) port map ( clk => CLOCK_50MHz, clr => '0', q => q_debounce ); clk_1_5kHz <= q_debounce(14); process(clk_1_5kHz) --bit q_debounce(14) eh 50MHz/2^15 variable shift : bit_vector(1 downto 0); begin if (clk_1_5kHz'event and clk_1_5kHz = '1') then shift := shift(0)& KEY(2); end if; chave_limpa <= shift(1) and shift(0); end process; end rtl;