Advertisement
Guest User

Untitled

a guest
May 17th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.47 KB | None | 0 0
  1. entity vjezba is
  2. port(
  3. clk_in, switch: STD_LOGIC;
  4. led: out STD_LOGIC_VECTOR(2 downto 0)
  5. );
  6. end vjezba;
  7.  
  8. architecture Behavioral of vjezba is
  9. signal clk_out: std_logic;
  10.  
  11. begin
  12. label1:entity work.generic_divider generic map(12_500_000) port map(clk_in, clk_out);
  13. process(clk_out, switch)
  14. variable temp:std_logic_vector(2 downto 0) :="000";
  15. begin
  16. if(clk_out'EVENT AND clk_out = '1' and switch = '1') then
  17. temp :=temp+1;
  18. end if;
  19. led<=temp;
  20. end process;
  21. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement