Full adder convert sum of products to XOR

419 Views Asked by At

I have this expression (which represents $C_{out}$ of a full adder):

$$a \neg b \neg c + \neg a b \neg c + \neg a \neg b c + abc$$

which is generated by some program I wrote that converts a truth table into a list of expressions that represent each of the outputs. Ultimately, I have another program that takes these expressions and turns them into logical circuits.

Since the expressions are not simplified or reduced, the resulting circuits are often extremely inefficient. I'd thought I'd sit down and try to figure out the math myself first, and here's how I would reduce this expression, starting with factoring $a$ out:

$a(\neg b\neg c+bc) + \neg a b \neg c + \neg a \neg b c$

Then $\neg a$:

$a(\neg b\neg c+bc) + \neg a (b \neg c + \neg b c)$

I recognize that the terms inside parentheses are XNOR and XOR operations:

$a (b \odot c) + \neg a(b \oplus c)$

but now I don't really know the steps between the above expression and this one (which is the simplest form):

$a \oplus b \oplus c$

What am I missing? How would you get to the two XOR's from here?

1

There are 1 best solutions below

0
On BEST ANSWER

In general, $x \oplus y = x\neg y + \neg x y$

Now, you already recognized that:

$$a \neg b \neg c + \neg a b \neg c + \neg a \neg b c + abc = a (b \odot c) + \neg a(b \oplus c)$$

where $b \odot c$ is the XNOR ... i.e. $b \odot c = \neg (b \oplus c)$

So just use that:

$$a (b \odot c) + \neg a(b \oplus c) = a \neg(b \oplus c) + \neg a(b \oplus c) = a \oplus (b \oplus c)$$

And you can drop the parentheses, since the XOR is associative.

Note that it is easy to see that the output bit of a full adder is the XOR on the three inputs: the XOR is a $1$ iff an odd number of its arguments are a $1$ ... and that's exactly what we want for the output bit.