Here is a proof that for 2-bit bitwise operations you cannot describe &
with
just +
-
and *
(check this, just came up with it now, so, who knows):
The question is, can we find a polynomial
x & y == P(x, y)
where
P(x, y) = a0_0 + a1_0*x + a0_1*y + a2_0*x^ + ...
Here's what it would have to look like:
0 1 2 3
--------
0| 0 0 0 0
1| 0 1 0 1
2| 0 0 2 2
3| 0 1 2 3
First, clearly a0_0 == 0
. Next you can see that if P
is
rewritten:
|------- Q(x, y) --------|
P(x, y) = xy*R(x,y) + a1_0*x + a0_1*y + ...
And y
is held 0, while x
varies over 0, 1, 2, 3; then Q(x, y) must be 0 for
each of those values. Likewise if x
is held 0 and y
varied. So Q(x, y)
may be set to 0 without loss of generality.
But now, since P(2, 2) = 2
, yet 2 * 2 == 0
, the polynomial P
cannot
exist.
And, I think this would generalize to more bits, too.
So the answer is, if you're looking for just +
, *
and -
, no you can't do
it.