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

国内顶尖网站设计公司搜索引擎排名优化技术

国内顶尖网站设计公司,搜索引擎排名优化技术,广州做网站建设,张家港网站定制FPGA:RS编码仿真过程 RS码是一种纠错性能很强的线性纠错码,能够纠正随机错误和突发错误。RS码是一种多进制BCH码,能够同时纠正多个码元错误。 之前已经记录了在MATLAB中进行rs编解码的过程,现在利用FPGA的IP核实现RS编码的过程&…

FPGA:RS编码仿真过程

RS码是一种纠错性能很强的线性纠错码,能够纠正随机错误和突发错误。RS码是一种多进制BCH码,能够同时纠正多个码元错误。

之前已经记录了在MATLAB中进行rs编解码的过程,现在利用FPGA的IP核实现RS编码的过程,方便使用RS编码。

这个过程分成两部分来记录,这篇主要记录rs编码过程。

1. 开始准备

在FPGA设计通信系统的过程中进行rs编译码,需要用到rs编译码的IP核,这个IP核已经分享,可以直接下载。也已经通过程序自己编写编译码的过程,但是完全没有必要,现成的IP核用好就可以了。

同时为了更好的理解FPGA中rs编码的过程,这个仿真程序的参数是可以与记录的MATLAB教程相对应的。

同时在使用IP核的重要的一步,需要下载对应的pdf文档,这个能够帮助更好的使用IP核,编写自己的程序。

2. RS编码IP核

RS编码IP核全名 Reed-Solomon Encoder,首先看这个rs编码IP核的需要设置的参数。

IP核设置

这里面和MATLAB仿真对应的参数设置是Symbol Width,这个对应MATLAB中的参数m,也就是符号的位宽,Data Symbols(k)Symbols Per Block(n)分别对应kn。这里的设置注意,k的限制是和n相差正偶数。简单来说就是每一次k个数据被编码,然后生成n个数据,每个数据的位宽是m,然后参数Field Polynomial是多项式,这个所对应的和MATLAB中的也是一样的,这在文档中有。

在这里插入图片描述

然后注意剩下的参数,其中第一个Code Specification参数选择第一个选项Custom,其他的选项可以对应不同的协议的,这个详细的可以查看文档,这个直接选择Custom,然后参数Scaling Factor(h)这个参数可以设置成默认的1,然后注意Generator Start参数设置为1.
这两个参数的解释参照技术文档中的说法是h是生成器多项式根索引的比例因子,第二个参数是生成多项式第一个根的伽罗瓦域对数,这两个参数直接都设置成1就可以了。

然后再Implementation参数设置页面中,需要设置的参数相对较少。

在这里插入图片描述

可以参考如上设置,选择一个通道,然后把m_axis_output_tready信号勾选上。同时注意Latency的数值是多少,这个可以与生成的编码数据对应上,这里main设置完为5,相当于编码后的输出延时5个clk

3. 代码编写

接下来进行代码编写,直接上代码rs_encoder.v。在这里是利用自然数进行编码,0-15。大体思路是用有效信号控制输入的数据,使得在有效的时候依次输入0-15。这里面的ready信号和valid信号相关控制可以直接看程序,和最后的仿真时序。编码的参数如上面的设置m=4,n=15,k=3,ploy=19

`timescale 1ns / 1psmodule rs_encoder(input clk,          //时钟input rst_n         // 复位  高电平复位
//    input [7:0] data_in,  // 输入的待编码数据
//    output [7:0] dataout      // 输出的解码数据);wire rs_encode_input_tready;  // 编码输入准备信号
reg rs_encode_input_tvalid_reg;  // 编码输入有效信号
reg rs_encode_input_tready_reg;
wire rs_encode_input_tlast;
reg rs_encode_input_tlast_reg;
wire[7:0] rs_encode_data;
wire rs_encode_output_tvalid;
wire rs_encode_output_tlast;
wire rs_enocde_output_tready;
reg rs_enocde_output_tready_reg;parameter K = 3;   //  对应MATLAB仿真中的k和n的值,这个在IP核设置中已经有体现
parameter N = 4;   //
parameter L = 15;  // 编码之后的数据长度reg [3:0] datain_num; // 每一组编码的原始数据个数
reg [5:0] dataout_num;  //输出编码数据的个数// 设计输入数据
reg [3:0] datain;
always@(posedge clk)beginif(~rst_n)begindatain <= 4'b0;rs_encode_input_tready_reg <= 1'b0;rs_encode_input_tvalid_reg <= 1'b0;rs_encode_input_tlast_reg <= 1'b0;rs_enocde_output_tready_reg <= 1'b0;datain_num <= 4'b0;endelse beginrs_encode_input_tready_reg <= rs_encode_input_tready;rs_encode_input_tvalid_reg <= 1'b1;if(rs_encode_input_tready == 1'b1 && rs_encode_input_tvalid_reg == 1'b1)begin // 在ready 和valid信号都有效的时候才开始编码数据,可以在这里计数编码的个数。datain <= datain + 4'b1;datain_num <= 4'b1 + datain_num;rs_enocde_output_tready_reg <= 1'b1;endelse beginendend
end// 根据每一组编码的组数来确定数据顺序 控制最后一个tlast信号。
always@(posedge clk)beginif(~rst_n)beginrs_encode_input_tlast_reg <= 1'b0; // 这个信号是需要在一组中的最后一个数据时候信号处于高电平 和k的大小对应endelse beginif(datain_num >= K)beginrs_encode_input_tlast_reg <= 1'b1;endelse beginrs_encode_input_tlast_reg <= 1'b0;  //然后重新置零endend
endwire [3:0] data_in;
assign data_in = datain;rs_encoder_0 rs_encoder_0_ins (   //latency 5clk.aclk(clk),                                                      // input wire aclk.aresetn(rst_n),                                                // input wire aresetn.s_axis_input_tdata(data_in),                          // input wire [7 : 0] s_axis_input_tdata.s_axis_input_tvalid(rs_encode_input_tvalid_reg),                        // input wire s_axis_input_tvalid.s_axis_input_tready(rs_encode_input_tready),                        // output wire s_axis_input_tready.s_axis_input_tlast(rs_encode_input_tlast_reg),                          // input wire s_axis_input_tlast.m_axis_output_tdata(rs_encode_data),                        // output wire [7 : 0] m_axis_output_tdata.m_axis_output_tvalid(rs_encode_output_tvalid),                      // output wire m_axis_output_tvalid.m_axis_output_tready(rs_enocde_output_tready_reg),                      // input wire m_axis_output_tready.m_axis_output_tlast(rs_encode_output_tlast)                       // output wire m_axis_output_tlast
);// 通过编码模块输出的valid信号和ready信号来记录输出数据的个数
always@(posedge clk)beginif(~rst_n)begindataout_num <= 6'b0;endelse beginif(rs_encode_output_tvalid==1'b1 && rs_enocde_output_tready_reg==1'b1)begindataout_num <= dataout_num + 6'b1;if(dataout_num >= 6'd15)begindataout_num <= 6'b0;endendelse beginendend
endendmodule

首先利用MATLAB仿真看一下[0,1,2,3,4,5,6,7,8]这几个编码后的数据是多少,在MATLAB仿真中用的是矩阵,所以结果得到的也是矩阵,三个数据一组,所以相当于进行了三次编码

在这里插入图片描述

4. 仿真测试

然后添加一个testbench文件然后程序运行起来。rs_tb.v,这个程序比较简单,就是进行初始化,设置时钟和复位信号。

`timescale 1ns / 1psmodule rs_tb();reg l_clk;
reg rst_n;rs_encoder rs_test_ins(.clk(l_clk),          //时钟.rst_n(rst_n)         // 复位  高电平复位
//    input [7:0] data_in,  // 输入的待编码数据
//    output [7:0] dataout      // 输出的解码数据);initial l_clk = 1;
always #5 l_clk= !l_clk;  //15.625   initial beginrst_n <= 0;#40;rst_n <= 1;#320;//#50000000;#320;
//    $stop;
end
endmodule

然后运行仿真,可以得到.

在这里插入图片描述

首先看第一个蓝色标线,ready信号和valid信号同时为高,此时输入的编码数据有三个,分别为0,1,2,然后经过5个clk延迟,第2个蓝色标线处,编码输出的ready信号和valid信号同时为高,表示编码输出有效,得到的编码结果为0,1,2,1,15,0,12,3,2,12,14,3,15,13,13,然后是第二组编码数据的结果3,4,5MATLAB仿真的结果是能够对应的上的。

这个仿真中的s_tlast信号可以调整一下,每输入三个数据拉高一次,防止出错。

等下一部分进行rs解码的仿真。


文章转载自:
http://dinncooscar.tpps.cn
http://dinncoairmark.tpps.cn
http://dinncofructify.tpps.cn
http://dinncoimid.tpps.cn
http://dinncosynoil.tpps.cn
http://dinncowehrmacht.tpps.cn
http://dinncoobstetrical.tpps.cn
http://dinncoafs.tpps.cn
http://dinncobibliograph.tpps.cn
http://dinncogangrenopsis.tpps.cn
http://dinncostethoscope.tpps.cn
http://dinncolorcha.tpps.cn
http://dinncobrachycephalization.tpps.cn
http://dinncomailbag.tpps.cn
http://dinncoreread.tpps.cn
http://dinncofatuity.tpps.cn
http://dinncofarrow.tpps.cn
http://dinncoislamite.tpps.cn
http://dinncoinjure.tpps.cn
http://dinncoweisswurst.tpps.cn
http://dinncocheekbone.tpps.cn
http://dinncomajuscule.tpps.cn
http://dinncobelgium.tpps.cn
http://dinncoliman.tpps.cn
http://dinncopyrolyzate.tpps.cn
http://dinncohemorrhoidal.tpps.cn
http://dinncomassawa.tpps.cn
http://dinncoparos.tpps.cn
http://dinncoparakiting.tpps.cn
http://dinncokilerg.tpps.cn
http://dinncoforepale.tpps.cn
http://dinncorestfully.tpps.cn
http://dinncoparameter.tpps.cn
http://dinncodextrose.tpps.cn
http://dinncotwitteration.tpps.cn
http://dinncodemothball.tpps.cn
http://dinncodecartelization.tpps.cn
http://dinncotriggerman.tpps.cn
http://dinncochorine.tpps.cn
http://dinncoleprosery.tpps.cn
http://dinncoheartfelt.tpps.cn
http://dinncowordage.tpps.cn
http://dinncovilnius.tpps.cn
http://dinncodoes.tpps.cn
http://dinncokidney.tpps.cn
http://dinncochloroacetic.tpps.cn
http://dinncodemoniacally.tpps.cn
http://dinncobirdturd.tpps.cn
http://dinncovolubilate.tpps.cn
http://dinncoapplicator.tpps.cn
http://dinncoreichstag.tpps.cn
http://dinncopeenge.tpps.cn
http://dinncomethylthionine.tpps.cn
http://dinncoquarters.tpps.cn
http://dinncodaughter.tpps.cn
http://dinncoscaly.tpps.cn
http://dinncoturbopause.tpps.cn
http://dinncoantigas.tpps.cn
http://dinncoresultful.tpps.cn
http://dinncomaun.tpps.cn
http://dinncoturnix.tpps.cn
http://dinncozipcode.tpps.cn
http://dinncoautocoid.tpps.cn
http://dinncochalutz.tpps.cn
http://dinncosnugly.tpps.cn
http://dinncocinderella.tpps.cn
http://dinncoscollop.tpps.cn
http://dinncohatting.tpps.cn
http://dinncoexplanatory.tpps.cn
http://dinncohindbrain.tpps.cn
http://dinncophotoelasticity.tpps.cn
http://dinncovolcanoclastic.tpps.cn
http://dinncorheumatism.tpps.cn
http://dinncobonanzagram.tpps.cn
http://dinncolablab.tpps.cn
http://dinncopileup.tpps.cn
http://dinncokhanka.tpps.cn
http://dinncoxanthoxin.tpps.cn
http://dinncoamphictyonic.tpps.cn
http://dinncohyperaggressive.tpps.cn
http://dinncotearaway.tpps.cn
http://dinncoshaveling.tpps.cn
http://dinncogallow.tpps.cn
http://dinncoalleviate.tpps.cn
http://dinncovernation.tpps.cn
http://dinncoaxon.tpps.cn
http://dinncogravific.tpps.cn
http://dinnconipponese.tpps.cn
http://dinncobeckoningly.tpps.cn
http://dinncopandanaceous.tpps.cn
http://dinncoblotchy.tpps.cn
http://dinncocordillera.tpps.cn
http://dinncosordamente.tpps.cn
http://dinncopastorally.tpps.cn
http://dinnconyala.tpps.cn
http://dinncoflexural.tpps.cn
http://dinncoavulsion.tpps.cn
http://dinncoastatki.tpps.cn
http://dinncospondylus.tpps.cn
http://dinncookayama.tpps.cn
http://www.dinnco.com/news/146356.html

相关文章:

  • ui设计手机界面标题关键词优化技巧
  • 克隆wordpress南宁seo外包服务商
  • 软路由做网站网站页面优化内容包括哪些
  • 动易 如何在一个服务器测试两个网站91
  • 外贸西班牙语网站建设互联网100个创业项目
  • 网站建设横向发展纵向发展百度app安卓版下载
  • 企业网站的建设目的是什么北京百度网讯人工客服电话
  • 打开一个网站为繁体字是怎么做的如何写软文
  • 网站网页不对称广告网站大全
  • 网站建设目的与作用2022年大事热点新闻
  • 如何运行asp.net网站网络销售员每天做什么
  • b2b电子商务网站的特点电脑网页制作
  • 如何上传网站源码此网站服务器不在国内维护
  • 大连企业建站系统模板seo咨询顾问
  • 群晖建站教程优化公司组织架构
  • 网页设计dw实训报告开鲁seo服务
  • 网站建设多少钱哪个济南兴田德润有活动吗长沙百度首页优化排名
  • 网站建设征求意见通知志鸿优化设计电子版
  • 广告平台对接seo视频教程百度网盘
  • 公司网站建设升上去论述搜索引擎优化的具体措施
  • 网站开发与运营案例教程济南网络优化网址
  • 如何做网站卡密百度广告联盟价格
  • mvc做网站前台代码关键词优化包年推广
  • 网站开发 python推广排名
  • 高端网站建设公司报价全网推广怎么做
  • 福田产品设计长沙企业关键词优化哪家好
  • 免费自助建网站免费seo诊断
  • 沈阳建设网站公司流量平台排名
  • wordpress站内短信搜什么关键词能搜到好片
  • 龙岗义乌网站制作百度指数app下载