Hi,

I am working LDPC encoding and decoding for hardware implementation.Through Vivado HLS, I need to transform a parity-check matrix H (that only consists of ones and zeros) from a non-standard to a standard form through C/C++ programming language. Here below you may find samples of non-standard parity check matrices in which Gauss-Jordan elimination (over GF(2)) can be applied.

Initially, i am trying encoding part via C/C++ programming logic. please help me if you do have any idea about LDPC. I would need a method that works out with matrices of any dimension.

this is, express it as

Hsys = [I| P]

This is my H matrix

H=[1 1 0 0 1 0

1 0 0 1 0 1

1 1 1 0 0 1];

Expected Systematic H matrix

Hsys=[1 0 0 1 0 1

0 1 0 1 1 1

0 0 1 0 1 1];

Code:

{
// encoding
int i,j;
int message;
int H_Matrix[3][6]={{1,1,0,0,1,0},{1,0,0,1,0,1},{1,1,1,0,0,1}};
int temp[3][6]={0};
for(j=0;j<6;j++)
{
temp[1][j]=(H_Matrix[1][j]^H_Matrix[0][j]);
H_Matrix[1][j] = temp[1][j];
temp[2][j]=(H_Matrix[2][j]^H_Matrix[0][j]);
H_Matrix[2][j] = temp[2][j];
temp[0][j]=(H_Matrix[0][j]^H_Matrix[1][j]);
H_Matrix[0][j] = temp[0][j];
}
for(i=0;i<3;i++)
{
for(j=0;j<6;j++)
{
printf("%d\t ",H_Matrix[i][j]);
}
printf("\n");
}
}