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

Subversion Repositories hwlu

[/] [hwlu/] [trunk/] [rtl/] [vhdl/] [reg_dw.vhd] - Blame information for rev 12

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 kavi
----==============================================================----
2
----                                                              ----
3
---- Filename: reg_dw.vhd                                         ----
4
---- Module description: DW-bit D-type register with synchronous  ----
5
----                     reset and load enable                    ----          
6
----                                                              ----
7
---- Author: Nikolaos Kavvadias                                   ----
8
----         nkavv@skiathos.physics.auth.gr                       ----
9
----                                                              ---- 
10
----                                                              ----
11
---- Downloaded from: http://wwww.opencores.org/cores/hwlu        ----
12
----                                                              ----
13
---- To Do:                                                       ----
14
----         Probably remains as current                          ---- 
15
----         (to promote as stable version)                       ----
16
----                                                              ----
17
---- Author: Nikolaos Kavvadias                                   ----
18
----         nkavv@skiathos.physics.auth.gr                       ----
19
----                                                              ----
20
----==============================================================----
21
----                                                              ----
22
---- Copyright (C) 2004 Nikolaos Kavvadias                        ----
23
----                    nick-kavi.8m.com                          ----
24
----                    nkavv@skiathos.physics.auth.gr            ----
25
----                    nick_ka_vi@hotmail.com                    ----
26
----                                                              ----
27
---- This source file may be used and distributed without         ----
28
---- restriction provided that this copyright statement is not    ----
29
---- removed from the file and that any derivative work contains  ----
30
---- the original copyright notice and the associated disclaimer. ----
31
----                                                              ----
32
---- This source file is free software; you can redistribute it   ----
33
---- and/or modify it under the terms of the GNU Lesser General   ----
34
---- Public License as published by the Free Software Foundation; ----
35
---- either version 2.1 of the License, or (at your option) any   ----
36
---- later version.                                               ----
37
----                                                              ----
38
---- This source is distributed in the hope that it will be       ----
39
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
40
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
41
---- PURPOSE. See the GNU Lesser General Public License for more  ----
42
---- details.                                                     ----
43
----                                                              ----
44
---- You should have received a copy of the GNU Lesser General    ----
45
---- Public License along with this source; if not, download it   ----
46
---- from <http://www.opencores.org/lgpl.shtml>                   ----
47
----                                                              ----
48
----==============================================================----
49
--
50
-- CVS Revision History
51
--    
52
 
53
library IEEE;
54
use IEEE.std_logic_1164.all;
55
 
56
 
57
entity reg_dw is
58
  generic (
59
    DW : integer := 8
60
  );
61
  port (
62
    clk   : in std_logic;
63
    reset : in std_logic;
64
    load  : in std_logic;
65
    d     : in std_logic_vector(DW-1 downto 0);
66
    q     : out std_logic_vector(DW-1 downto 0)
67
  );
68
end reg_dw;
69
 
70
 
71
architecture rtl of reg_dw is
72
begin
73
  process (clk, reset, load, d)
74
  begin
75
    if (clk'event and clk = '1') then
76
          -- synchronous reset  
77
          if (reset = '1') then
78
            q <= (others => '0');
79
          elsif (load = '1') then
80
                q <= d;
81
      end if; -- reset, load
82
        end if; -- clk
83
  end process;
84
  --    
85
end rtl;

powered by: WebSVN 2.1.0

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