-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRAM.v
43 lines (37 loc) · 771 Bytes
/
RAM.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 23:42:33 01/02/2022
// Design Name:
// Module Name: RAM
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module RAM(
input clk,
input we,
input [9:0] addr,
input [31:0] din,
output reg [31:0] dout
);
reg [31:0] ram_mem [1023:0];
always @(posedge clk) begin
if(we)
ram_mem[addr] = din;
//dout = ram_mem[addr];
end
always @(clk==0) begin
dout = ram_mem[addr];
end
endmodule