OpenCores
URL https://opencores.org/ocsvn/pcounter/pcounter/trunk

Subversion Repositories pcounter

[/] [pcounter/] [trunk/] [pdchain.vhdl] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 robotron
--
2
-- * pipelined synchronous pulse counter *
3
--  pdchain -- multi-bit counter top-level entity
4
--
5
-- fast counter for slow-carry architectures
6
-- non-monotonic counting, value calculable by HDL/CPU
7
--
8
-- idea&code by Marek Peca <mp@duch.cz> 08/2012
9
-- Vyzkumny a zkusebni letecky ustav, a.s. http://vzlu.cz/
10
-- thanks to Michael Vacek <michael.vacek@vzlu.cz> for testing
11
--
12
 
13
library ieee;
14
use ieee.std_logic_1164.all;
15
use ieee.numeric_std.all;
16
 
17
entity pdchain is
18
  generic (
19
    n: natural := 32
20
  );
21
  port (
22
    clock: in std_logic;
23
    en: in std_logic;
24
    q: out std_logic_vector (n-1 downto 0)
25
  );
26
end pdchain;
27
 
28
architecture behavioral of pdchain is
29
  component pdivtwo
30
    port (
31
      clock: in std_logic;
32
      en: in std_logic;
33
      q, p: out std_logic
34
    );
35
  end component;
36
  --
37
  signal b: std_logic_vector (q'range);
38
begin
39
  q0: pdivtwo
40
    port map (
41
      clock => clock, en => en, p => b(0), q => q(0)
42
    );
43
  ch: for k in 1 to b'high generate
44
    qk: pdivtwo
45
      port map (
46
        clock => clock, en => b(k-1), p => b(k), q => q(k)
47
      );
48
  end generate;
49
end behavioral;

powered by: WebSVN 2.1.0

© copyright 1999-2019 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.