Advertisement
Guest User

2. ZAD

a guest
Jan 10th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.41 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:    18:37:34 12/07/2011
  6. -- Design Name:
  7. -- Module Name:    led01 - RTL
  8. -- Project Name:
  9. -- Target Devices:
  10. -- Tool versions:
  11. -- Description:
  12. --
  13. -- Dependencies:
  14. --
  15. -- Revision:
  16. -- Revision 0.01 - File Created
  17. -- Additional Comments:
  18. --
  19. ----------------------------------------------------------------------------------
  20. library IEEE;
  21. use IEEE.STD_LOGIC_1164.ALL;
  22. use IEEE.STD_LOGIC_ARITH.ALL;
  23. use IEEE.STD_LOGIC_SIGNED.ALL;
  24.  
  25. ---- Uncomment the following library declaration if instantiating
  26. ---- any Xilinx primitives in this code.
  27. --library UNISIM;
  28. --use UNISIM.VComponents.all;
  29.  
  30. entity led01 is
  31.     port (  --2. ZADATAK
  32.             clk : in std_logic; -- signal takta
  33.             reset : in std_logic; -- signal reseta
  34.             ld7 : out std_logic; -- signal za upravljanje LED LD7
  35.             );
  36. end led01;
  37.  
  38. architecture RTL of led01 is
  39.    
  40.     --2. ZADATAK
  41.     signal brojilo: std_logic_vector(25 downto 0);
  42.    
  43.    
  44.    
  45. begin
  46.    
  47.    
  48.    
  49.     --2. ZADATAK
  50.     process (clk) is
  51.     begin
  52.         if rising_edge(clk) then
  53.             if reset='1' then
  54.                 brojilo<=(others => '0');
  55.             else
  56.                 brojilo<=brojilo+1;
  57.             end if;
  58.         end if;
  59.     end process;
  60.    
  61.     ld7<=brojilo(25);
  62.    
  63.    
  64. end RTL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement