PoC.arith.counter_freeΒΆ

Implements a free-running counter that generates a strobe signal every DIVIDER-th cycle the increment input was asserted. There is deliberately no output or specification of the counter value so as to allow an implementation to optimize as much as possible.

The implementation guarantees a strobe output directly from a register. It is asserted exactly for one clock after DIVIDER cycles of an asserted increment input have been observed.

Entity Declaration:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
entity arith_counter_free is
  generic (
    DIVIDER : positive
  );
  port (
    -- Global Control
    clk : in  std_logic;
    rst : in  std_logic;

    inc : in  std_logic;
    stb : out std_logic                 -- End-of-Period Strobe
  );
end entity arith_counter_free;