Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.71 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3. use IEEE.std_logic_signed.all;
  4. entity Projekt is
  5. port(clk_i: in std_logic := '0';
  6.      rst_i: in std_logic := '0';
  7.      led_o: out std_logic_vector(0 downto 0) := "0");
  8. constant N : integer := 25000000;
  9. end Projekt;
  10.  
  11. architecture Behavioral of Projekt is
  12. signal temp: integer:=0;
  13. signal output: std_logic:= '0';
  14. begin process(clk_i,rst_i,temp,output)
  15. begin
  16. if ( temp < N - 1) then
  17.     if rst_i='1' then
  18.         temp <= 0;
  19.         led_o(0) <= '0';
  20.     elsif(clk_i'event and clk_i='1') then
  21.         temp <= temp + 1;
  22.     else temp <= temp;
  23.     end if;
  24. else output <= not output;
  25.      temp <= 0;
  26.      led_o(0) <= output;
  27.      end if;    
  28. end process;
  29. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement