Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library IEEE;
- use IEEE.STD_LOGIC_1164.ALL;
- entity Cw3 is
- Port ( x : in STD_LOGIC_VECTOR (7 downto 0);
- wy : out STD_LOGIC_VECTOR (7 downto 0);
- sw0 : in STD_LOGIC;
- sw1 : in STD_LOGIC);
- --Wejścia znajdują się na pinach (od najstarszego bitu): 10,7,5,3,9,6,4,2.
- --Wyjścia znajdują się na pinach (od najstarszego bitu): 119,117,115,113,104,102,100,97.
- --Switch związany jest z pinem 39.
- end Cw3;
- architecture Behavioral of Cw3 is
- signal rej : STD_LOGIC_VECTOR (7 downto 0):="00000000";
- begin
- process(sw0, sw1)
- begin
- if sw1'event and sw1='1' then
- rej(0)<=x(1);
- rej(1)<=x(2);
- rej(2)<=x(3);
- rej(3)<=x(4);
- rej(4)<=x(5);
- rej(5)<=x(6);
- rej(6)<=x(7);
- rej(7)<=x(0);
- elsif sw0'event and sw0 = '1' then
- rej<=x;
- end if;
- end process;
- wy<=rej;
- end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement