CAVEATS: psuedo-random ("randomish") is absolutely not random. your high level problem requires uncorrelated data and pseudo-random numbers will fail in a way that is not apparent until someone does a statistical analysis. But we'll just assume you're doing a proof-of-concept. I also have no idea if this is even valid, to take 6 independent(?) bit streams and parallel them and try a von Neumann extraction, but IANAS (i am not a statistician) so please consult with a professional :-)

anyhow skipping the why's and wherefore's .... here's what I THINK you're trying to accomplish: you want to take two clocked sequences of 6-bit parallel inputs as numbers, compare the bit positions of each, keep all bits from the first sequence that are different from the corresponding bit positions of the second.

the method i would use is to XOR the two sequences, then AND the XOR'ed result with the first sequence, with the trick of distinguishing between discarded bits and valid zero bits. Going on that, here's some code i am going to type out on the fly that i will not compile or test, might not work, but you hopefully get the idea

int function_debias (int seq0, int seq1, int *result)

{

int seqX = seq0 ^ seq1; // intermediate XOR value

int numBits = 0; // count of valid (non-discarded bits)

int i; // bit index

*result = 0 // pointer to result will accumulate

for (i = 0; i < 6; i++)

{

if ((seqX >> i) % 2) // test for valid bits

{

// get valid bit from seq0 then accumulate into result at the

// next power-of-2 place. Note, it may be zero, and not

// change the result, so total "numBits" will be important to save

// note that numBits is post-incremented in the expression.

*result += (((seq0 >> i) & 1) * 2**numBits++);

}

}

return numBits;

}

so, the "result" iss passed back as an argument, the calling function must pass a pointer to the variable by reference. (i.e., use an ampersand (&) in front of the variable in the caller.)

the function itself returns as an integer the number of valid bits of the result. this will be key to interpreting the result that is passed back. for instance if the function returns the value 3, and the result is zero (0), then you know that there are three bits : 000. likewise if it returns the value 6 and the result is 17, then you know there are six bits: 010001

of course, there may be typos, or maybe i'm just an idiot and the whole thing is wrong, i'm merely sitting here with my coffee and typing in a forum. good luck :-)