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

Subversion Repositories reed_solomon_decoder

[/] [reed_solomon_decoder/] [trunk/] [rtl/] [DP_RAM.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 aelmahmoud
/* This program is free software: you can redistribute it and/or modify
2
   it under the terms of the GNU General Public License as published by
3
   the Free Software Foundation, either version 3 of the License, or
4
   (at your option) any later version.
5
 
6
   This program is distributed in the hope that it will be useful,
7
   but WITHOUT ANY WARRANTY; without even the implied warranty of
8
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9
   GNU General Public License for more details.
10
 
11
   You should have received a copy of the GNU General Public License
12
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
13
 
14
   Email : semiconductors@varkongroup.com
15
   Tel   : 1-732-447-8611
16
 
17
*/
18
module DP_RAM (clk,we,re,address_read,address_write,data_in,data_out);
19
 
20
parameter address_width=8;
21
parameter data_width=8;
22
parameter num_words=205;
23
 
24
input clk,we,re;
25
input [address_width-1:0] address_read,address_write;
26
input [data_width-1:0] data_in;
27
output [data_width-1:0] data_out;
28
 
29
reg [data_width-1:0] data_out;
30
reg [data_width-1:0] mem [0:num_words-1];
31
 
32
integer         i;
33
        initial
34
        begin
35
                for (i=0;i<num_words;i=i+1)
36
                        mem[i] = 0;
37
        end
38
 
39
always @ (posedge(clk))
40
begin
41
        if (we==1'b1)
42
                begin
43
                        mem[address_write]<= data_in;
44
                end
45
        if (re==1'b1)
46
                begin
47
                        data_out<=mem[address_read];
48
                end
49
end
50
 
51
endmodule

powered by: WebSVN 2.1.0

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