Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
module verilog_dual_port_ram
(
input [(D_WIDTH-1):0] data,
input [(A_WIDTH-1):0] read_addr, write_addr,
input we, clk,
output reg [(D_WIDTH-1):0] q
);
parameter D_WIDTH = ???; // your parameters
parameter A_WIDTH = ???;
reg [D_WIDTH-1:0] ram[2**A_WIDTH-1:0];
always @ (posedge clk)
begin
if (we)
ram[write_addr] <= data;
q <= ram[read_addr];
end
endmodule