Altera_Forum
Honored Contributor
17 years ago$readmemb
t=[0:0.02*10^-3:0.01];a=cos(2*pi*5*10^3*t);plot(t,a)
b=a*2^11 fid=fopen('e:\resourse.txt','wt');fprintf(fid,'%12.0f\n',b);fclose(fid) //// reg [IDATA_WIDTH-1:0] fir_in[9:0]; reg [IDATA_WIDTH-1:0] temp; initial begin temp=0; $readmemb("e:\resourse.txt",fir_in); end I generated data with MATLAB,and then read them by $readmemb,but when simulating on modelsim,it failed,can you help me?