pwolf wrote
i cant help but want to learn this before moving on, but i seem to be struggling to get my head around it.
i dont know how to simplify this
(not a and b) or (a and not b)
but i know there is a simpler circuit because the xor gate i made uses only four nand gates, and this circuit costs 9 nand gates. can you show me how to simplify this or point me in the direction of some good resources to learn ?
You can use De Morgan's law,
x + y = ~(~x ~y), to simplify this as follows:
(~
a b) + (
a ~
b)
~( ~(~
a b) ~(
a ~
b) )
Notice that this is now 2 Nands terms that are Nanded together.
Use Nand gates for ~
a and ~
b, and this gets you to a 5 Nand solution for Xor.
The classic 4 Nand Xor circuit is rather difficult to formally derive using techniques that I know. You can use Boolean algebra to prove that it is the same as your Xor, but I leave that as an excercise for you.
--Mark