PoC.arith.counter_ring

This module implements an up/down ring-counter with loadable initial value (seed) on reset. The counter can be configured to a Johnson counter by enabling INVERT_FEEDBACK. The number of counter bits is configurable with BITS.

Entity Declaration:

 1  );
 2  port (
 3    Clock   : in  std_logic;                                              -- Clock
 4    Reset   : in  std_logic;                                              -- Reset
 5    seed    : in  std_logic_vector(BITS - 1 downto 0) := (others => '0'); -- initial counter vector / load value
 6    inc     : in  std_logic                           := '0';             -- increment counter
 7    dec     : in  std_logic                           := '0';             -- decrement counter
 8    value   : out std_logic_vector(BITS - 1 downto 0)                     -- counter value
 9  );
10end entity;
11
12
13architecture rtl of arith_counter_ring is
14  constant invert   : std_logic     := to_sl(INVERT_FEEDBACK);