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

百度网站地图制作大气微电影类网站织梦模板完整版

百度网站地图制作,大气微电影类网站织梦模板完整版,互联网技术类岗位有哪些,辛集手机网站建设先了解一下关于uart和rs232的基础知识 文章目录 一、RS232的回环测试1.1模块整体架构1.2 rx模块设计1.2.1 波形设计1.2.2代码实现与tb1.2.4 仿真 1.3 tx模块设计1.3.1 波形设计1.3.2 代码实现与tb1.3.4 顶层设计1.3.3 仿真 本篇内容#xff1a; 一、RS232的回环测试 上位机…先了解一下关于uart和rs232的基础知识 文章目录 一、RS232的回环测试1.1模块整体架构1.2 rx模块设计1.2.1 波形设计1.2.2代码实现与tb1.2.4 仿真 1.3 tx模块设计1.3.1 波形设计1.3.2 代码实现与tb1.3.4 顶层设计1.3.3 仿真 本篇内容 一、RS232的回环测试 上位机由串口助手通过 rx 线往 FPGA 发 8 比特数据当 FPGA接收到 8 比特数据后再通过 tx 线把接收到的 8 比特数据给上位机发回去要求上位机接收到的数据和上位机发送的数据一样并且保证连续发送也没问题。 1.1模块整体架构 1.2 rx模块设计 1.2.1 波形设计 1.2.2代码实现与tb 代码 module uart_rx(input wire clk,input wire rst,input wire rx,output reg [7:0]po_data,output reg po_flag);parameter CNT_END100; //9600bps cnt5207 sim时cnt100; parameter CNT_END_HALFCNT_END/2;reg rx_t; reg rx_tt; reg rx_tt_reg; reg [12:0] cnt; reg cnt_flag; reg bit_flag; reg [3:0]bit_cnt; // rx_t always (posedge clk) begin if(rst1b1) beginrx_t d1;end else beginrx_trx ;end end// rx_tt always (posedge clk) begin if(rst1b1) beginrx_tt d1;end else beginrx_ttrx_t ;end end// rx_tt_reg always (posedge clk) begin if(rst1b1) beginrx_tt_reg d1;end else beginrx_tt_regrx_tt ;end end//cnt always (posedge clk) begin if(rst1b1) begincnt d0;end else if (cnt_flag1b1 cntCNT_END) begincntd0;endelse if (cnt_flag1b1) begincntcnt1b1;endelse if (bit_cntd8 bit_flag1b1) begincntd0;end end//bit_flag always (posedge clk) begin if(rst1b1) beginbit_flag d0;end else if (cnt_flag1b1 cntCNT_END_HALF) beginbit_flagd1;endelse bit_flagd0; end// cnt_flag always (posedge clk) begin if(rst1b1) begincnt_flag d0;end else if (rx_tt1b0 rx_tt_reg1b1) begincnt_flagd1;endelse if (bit_cntd8 cntCNT_END_HALF) begincnt_flagd0;end end// bit_cnt always (posedge clk) begin if(rst1b1) beginbit_cnt d0;end else if (bit_cntd8 bit_flag1b1) beginbit_cntd0;endelse if (bit_flag1b1) beginbit_cntbit_cnt1b1;endend// po_data always (posedge clk) begin if(rst1b1) beginpo_data d0;end else if (bit_cnt0 bit_flag1b1) beginpo_data{rx,po_data[7:1]};end end// po_flag always (posedge clk) begin if(rst1b1) beginpo_flag d0;end else if (bit_cntd8 bit_flag1b1) beginpo_flagd1;endelse po_flagd0; end endmodule tb timescale 1ns / 1psmodule tb_rx();reg clk;reg rst;reg rx;wire [7:0] po_data;wire po_flag;initial beginclk0;rst1;#100rst0;endinitial beginrx1;//空闲状态#100gen_rx();end//这里模拟发送20帧数据每次发送8个0~1的任意数发送前rx拉低表示起始位 //由于9600波特率需要计数5207次为了仿真方便假设只需要计数100次。task gen_rx;integer i;integer j;begin for (j 0; j 20; jj1) beginrx0;for ( i 0; i 8; ii1) begin repeat(100) begin //每隔100周期发送1bit数据(posedge clk); endrx{$random};endrx1; //每发送完一帧数据后rx恢复空闲状态维持10个周期后继续发送数据直到发够20帧数据。repeat(10) begin(posedge clk);end endendendtask always #5 clk~clk;uart_rx inst_uart_rx (.clk (clk),.rst (rst),.rx (rx),.po_data (po_data),.po_flag (po_flag));endmodule 1.2.4 仿真 1.3 tx模块设计 1.3.1 波形设计 1.3.2 代码实现与tb module uart_tx(input wire clk,input wire rst,input wire[7:0] po_data,input wire po_flag,output reg tx);parameter CNT_END100; // bps为9600时这里为5207 为仿真方便设为100。reg [7:0] po_data_reg; reg [12:0]cnt; reg cnt_flag; reg bit_flag; reg [3:0] bit_cnt; // po_data_reg always (posedge clk) begin if(rst1b1) beginpo_data_reg d0;endelse po_data_regpo_data; end// cnt always (posedge clk) begin if(rst1b1) begincnt d0;end else if (cnt_flag1b1 cntCNT_END) begincnt d0;endelse if (cnt_flag1b1) begincntcnt1b1;endend//cnt_flag always (posedge clk) begin if(rst1b1) begincnt_flag d0;end else if (po_flag1b1) begincnt_flagd1;endelse if (bit_cntd8 bit_flag1b1) begincnt_flagd0;end end// bit_flag always (posedge clk) begin if(rst1b1) beginbit_flag d0;end else if (cntCNT_END-1 cnt_flag1b1) beginbit_flagd1;endelse bit_flagd0; end// bit_cnt always (posedge clk) begin if(rst1b1) beginbit_cnt d0;end else if (bit_flag1b1 bit_cntd8) beginbit_cntd0;endelse if (bit_flag1b1) beginbit_cntbit_cnt1b1;end end // tx always (posedge clk) begin if(rst1b1) begintx d1;end else if (po_flag1b1) begintxd0;endelse if (bit_flag1b1 bit_cntd8) begintxd1;endelse if (bit_flag1b1) begintxpo_data_reg[bit_cnt];end end endmodule tb: timescale 1ns / 1ps module tb_rx();reg clk;reg rst;reg rx;wire tx;initial beginclk0;rst1;#100rst0;endinitial beginrx1;//空闲状态#100gen_rx();end//这里模拟发送20次数据每次发送8个0~1的任意数发送前rx拉低表示起始位 //由于9600波特率需要计数5207次为了仿真方便假设只需要计数100次。task gen_rx;integer i;integer j;begin for (j 0; j 20; jj1) beginrx0;for ( i 0; i 8; ii1) begin repeat(100) begin //每隔100周期发送1bit数据(posedge clk); endrx{$random};endrx1; //每发送完一帧数据后rx恢复空闲状态维持100个周期(方便tx端完整传输完一帧数据)后继续发送数据直到发够20帧数据。repeat(1000) begin(posedge clk);end endendendtask always #5 clk~clk;top_uart inst_top_uart (.clk(clk), .rst(rst), .rx(rx), .tx(tx));endmodule 1.3.4 顶层设计 module top_uart(input wire clk,input wire rst,input wire rx,output wire tx);wire [7:0] po_data; wire po_flag;uart_rx inst_uart_rx (.clk (clk),.rst (rst),.rx (rx),.po_data (po_data),.po_flag (po_flag));uart_tx inst_uart_tx (.clk (clk),.rst (rst),.po_data (po_data),.po_flag (po_flag),.tx (tx));endmodule1.3.3 仿真 可以看到rx和tx波形一致则能实现传输要求。
http://www.zqtcl.cn/news/74842/

相关文章:

  • 做网站怎样申请域名字体logo设计在线生成
  • 什么网站赚的钱最多国外网站谷歌seo推广
  • 域名访问网站 过程wordpress修改文件上传路径
  • 怎么查询网站是否被降权做网站多钱
  • 绿色系的网站网站后台改版面
  • 宿州网站建设推广国外网站怎么做推广
  • 承德网站建设公司推广型网站开发网址
  • 电子商务网站开发案例网站备案需要那些资料
  • 如何兼职做网站电脑系统重装后没有wordpress
  • 湖州网站建设培训云南省植保植检站网址
  • wordpress回收站嘉兴品牌网站建设
  • 站点创建wordpress建企业展示
  • 优秀国外设计网站全国做网站的大公司有哪些
  • 福田的网站建设公司wordpress 4.9 漏洞
  • 自建站多少钱江阴做网站优化
  • 怎么在国外网站开发客户如何做地图的ppt模板下载网站
  • 镇江市建设招标网官方网站网络企业做网站
  • 潍坊网站建设服务跟python做网站用什么框架
  • 高唐网站wordpress上传插件
  • 哈尔滨餐饮加盟网站建设做网站价钱
  • 医程通 网站做的太wordpress计费查询
  • 建设工程质量安全监督站官方网站城市宣传网站建设方案
  • 哪家网络公司做网站家装室内设计培训班哪里
  • 商户网站唯一订单号seo服务 文库
  • 晋江网站设计wordpress上传自己写的网页
  • 大型医院设计网站建设兰州官网seo诊断
  • 企业网站托管哪家好软件后端开发
  • jsp做的网站可以用的公司变更名称和经营范围
  • 怎么做律师事务所的网站南沙网站建设公司哪家好
  • 网站域名注册商标有什么好处仓储管理系统软件排名