Advertisement
Guest User

aa

a guest
Nov 9th, 2018
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.89 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3.  
  4. entity registr is
  5.     Port ( bot1 : in  STD_LOGIC;
  6.            bot2 : in  STD_LOGIC;
  7.            bot3 : in  STD_LOGIC;
  8.            bot4 : in  STD_LOGIC;
  9.            led1 : out  STD_LOGIC;
  10.            led2 : out  STD_LOGIC;
  11.            led3 : out  STD_LOGIC;
  12.            led4 : out  STD_LOGIC);
  13. end registr;
  14.  
  15. architecture arch of registr is
  16. ---------------vars---------------
  17. signal x: std_logic_vector(0 to 3) := "0000";
  18. signal x_temp: std_logic_vector(0 to 3) := "0000";
  19. signal q: std_logic := '1';
  20. signal neq: std_logic := '0';
  21.  
  22. begin
  23.  
  24.     process(bot1, bot3, bot4)
  25.    
  26.     begin
  27.        
  28.         x <= (not bot1) & x(1) & x(2) & x(3);
  29.    
  30.         if (not bot4 = '1') then
  31.             x <= "0000";
  32.         elsif (not bot3 = '1') then
  33.             x <= x(3) & x(0) & x(1) & x(2);
  34.         end if;
  35.        
  36.        
  37.     end process;
  38.    
  39.     led1 <= x(0);
  40.     led2 <= x(1);
  41.     led3 <= x(2);
  42.     led4 <= x(3);
  43.  
  44. end arch;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement