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

Subversion Repositories hwlu

[/] [hwlu/] [trunk/] [rtl/] [vhdl/] [index_inc.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 kavi
----==============================================================----
2
----                                                              ----
3
---- Filename: index_inc.vhd                                      ----
4
---- Module description: Index increment-by-one unit              ----
5
----                                                              ----
6
---- Author: Nikolaos Kavvadias                                   ----
7
----         nkavv@skiathos.physics.auth.gr                       ----
8
----                                                              ---- 
9
----                                                              ----
10
---- Downloaded from: http://wwww.opencores.org/cores/hwlu        ----
11
----                                                              ----
12
---- To Do:                                                       ----
13
----         Probably remains as current                          ---- 
14
----         (to promote as stable version)                       ----
15
----                                                              ----
16
---- Author: Nikolaos Kavvadias                                   ----
17
----         nkavv@skiathos.physics.auth.gr                       ----
18
----                                                              ----
19
----==============================================================----
20
----                                                              ----
21
---- Copyright (C) 2004 Nikolaos Kavvadias                        ----
22
----                    nick-kavi.8m.com                          ----
23
----                    nkavv@skiathos.physics.auth.gr            ----
24
----                    nick_ka_vi@hotmail.com                    ----
25
----                                                              ----
26
---- This source file may be used and distributed without         ----
27
---- restriction provided that this copyright statement is not    ----
28
---- removed from the file and that any derivative work contains  ----
29
---- the original copyright notice and the associated disclaimer. ----
30
----                                                              ----
31
---- This source file is free software; you can redistribute it   ----
32
---- and/or modify it under the terms of the GNU Lesser General   ----
33
---- Public License as published by the Free Software Foundation; ----
34
---- either version 2.1 of the License, or (at your option) any   ----
35
---- later version.                                               ----
36
----                                                              ----
37
---- This source is distributed in the hope that it will be       ----
38
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
39
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
40
---- PURPOSE. See the GNU Lesser General Public License for more  ----
41
---- details.                                                     ----
42
----                                                              ----
43
---- You should have received a copy of the GNU Lesser General    ----
44
---- Public License along with this source; if not, download it   ----
45
---- from <http://www.opencores.org/lgpl.shtml>                   ----
46
----                                                              ----
47
----==============================================================----
48
--
49
-- CVS Revision History
50
--    
51
 
52
library IEEE;
53
use IEEE.std_logic_1164.all;
54
use IEEE.std_logic_unsigned.all;
55
use IEEE.std_logic_arith.all;
56
 
57
 
58
entity index_inc is
59
  generic (
60
    DW : integer := 8
61
  );
62
  port (
63
    clk            : in std_logic;
64
    reset          : in std_logic;
65
    inc_en         : in std_logic;
66
        index_plus_one : out std_logic_vector(Dw-1 downto 0);
67
    index_out      : out std_logic_vector(DW-1 downto 0)
68
  );
69
end index_inc;
70
 
71
architecture rtl of index_inc is
72
--
73
-- Component declarations
74
component add
75
  generic (
76
    DW : integer := 8
77
  );
78
  port (
79
    a   : in std_logic_vector(DW-1 downto 0);
80
    b   : in std_logic_vector(DW-1 downto 0);
81
    sum : out std_logic_vector(DW-1 downto 0)
82
  );
83
end component;
84
--
85
component reg_dw
86
  generic (
87
    DW : integer := 8
88
  );
89
  port (
90
    clk   : in std_logic;
91
    reset : in std_logic;
92
    load  : in std_logic;
93
    d     : in std_logic_vector(DW-1 downto 0);
94
    q     : out std_logic_vector(DW-1 downto 0)
95
  );
96
end component;
97
--  
98
-- Constant declarations
99
constant one_dw : std_logic_vector(DW-1 downto 0) := conv_std_logic_vector(1,DW);
100
--
101
-- Signal declarations
102
signal index_rin, index_r : std_logic_vector(DW-1 downto 0);
103
--
104
begin
105
 
106
  U_adder : add
107
    generic map (
108
          DW => DW
109
        )
110
    port map (
111
      a => index_r,
112
      b => one_dw,
113
      sum => index_rin
114
    );
115
 
116
  U_reg_dw : reg_dw
117
    generic map (
118
      DW => DW
119
    )
120
    port map (
121
      clk => clk,
122
      reset => reset,
123
      load => inc_en,
124
      d => index_rin,
125
      q => index_r
126
    );
127
 
128
  index_out <= index_r;
129
  index_plus_one <= index_rin;
130
 
131
end rtl;

powered by: WebSVN 2.1.0

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