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    Increment  : in  std_logic                            := '0';              -- increment counter
 7    Decrement  : 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);