12 use IEEE.STD_LOGIC_1164.
ALL;
13 USE ieee.std_logic_arith.
all;
18 width : integer := 32;
19 WRAPAROUND : boolean := True
29 Q : out STD_LOGIC_VECTOR (width-1 downto 0)
38 variable temp : unsigned (width-1 downto 0);
39 constant maxval
: unsigned (width-1 downto 0) := (Others => '1');
41 if CLK'event AND CLK = '1' then
43 temp := (others => '0');
45 if (CE = '1') and (WRAPAROUND or (temp /= maxval)) then
50 Q <= std_logic_vector(temp) ;
Generic Counter for process FPGA.
Generic Counter for process FPGA.
in CLK STD_LOGIC
Clock signal input.
in CE STD_LOGIC
Enable signal input.
out Q STD_LOGIC_VECTOR( width- 1 downto 0)
Counter Output signal.
in RST STD_LOGIC
Reset signal input.