performance.v

来自「用verilog编写的程序,用来计算误码率的,可以在编码和解码过程中用的到的!」· Verilog 代码 · 共 27 行

V
27
字号
module performance(InfoSeq,result,BER,clk,rst);  /*清算误码个数*/
input InfoSeq,result,clk,rst;
output [7:0]BER;
reg [7:0]BER;
reg [3:0]count,i;    /*设定两个计数器,一个用来记循环次数,一个记误码个数*/
always@(posedge clk or posedge rst)
if(rst)
begin
 count<=0;
 i<=0;
end
else
begin
if(i==12)
   begin
     i<=1;
     if(InfoSeq!=result)count<=1;
     else count<=0;
     BER<=count;
   end
 else
   begin
   if(InfoSeq!=result)count<=count+1;
   i<=i+1;
   end
end
endmodule

⌨️ 快捷键说明

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