contador con el modulo antirrebote

Hola chicOs me gustaría que me ayudaran a entender o a implementar un contador con el modulo antirrebote en xilin

Este es el codigo qUE tengo de el modulo antirrebote

Código:
LIBRARY ieee;

use ieee.std_logic_1164.all;

use ieee.numeric_std.all; 

entity Mod_antirrebote is
  port (
     clk    : in  std_logic;
     rst    : in  std_logic;
     button : in  std_logic;
     salida : out std_logic
   );
end entity Mod_antirrebote;

architecture behavioral of Mod_antirrebote is

signal shift_reg : std_logic_vector(2 downto 0);

begin    -- architecture behavioral

SHIFT_REG_PROC : process(clk, rst) is
  begin
    if (rst='1') then
     shift_reg <= "000";
   elsif (clk='1')   then
     shift_reg <= button & shift_reg(2 downto 1);
   end if;
  end process SHIFT_REG_PROC;

salida <= shift_reg(2) and shift_reg(1) and shift_reg(0);

end architecture behavioral;
 
Última edición por un moderador:
Atrás
Arriba