This is pretty cool. So, since NAND chips (74LS00) are much cheeper to buy than the other logic gates, it is convenient to know how to make other gates with only NAND gates. As my teacher said in class "If I had to choose which chip to take with me onto a deserted island, I'd take the NAND chip" :)
As mentioned in my previous post titled "Logic Gates" a NAND gate is a combination of a NOT gate and an AND gate (NOT + AND = NAND).
NAND Gate
You can make any other logic gate with just NAND gates.
NOT Gate
A NOT gate is also known as an inverter gate. It inverts the values sent in. Since a NAND gate is a NOT gate and an AND Gate, by making A = B, we create a NOT gate.
AND Gate
To create an AND Gate using only NAND Gates, we must combine a NAND Gate and a NOT Gate made with NAND Gates (above). This way we can cancel out the NOT part of the NAND gate.
OR Gate
An or gate returns 1 if any of the inputs is 1, a NAND gate will return 1 if one or more of the inputs is 0. To convert a NAND gate to an OR gate, we must invert the inputs.
Its kind of magical! Click here for more gates, information and to see where I got the images above!