Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library IEEE;
- use IEEE.STD_LOGIC_1164.ALL;
- use IEEE.STD_LOGIC_ARITH.ALL;
- use IEEE.STD_LOGIC_UNSIGNED.ALL;
- entity licznik_16 is
- Port ( wej : in STD_LOGIC;
- sw1 : in STD_LOGIC;
- sw2 : in STD_LOGIC;
- wyj : out STD_LOGIC_VECTOR (3 downto 0));
- end licznik_16;
- architecture Behavioral of licznik_16 is
- signal licznik : std_logic_vector(11 downto 0):="000000000000";
- begin
- process(wej)
- begin
- if (wej'event and sw1='1') then
- licznik <= licznik + 1;
- else
- licznik <= licznik - 1;
- end if;
- if (sw2 = '1') then
- licznik <= licznik;
- end if;
- end process;
- end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement