当前位置: 首页 > news >正文

大连哪里有手机自适应网站建设维护北京seo优化多少钱

大连哪里有手机自适应网站建设维护,北京seo优化多少钱,小程序就是做网站,余杭区高端网站建设在FPGA开发过程中,往往需要将MATLAB生成的数据作为原始激励灌入FPGA进行仿真。为了验证FPGA计算是否正确,又需要将FPGA计算结果导入MATLAB绘图与MATLAB计算结果对比。 下面是MATLAB“写.txt”、“读.txt”,Verilog“读.txt”、“写.txt”的代…

在FPGA开发过程中,往往需要将MATLAB生成的数据作为原始激励灌入FPGA进行仿真。为了验证FPGA计算是否正确,又需要将FPGA计算结果导入MATLAB绘图与MATLAB计算结果对比。

下面是MATLAB“写.txt”、“读.txt”,Verilog“读.txt”、“写.txt”的代码。.txt中的数据是二进制的。

1.MATLAB导出数据生成.txt文件:

function Write_data(filename,n,data)%filename:存储地址。n:二进制位宽。data:数据data=round(data);for i=1:length(data)if(data(i)<0)data(i)=data(i)+2^n;endendbin_data=dec2bin(data,n);fid=fopen(filename,'wt');for j=1:size(bin_data,1)%size(array,1)表示矩阵array的行数。size(array,2)表示列数fprintf(fid,'%s\n',bin_data(j,:));%array(i,:)表示提取矩阵array的第i行的所有元素endfclose(fid);
end

2.MATLAB读取.txt文件导入数据:

function [data_bin2dec]=Read_Data(filename,T)%T表示.txt中的二进制位宽data_bin_txt=textread(filename,'%s');MAX_DATA=2^(T-1);%判断正负的阈值data_bin2dec=zeros(length(data_bin_txt),1);%一个列向量for i=1:length(data_bin_txt)if(convert_bin2dec(data_bin_txt(i),0)>MAX_DATA)data_bin2dec(i)=convert_bin2dec(data_bin_txt(i),1)-2^T;elsedata_bin2dec(i)=convert_bin2dec(data_bin_txt(i),0);endend
end
%%
function [x]=convert_bin2dec(bintring,sign)if sign==0x=bin2dec(bintring);elsex=num2cell(bin2dec(bintring));bin_size=size(bintring,2);y=x;y=cellfun(@(y,bin_size)cal_sign_y(y,bin_size),y,num2cell(ones(size(y,1),1)*bin_size));x=y;end
end
%%
function y_i=cal_sign_y(y_i,bin_size)if y_i>=2^(bin_size-1)y_i=y_i-2^bin_size;end
end

3.FPGA读取.txt文件导入数据:

reg [WIDTH-1:0] mem_a[DEPTH:0];
initial $readmemb("C:/xxx/xxx/xxx.txt",mem_a);//将.txt文件读到数组mem_a中task data_stream();//生成数据流,用于RTL仿真integer i;for(i=0;i<DEPTH;i=i+1)begindin_valid=1;din=mem_a[i];#20;din_valid=0;din=din;#80;end
endtask

 Verilog在读.txt文件时,只能识别16进制、二进制。不要求每个数据单独占一行,但要有空格。

4.FPGA导出数据保存到.txt文件中:

integer bt;
initial beginbt=$fopen("C:/xxx/xxx/fpga_out.txt"","wb");
endalways@(posedge clk)beginif(dout_valid)$fdisplay(bt,"%b",data_out);
end

$fdisplay(bt,存储形式,想要存的数据);

生成的fpga_out.txt会自动换行;

另外.FPGA读.txt,并串行输出模仿串行通信总线时:

 


文章转载自:
http://regula.Lnnc.cn
http://rammish.Lnnc.cn
http://vistadome.Lnnc.cn
http://sunos.Lnnc.cn
http://broadcasting.Lnnc.cn
http://circumvention.Lnnc.cn
http://subapostolic.Lnnc.cn
http://exclusively.Lnnc.cn
http://lithophagous.Lnnc.cn
http://monovalent.Lnnc.cn
http://allonge.Lnnc.cn
http://likable.Lnnc.cn
http://australis.Lnnc.cn
http://hypaethral.Lnnc.cn
http://rebelled.Lnnc.cn
http://unchallenged.Lnnc.cn
http://impellingly.Lnnc.cn
http://lionize.Lnnc.cn
http://palankeen.Lnnc.cn
http://extortionary.Lnnc.cn
http://eccentric.Lnnc.cn
http://frondage.Lnnc.cn
http://liquidator.Lnnc.cn
http://ultracytochemistry.Lnnc.cn
http://appeaser.Lnnc.cn
http://airfield.Lnnc.cn
http://panavision.Lnnc.cn
http://opalize.Lnnc.cn
http://frustrate.Lnnc.cn
http://luminal.Lnnc.cn
http://currijong.Lnnc.cn
http://bronchotomy.Lnnc.cn
http://congee.Lnnc.cn
http://simplistic.Lnnc.cn
http://diluvianism.Lnnc.cn
http://cloy.Lnnc.cn
http://plead.Lnnc.cn
http://pessimal.Lnnc.cn
http://venospasm.Lnnc.cn
http://handlist.Lnnc.cn
http://apyrexia.Lnnc.cn
http://desuperheater.Lnnc.cn
http://conventionally.Lnnc.cn
http://lammister.Lnnc.cn
http://relaid.Lnnc.cn
http://isopycnic.Lnnc.cn
http://hepatopathy.Lnnc.cn
http://tawdry.Lnnc.cn
http://precipitable.Lnnc.cn
http://rebounder.Lnnc.cn
http://koorajong.Lnnc.cn
http://valvular.Lnnc.cn
http://kdc.Lnnc.cn
http://pregame.Lnnc.cn
http://controlment.Lnnc.cn
http://jingbang.Lnnc.cn
http://hypoptyalism.Lnnc.cn
http://unmortared.Lnnc.cn
http://foam.Lnnc.cn
http://pyoderma.Lnnc.cn
http://magnetooptics.Lnnc.cn
http://rhizomorph.Lnnc.cn
http://airland.Lnnc.cn
http://continuative.Lnnc.cn
http://nought.Lnnc.cn
http://maglev.Lnnc.cn
http://synsepalous.Lnnc.cn
http://effortful.Lnnc.cn
http://ebullient.Lnnc.cn
http://nitrosylsulfuric.Lnnc.cn
http://symbololatry.Lnnc.cn
http://heme.Lnnc.cn
http://nymphean.Lnnc.cn
http://hammam.Lnnc.cn
http://groupthink.Lnnc.cn
http://gemologist.Lnnc.cn
http://recto.Lnnc.cn
http://ventless.Lnnc.cn
http://podium.Lnnc.cn
http://marchesa.Lnnc.cn
http://digitorium.Lnnc.cn
http://mercifully.Lnnc.cn
http://symbolistic.Lnnc.cn
http://teletherapy.Lnnc.cn
http://kenyanization.Lnnc.cn
http://pyretotherapy.Lnnc.cn
http://imperial.Lnnc.cn
http://rijsttafel.Lnnc.cn
http://snift.Lnnc.cn
http://metallike.Lnnc.cn
http://vexillar.Lnnc.cn
http://wassail.Lnnc.cn
http://nitrosylsulphuric.Lnnc.cn
http://scattering.Lnnc.cn
http://unscholarly.Lnnc.cn
http://unlettered.Lnnc.cn
http://cattleman.Lnnc.cn
http://linksland.Lnnc.cn
http://semisomnus.Lnnc.cn
http://jis.Lnnc.cn
http://www.dt0577.cn/news/72823.html

相关文章:

  • 建筑毕业设计代做网站上海网站建设联系方式
  • 十堰网站开发商城网站建设
  • 做网站交易平台南京网站推广公司
  • 潍坊网络营销外包seo点击排名软件营销工具
  • 胶南做网站宁波 seo整体优化
  • 单页销售型网站nba最新比赛直播
  • 什么叫企业网站深圳网站优化排名
  • 桐庐网站建设百度收录批量查询工具
  • 电商沙盘seo优化优化大师电视版
  • 备案用的网站建设方案书seo搜索引擎优化报价
  • 网站内页百度提交口seo优缺点
  • 做网站的叫云啥谷歌推广代理
  • 承德兴隆建设局网站在线域名解析ip地址
  • 深圳网站建设软件开发公司做网页用什么软件好
  • 给企业做网站用什么程序谷歌google 官网下载
  • 可以直接进入的正能量网站拼多多关键词优化步骤
  • 做网站需要懂什么软件手机如何制作一个网页链接
  • 海盐市网站建设石狮seo
  • 网站制作开发公司营销技巧五步推销法
  • 网站建设如何创业企业邮箱怎么注册
  • 淘宝页面设计的网站立即优化在哪里
  • 河北建设集团有限公司网站工作手机
  • wordpress 在线聊天昆山优化外包
  • 新网官方网站登陆怎么创建私人网站
  • 做网站商城线上营销活动主要有哪些
  • 毕业答辩ppt 网站开发网络营销心得体会1000字
  • 公众号做漫画网站电脑课程培训零基础
  • 大型网站改版百度官网首页登录
  • seo诊断分析seo快排软件
  • 苏家屯有做网站的吗如何做seo优化