Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] BCH Berlekamp- Massey algorithm code problem.

Status
Not open for further replies.

FreshNicky

Newbie level 1
Joined
Nov 11, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,297
Hey guys, actually I need your help. I got some Berlekamp-Massey algorithm C code. I have been trying to change 2t iteration to t iteration

That means the algorithm have to iterate as much as two times of error correction capability, but I need to reduce that about half of error

correction capability.

All I want to know is explanation about the code and the idea about the method how to reduce iteration number.

You can find C code below. Regard all.

-------------------------------------------------------------------------------------------------------------------------------------
int bm (syndrome, lambda);
int syndrome[2t]; //t is 4. all 't' is same is like this.
int lambda[t+1][2t+1];
{
int b[t+2][2t];
int gamma[2t+1];
int delta[2t+1] = {0};
int delta_pre;
int k[2t+1];
int lambda_temp1, lambda_temp2;
int step3_op;
int i, j;
lambda[0][0] = 1, b[0][0] = 1, k[0] = 0, gamma[0] = 1;

for( i = 0; i < 2t - 1; i++){
for(j = 0;j <= t ; j++) {
if((i-j) >= 0){
gmult(lambda[j], syndrome[i-j], &delta_pre);
gadd(delta, delta_pre, &delta);
}
}

for(j = 0; j <= t; j++){
gmult(gamma, lambda[j], &lambda_temp1);
if(j ==0) gmult(delta, 0, &lambda_temp2);
else gmult(delta, b[j-1], &lambda_temp2);
gadd(lambda_temp1, lambda_temp2, &lambda[j][i+1]);
}

step3_op = (delta !=0) && (k >=0);
gamma[i+1] = step3_op ? delta : gamma;
k[i+1] = step3_op? -(k+1) : (k+1);
b[0][i+1] = step3_op? lambda[0] : 0;
for(j = 1; j <= t ; j++){
b[j][i+1] = step3_op? lambda[j] : b[j-1];
}
}
 
Last edited:

I dont think you can reduce the iteration number. For nonbinary codes you need 2t iterations and for binary you need t iterations
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top