I am trying this program for my project work. For hardware implementation, i am compiling PRBS through buffer concept. Whether the following codes are logically right? For me its showing compilation error.
My goal in my project work is to get random bits 0`s and 1`s in a consecutive manner. Please help me.
Code:
int main(int bit, int *d)
{
unsigned lfsr = 0xCD;
int bit, i,j;
int buff1[50], buff2[50];
memycpy(buff1, d, 50*sizeof(int));
for ( i = 0; i < 50; i++)
{
bit = ((lfsr >> 0) ^ (lfsr >> 2) ^ (lfsr >> 3) ^ (lfsr >> 4) ) & 1;
buff1[i] = bit; //storing bit value in buff1
lfsr = (lfsr >> 1) | (bit << 7);
}
for (j = 0; j < 50; j++)
{
buff2[j] = buff1[50-j] ; // from buff1 storing bit value into buff2 for reading the bits in consecutive ways
}
memycpy(d, buff2, 50*sizeof(int));
}