Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to program RAM in Verilog ?

Status
Not open for further replies.

Ghassan

Newbie level 6
Joined
Dec 13, 2005
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,355
Hi all...
can anyone tell me how to program a RAM in verilog ?
i want to make 128-Deep by 14-Wide memory...
thx alot...
 

ram verilog

may be this example will help ?

Code:
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
---
 

dual port ram verilog

thx alooot
 

hi all hope you are fine
and sir "j_andr" i've been working on FPGA based projects can you tell me your email address....................:)
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top