Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17241 Discussions

Checking the RAM and Inserting Image into in a RAM

Altera_Forum
Honored Contributor II
1,390 Views

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.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
694 Views

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.

0 Kudos
Altera_Forum
Honored Contributor II
694 Views

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.
0 Kudos
Reply