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

Subversion Repositories mod_sim_exp

[/] [mod_sim_exp/] [trunk/] [rtl/] [vhdl/] [core/] [register_n.vhd] - Blame information for rev 4

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

Line No. Rev Author Line
1 3 JonasDC
----------------------------------------------------------------------  
2
----  register_n                                                  ---- 
3
----                                                              ---- 
4
----  This file is part of the                                    ----
5
----    Modular Simultaneous Exponentiation Core project          ---- 
6
----    http://www.opencores.org/cores/mod_sim_exp/               ---- 
7
----                                                              ---- 
8
----  Description                                                 ---- 
9
----    n bit register                                            ----
10
----    used in montgommery multiplier systolic array stages      ----            
11
----                                                              ---- 
12
----  Dependencies: none                                          ----
13
----                                                              ----
14
----  Authors:                                                    ----
15
----      - Geoffrey Ottoy, DraMCo research group                 ----
16
----      - Jonas De Craene, JonasDC@opencores.org                ---- 
17
----                                                              ---- 
18
---------------------------------------------------------------------- 
19
----                                                              ---- 
20
---- Copyright (C) 2011 DraMCo research group and OPENCORES.ORG   ---- 
21
----                                                              ---- 
22
---- This source file may be used and distributed without         ---- 
23
---- restriction provided that this copyright statement is not    ---- 
24
---- removed from the file and that any derivative work contains  ---- 
25
---- the original copyright notice and the associated disclaimer. ---- 
26
----                                                              ---- 
27
---- This source file is free software; you can redistribute it   ---- 
28
---- and/or modify it under the terms of the GNU Lesser General   ---- 
29
---- Public License as published by the Free Software Foundation; ---- 
30
---- either version 2.1 of the License, or (at your option) any   ---- 
31
---- later version.                                               ---- 
32
----                                                              ---- 
33
---- This source is distributed in the hope that it will be       ---- 
34
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ---- 
35
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ---- 
36
---- PURPOSE.  See the GNU Lesser General Public License for more ---- 
37
---- details.                                                     ---- 
38
----                                                              ---- 
39
---- You should have received a copy of the GNU Lesser General    ---- 
40
---- Public License along with this source; if not, download it   ---- 
41
---- from http://www.opencores.org/lgpl.shtml                     ---- 
42
----                                                              ---- 
43
----------------------------------------------------------------------
44 2 JonasDC
 
45 3 JonasDC
library ieee;
46
use ieee.std_logic_1164.all;
47
use ieee.std_logic_arith.all;
48
use ieee.std_logic_unsigned.all;
49
 
50
-- Xilinx primitives used
51 2 JonasDC
library UNISIM;
52
use UNISIM.VComponents.all;
53
 
54 3 JonasDC
 
55 2 JonasDC
entity register_n is
56 3 JonasDC
  generic(
57
    n : integer := 4
58
  );
59
  port(
60
    core_clk : in  std_logic;
61
    ce       : in  std_logic;
62
    reset    : in  std_logic;
63
    din      : in  std_logic_vector((n-1) downto 0);
64
    dout     : out std_logic_vector((n-1) downto 0)
65
  );
66 2 JonasDC
end register_n;
67
 
68 3 JonasDC
 
69 2 JonasDC
architecture Structural of register_n is
70
        signal dout_i : std_logic_vector((n-1) downto 0) := (others => '0');
71
begin
72
 
73
        dout <= dout_i;
74
 
75 3 JonasDC
  N_REGS : for i in 0 to n-1 generate
76
    FDCE_inst : FDCE
77
    generic map (
78
      INIT => '0'       -- Initial value of latch ('0' or '1')
79
    )
80
    port map (
81
      Q   => dout_i(i), -- Data output
82
      CLR => reset,     -- Asynchronous clear/reset input
83
      D   => din(i),    -- Data input
84
      C   => core_clk,  -- Gate input
85
      CE  => ce         -- Gate enable input
86
    );
87
  end generate;
88 2 JonasDC
 
89 3 JonasDC
end Structural;

powered by: WebSVN 2.1.0

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