This commit is contained in:
Jose Luis Montañes Ojados
2026-03-01 03:29:11 +01:00
parent cec82dc58f
commit b3d11de769
3 changed files with 79 additions and 1 deletions

24
ram/ram.v Normal file
View File

@@ -0,0 +1,24 @@
/*
Ram Sincrona
*/
module ram #(
parameter DEPTH = 256, // posiciones
parameter W = 16 // bits por posicion
) (
input clk,
input wr_en,
input [$clog2(DEPTH)-1:0] addr,
input [W-1:0] wr_data,
output reg [W-1:0] rd_data
);
reg [W-1:0] mem [0:DEPTH-1];
always @(posedge clk) begin
if (wr_en)
mem[addr] <= wr_data;
else
rd_data <= mem[addr];
end
endmodule