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  generic (
 2    BITS            : positive;
 3    INVERT_FEEDBACK : boolean   := FALSE                                  -- FALSE -> ring counter;   TRUE -> johnson counter
 4  );
 5  port (
 6    Clock   : in  std_logic;                                              -- Clock
 7    Reset   : in  std_logic;                                              -- Reset
 8    seed    : in  std_logic_vector(BITS - 1 downto 0) := (others => '0'); -- initial counter vector / load value
 9    inc     : in  std_logic                           := '0';             -- increment counter
10    dec     : in  std_logic                           := '0';             -- decrement counter
11    value   : out std_logic_vector(BITS - 1 downto 0)                     -- counter value
12  );
13end entity;