📄 cheinsearch.v
字号:
//--------------------------------------------
// Chein search block
//--------------------------------------------
module CheinSearch(clk, init,
Lmd0, Lmd1, Lmd2, Lmd3, Lmd4, Lmd5, Lmd6, Lmd7, Lmd8,
Err_Indicator);
parameter t = 8, // t--The total number of errors that can be corrected
N = 204, // N--Codeword length
m = 8, // m--Extension of GF(2)
Delay_Length = 18;
input clk, init;
input [m-1:0] Lmd0, Lmd1, Lmd2, Lmd3, Lmd4, Lmd5, Lmd6, Lmd7, Lmd8;
output Err_Indicator;
reg Err_Indicator;
reg [m-1:0] LmdIR[t:0]; // Iterative register
wire [m-1:0] LmdIR_a[t:1], a52Lmd[t:1];
always @(posedge clk)begin:CHEIN_SEARCH
integer j;
if(init)begin
for(j=1; j<=t; j=j+1)
LmdIR[j] <= a52Lmd[j];
LmdIR[0] <= Lmd0;
end
else begin
for(j=1; j<=t; j=j+1)
LmdIR[j] <= LmdIR_a[j];
LmdIR[0] <= LmdIR[0];
end
end
ff_const_mul LmdIR_x_a1(.din(LmdIR[1]), .dout(LmdIR_a[1])); // LmdIR1*a^1
ff_const_mul LmdIR_x_a2(.din(LmdIR[2]), .dout(LmdIR_a[2])); // LmdIR2*a^2
ff_const_mul LmdIR_x_a3(.din(LmdIR[3]), .dout(LmdIR_a[3])); // LmdIR3*a^3
ff_const_mul LmdIR_x_a4(.din(LmdIR[4]), .dout(LmdIR_a[4])); // LmdIR4*a^4
ff_const_mul LmdIR_x_a5(.din(LmdIR[5]), .dout(LmdIR_a[5])); // LmdIR5*a^5
ff_const_mul LmdIR_x_a6(.din(LmdIR[6]), .dout(LmdIR_a[6])); // LmdIR6*a^6
ff_const_mul LmdIR_x_a7(.din(LmdIR[7]), .dout(LmdIR_a[7])); // LmdIR7*a^7
ff_const_mul LmdIR_x_a8(.din(LmdIR[8]), .dout(LmdIR_a[8])); // LmdIR8*a^8
defparam LmdIR_x_a1.CONST = 15'h6202, LmdIR_x_a2.CONST = 15'h7101,
LmdIR_x_a3.CONST = 15'h3880, LmdIR_x_a4.CONST = 15'h1C40,
LmdIR_x_a5.CONST = 15'h0E20, LmdIR_x_a6.CONST = 15'h4710,
LmdIR_x_a7.CONST = 15'h2388, LmdIR_x_a8.CONST = 15'h11C4;
ff_const_mul a52_x_Lmd1(.din(Lmd1), .dout(a52Lmd[1])); // a^52*Λ1
ff_const_mul a52_x_Lmd2(.din(Lmd2), .dout(a52Lmd[2])); // a^104*Λ2
ff_const_mul a52_x_Lmd3(.din(Lmd3), .dout(a52Lmd[3])); // a^156*Λ3
ff_const_mul a52_x_Lmd4(.din(Lmd4), .dout(a52Lmd[4])); // a^208*Λ4
ff_const_mul a52_x_Lmd5(.din(Lmd5), .dout(a52Lmd[5])); // a^360*Λ5
ff_const_mul a52_x_Lmd6(.din(Lmd6), .dout(a52Lmd[6])); // a^412*Λ6
ff_const_mul a52_x_Lmd7(.din(Lmd7), .dout(a52Lmd[7])); // a^464*Λ7
ff_const_mul a52_x_Lmd8(.din(Lmd8), .dout(a52Lmd[8])); // a^516*Λ8
defparam a52_x_Lmd1.CONST = 15'h6D41, a52_x_Lmd2.CONST = 15'h0D84,
a52_x_Lmd3.CONST = 15'h1BB9, a52_x_Lmd4.CONST = 15'h1F55,
a52_x_Lmd5.CONST = 15'h0E20, a52_x_Lmd6.CONST = 15'h6B6A,
a52_x_Lmd7.CONST = 15'h3C6C, a52_x_Lmd8.CONST = 15'h3CDD;
reg Err_Delay[Delay_Length:0];
always @(posedge clk)begin:ERROR_DELAY
integer j;
Err_Delay[0] <= ((LmdIR[0]^LmdIR[1])^(LmdIR[2]^LmdIR[3])
^(LmdIR[4]^LmdIR[5])^(LmdIR[6]^LmdIR[7])^LmdIR[8]) ? 0:1;
for(j=0; j<Delay_Length; j=j+1)
Err_Delay[j+1] <= Err_Delay[j];
Err_Indicator <= Err_Delay[Delay_Length];
end
endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -