Associate
- Joined
- 14 Jan 2003
- Posts
- 200
- Location
- NW
Hi all, ive got the following code to generate a binary sequence for a given input size, but what i cant fathom is how to exor each of the outputs i.e 0^0 = 0, 0^1 = 1, 1^1 =0 etc and put them in an array:
maybe im just being simple any ideas?
int i, n, v, dig[10];
n = 2;
v = (1 << n);
for (i=0; i < v; i++)
{
for (dig=1 << (n-1); dig; dig >>= 1)
printf (" %d", i & dig ? 1 : 0);
printf ("\n");
}
}
maybe im just being simple any ideas?