You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
537 B

3 years ago
  1. library ieee ;
  2. use ieee.std_logic_1164.all ;
  3. use ieee.numeric_std.all ;
  4. entity counter is
  5. port (
  6. CLK_IN: in std_logic;
  7. RLED: out std_logic_vector(3 downto 0)
  8. );
  9. end counter ;
  10. architecture behav of counter is
  11. signal pres_count, next_count: std_logic_vector(24 downto 0);
  12. begin
  13. RLED <= pres_count(20 downto 17);
  14. sync_count: process(CLK_IN)
  15. begin
  16. if(rising_edge(CLK_IN)) then
  17. pres_count <= pres_count + 1;
  18. end if;
  19. end process sync_count;
  20. end architecture;