Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.ALL;
  3. use IEEE.STD_LOGIC_UNSIGNED.ALL;
  4.  
  5. ENTITY led_rand IS
  6. -- generic (N : integer := 1);
  7. Port(
  8. input, reset, clk : in std_logic;
  9. led : in std_logic_vector(17 downto 0);
  10. led_out : out std_logic_vector(17 downto 0)
  11. );
  12.  
  13. end led_rand;
  14.  
  15. ARCHITECTURE led_mix OF led_rand IS
  16.  
  17. begin
  18. RANDOM : process(input)
  19. signal led_tmp : std_logic_vector(17 downto 0) := "000000000000000000";
  20. begin
  21. if(reset = '1') then
  22. led_out <= "000000000000000000";
  23. elsif(input = '1') then
  24. for i in 0 to 5 loop
  25. led_tmp <= led_tmp + led;
  26. end loop;
  27. led_out <= led_tmp;
  28. led_tmp <= "000000000000000000";
  29. end if;
  30. end process RANDOM;
  31.  
  32. end led_mix;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement