⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xcv.v

📁 verilog编写的状态机检测00100序列. 实现 input:...011000010010000... output:...000000000100100... 并且 用测试模块来验证状
💻 V
字号:
module xcv(x,z,clk,rst,state);  input x,clk,rst; output z; output[2:0] state; reg[2:0] state; wire z; parameter IDIE='d0,A='d1,B='d2,C='d3,D='d4,E='d5; assign z=(state==E&&x==0)? 1:0; always @(posedge clk)  if(!rst)   begin       state<=IDIE;   end  else   case(state)   IDIE:if(x==0)        begin        state<=A;        end    A:  if(x==0)        begin        state<=B;        end        else state<=IDIE;    B:  if(x==1)        begin            state<=C;        end        else state<=B;    C:  if(x==0)        begin            state<=D;        end        else state<=IDIE;    D:  if(x==0)        begin          state<=E;         end          else state<=A;     E:  if(x==0)        begin          state<=B;         end        else state<=IDIE;             default:state<=IDIE;endcaseendmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -