----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 10:45:29 04/08/2019
-- Design Name:
-- Module Name: licznik - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity licznik is
Port ( clock : in STD_LOGIC;
reset : in STD_LOGIC;
q_out : out STD_LOGIC_VECTOR (2 downto 0));
end licznik;
architecture Behavioral of licznik is
signal rejestry_d :std_logic_vector (2 downto 0):="000";
begin
process (clock, reset)
begin
if reset = '0' then
rejestry_d <="000";
elsif clock'event and clock = '1' then
rejestry_d(0) <= (rejestry_d(2) and rejestry_d(1)) or (not rejestry_d(0));
rejestry_d(1) <= ((not rejestry_d(1)) and rejestry_d(0)) or (rejestry_d(1) and (not rejestry_d(0)));
rejestry_d(2) <= (rejestry_d(2) and (not rejestry_d(0))) or (rejestry_d(2) and (not rejestry_d(1))) or ((not rejestry_d(2)) and rejestry_d(1) and rejestry_d(0));
end if;
end process;
q_out <= rejestry_d;
end Behavioral;
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}