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

有用建站宝盒做网站的吗哈尔滨网络优化推广公司

有用建站宝盒做网站的吗,哈尔滨网络优化推广公司,提高搜索引擎检索效果的方法,南京网站开发荐南京乐识文章目录 状态机基础知识VL25 输入序列连续的序列检测VL26 含有无关项的序列检测VL27 不重叠序列检测VL28 输入序列不连续的序列检测参考资料 状态机基础知识 VL25 输入序列连续的序列检测 timescale 1ns/1ns module sequence_detect(input clk,input rst_n,input a,output re… 文章目录 状态机基础知识VL25 输入序列连续的序列检测VL26 含有无关项的序列检测VL27 不重叠序列检测VL28 输入序列不连续的序列检测参考资料 状态机基础知识 VL25 输入序列连续的序列检测 timescale 1ns/1ns module sequence_detect(input clk,input rst_n,input a,output reg match);//这题就是普通的状态机需要注意的是// 当输入不能跳转到下一个状态时可以复用前面的序列// 这题是的Moore状态机输出只和当前状态有关//定义状态空间(状态参数、状态寄存器)parameter IDLE 0 ;parameter S0 1 ;parameter S1 2 ;parameter S2 3 ;parameter S3 4 ;parameter S4 5 ; parameter S5 6 ;parameter S6 7 ;parameter S7 8 ;reg [3:0] curr_state,next_state;// 1.打一拍更新现态always(posedge clk or negedge rst_n) beginif(~rst_n) begincurr_state IDLE;end else begincurr_state next_state;endend// 2.组合逻辑根据现态和输入生成次态always(*) begincase(curr_state)IDLE : next_state (a 0) ? S0 : IDLE ;S0 : next_state (a 1) ? S1 : S0 ;S1 : next_state (a 1) ? S2 : S0 ;S2 : next_state (a 1) ? S3 : S0 ;S3 : next_state (a 0) ? S4 : S0 ;S4 : next_state (a 0) ? S5 : S1 ;S5 : next_state (a 0) ? S6 : S1 ;S6 : next_state (a 1) ? S7 : S1 ;S7 : next_state (a 0) ? IDLE:S2 ;default: next_state IDLE;endcaseend// 3.Moore型FSM根据当前状态生成输出always(posedge clk or negedge rst_n) beginif(~rst_n) beginmatch 0;end else if(curr_state S7) beginmatch 1;end else beginmatch 0;endend endmoduleVL26 含有无关项的序列检测 两种方法 法一、用寄存器维护一个存储序列的寄存器 法二、用状态机来做 这里我用寄存器来做。 timescale 1ns/1ns module sequence_detect(input clk,input rst_n,input a,output reg match);reg [8:0] curr_seq;// 1.维护存储序列的寄存器always(posedge clk or negedge rst_n) beginif(~rst_n) begincurr_seq 9bxxx_xxx_xxx;end else begincurr_seq {curr_seq[7:0],a};endend// 2.判断序列是否模式匹配always(posedge clk or negedge rst_n) beginif(~rst_n) beginmatch 0;end else if(curr_seq[2:0] 3b110 curr_seq[8:6] 3b011) beginmatch 1;end else beginmatch 0;endend endmoduleVL27 不重叠序列检测 通过计数器进行分组序列检测每组判断一次 注意点 计数器计算到6时才进行判断在分组中一旦错误直接FAIL注意需要处理FAIL的状态跳转注意寄存器的初始值,要计数6个就1~6,初值为0 module sequence_detect(input clk,input rst_n,input data,output reg match,output reg not_match );//分组序列检测//注意点//计数器计算到6时才进行判断//在分组中一旦错误直接FAIL//注意需要处理FAIL的状态跳转//注意寄存器的初始值,要计数6个就1~6,初值为0// 定义状态空间和状态寄存器parameter IDLE 0 ,S1 1 ,S2 2 ,S3 3 ,S4 4 ,S5 5 ,S6 6 ,FAIL 7 ;reg [2:0] curr_state,next_state;reg [2:0] cnt;// 利用计数器进行分组always(posedge clk or negedge rst_n ) beginif(~rst_n) begincnt b0;end else beginif(cnt 3d6) cnt b1;else cnt cnt 1;endend// 1.次态更新现态always(posedge clk or negedge rst_n) beginif(~rst_n) begincurr_state IDLE;end else begincurr_state next_state;endend// 2.组合逻辑生成次态always(*) begincase(curr_state)IDLE : next_state (data0) ? S1 : FAIL ;S1 : next_state (data1) ? S2 : FAIL ;S2 : next_state (data1) ? S3 : FAIL ;S3 : next_state (data1) ? S4 : FAIL ;S4 : next_state (data0) ? S5 : FAIL ;S5 : next_state (data0) ? S6 : FAIL ;S6 : next_state (data0) ? S1 : FAIL ;FAIL : next_state (cnt 6 data 0) ? S1 : FAIL;default : next_state IDLE ; endcaseend // 3.根据现态生成输出波形match没有打拍直接组合逻辑输出always(*) beginif(~rst_n) beginmatch 0;not_match 0;end else if(cnt 6 ) beginif(curr_state S6) beginmatch 1;not_match 0;end else beginmatch 0;not_match 1;endendelse beginmatch 0;not_match 0;endend endmoduleVL28 输入序列不连续的序列检测 timescale 1ns/1ns module sequence_detect(input clk,input rst_n,input data,input data_valid,output reg match );//输入数据不连续的序列检测在状态跳转时需要考虑data_validparameter IDLE 5b00001;parameter S1 5b00010;parameter S2 5b00100;parameter S3 5b01000;parameter S4 5b10000;parameter STATE_WIDTH 5;reg [STATE_WIDTH - 1 : 0] cs;reg [STATE_WIDTH - 1 : 0] ns;always(posedge clk or negedge rst_n) beginif(!rst_n) begincs IDLE;endelse begincs ns;endendalways(*) begincase(cs)IDLE : beginif( data_valid ) beginns data 0 ? S1 : IDLE ; end else beginns cs;endendS1 : beginif( data_valid ) beginns data 1 ? S2 : S1;end else beginns cs;endendS2 : beginif( data_valid ) beginns data 1 ? S3 : S1;end else beginns cs;endendS3 : beginif( data_valid ) beginns IDLE;end else beginns cs;endendendcaseendalways(posedge clk or negedge rst_n) beginif(!rst_n) beginmatch 0;endelse beginif(cs S3 data 0 data_valid 1) beginmatch 1;endelse beginmatch 0;endendend endmodule参考资料 正点原子领航者配套PPT牛客网Verilog刷题
http://www.hkea.cn/news/14445536/

相关文章:

  • 建设银行怎么加入信用网站广州智能建站
  • 做视频怎么去除网站做网站怎么存放视频
  • 找外包公司做网站的好处和坏处广州定制网站建设公司
  • 网站建设线上线下双服务器有个找人做任务赚返佣的网站
  • 苏州优化网站排名服务器租用相关网站
  • 上市公司数据查询网站金湖网页设计多少钱
  • 有没有建筑学做区位分析的网站微购物网站建设
  • 图片网站建设网络营销策划方案ppt模板
  • 成都高新区制作网站安卓软件开发工程师
  • 国内著名网站建设公司图案设计网站大全
  • 做网站西美花街重庆聚百思网站开发
  • 做网站通常用的软件网站建设推广谷得网络
  • 杯子电子商务网站的建设wordpress多人博客
  • 做旅游宣传图的网站有哪些国外二级域名免费申请
  • 模板型网站建设安卓app下载平台
  • 网站备案 后期logo设计在线生成免费图片加文字
  • 网站开发员工结构企业采购平台排名
  • 指定网站建设前期规划方案企业网站建立教程
  • 简洁手机购物网站会员中心模板网站特效漂亮的网站
  • 网站制作怎么学六安网站自然排名优化价格
  • 平台网站建设方案模板创造与魔法官方网站做自己
  • 做家教用什么网站做58招聘网站工作人员的心得
  • 关于科技园区建设文章的网站用vs做购物网站
  • pc端与手机端网站开发的区别长沙招聘网站制作
  • 织梦cms视频网站建设中小网站公司做的推广怎么样
  • 别样网图片素材网站安徽建筑培训网
  • 网站系统管理功能自己怎么建个优惠网站
  • 建设网站的报告asp.net网站建设项目实战资料
  • 在线做数据图的网站有哪些问题推广深圳
  • 营销型网站建设-深圳信科网销网站建设流程图