- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have designed a RAM. The RAM has following codes.
module ram_8bit (we,re, clk, add, datin, datout); input [6:0] add; input we, re, clk; input [7:0] datin; output[7:0] datout; reg [7:0] datout; reg [7:0] mem [127:0]; always @(posedge clk) begin if (we) mem[add] <= datin; //data write else if (re) datout = mem[add]; //data read else datout=datout; end endmodule The code a have written here shows a ram but the input and output simulation file remains same. I have attached the files here. Please see the files. Any one please help me regarding this code. Where is the wrong i made? or My input is wrong. Please help. I want to insert an image in this RAM. I mean the images pixel value not the image. Can any one help me? I am in big trouble. Thanks in advance.Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you mean you need to initialize the RAM? Or you'd like to perform a simulation that writes the image into the RAM? If you want to initialize, normally the values are stored in a file and either the $readmemh or $readmemb functions are used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear SusannahM,
Thanks for your reply. Yes, I want to perform a simulation that writes the image into the RAM. If would please see the input and output image of that program, and suggest me regarding the change the output. Thanks again.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page