Advertisement
kutasenator

aaaaaaaaa

Mar 23rd, 2021
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3.  
  4. entity Cw3 is
  5. Port ( x : in STD_LOGIC_VECTOR (7 downto 0);
  6. wy : out STD_LOGIC_VECTOR (7 downto 0);
  7. sw0 : in STD_LOGIC;
  8. sw1 : in STD_LOGIC);
  9. --Wejścia znajdują się na pinach (od najstarszego bitu): 10,7,5,3,9,6,4,2.
  10. --Wyjścia znajdują się na pinach (od najstarszego bitu): 119,117,115,113,104,102,100,97.
  11. --Switch związany jest z pinem 39.
  12. end Cw3;
  13. architecture Behavioral of Cw3 is
  14.  
  15. signal rej : STD_LOGIC_VECTOR (7 downto 0):="00000000";
  16.  
  17. begin
  18. process(sw0, sw1)
  19. begin
  20. if sw1'event and sw1='1' then
  21. rej(0)<=x(1);
  22. rej(1)<=x(2);
  23. rej(2)<=x(3);
  24. rej(3)<=x(4);
  25. rej(4)<=x(5);
  26. rej(5)<=x(6);
  27. rej(6)<=x(7);
  28. rej(7)<=x(0);
  29. elsif sw0'event and sw0 = '1' then
  30. rej<=x;
  31. end if;
  32. end process;
  33. wy<=rej;
  34. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement