30/05/2014
Counter
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 instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity cnt_bcddir is
port (
dout4 : out std_logic_vector(3 downto 0);
dir : in std_logic;
clk, arst, srst, en : in std_logic );
end;
-- ~ --
architecture Behavioral of cnt_bcddir is
-- declaration of signals inside this block
signal reg_cnt, nxt_cnt : std_logic_vector(3 downto 0);
begin
--
dff_cnt: process(arst, clk)
begin
if (arst = '1') then reg_cnt '0');
elsif (clk'event and clk = '1') then
if (srst = '1') then reg_cnt '0');
elsif (clk'event and clk = '1') then
else
if (en = '1') then
reg_cnt