The Student Room Group

Hello: any computer science genii(good luck for a good answer)

Can someone please explain how NAND logic gates can form an AND gate?
AND is the same as NOT NAND (since the NAND gate is false if and only if both inputs are true, the NOT then converts this to true if and only if both inputs are true).

So form a NOT gate from a NAND gate and connect it in front of a NAND gate. Then the NAND gate will output FALSE if and only if both inputs are TRUE, other wise it will output TRUE. The NOT in front of it will then then reverse whatever was outputted by the NAND gate so that you get TRUE if and only if both inputs were TRUE, and FALSE otherwise, which is the equivalent to an AND gate.
Original post by Pronged Lily
AND is the same as NOT NAND (since the NAND gate is false if and only if both inputs are true, the NOT then converts this to true if and only if both inputs are true).

So form a NOT gate from a NAND gate and connect it in front of a NAND gate. Then the NAND gate will output FALSE if and only if both inputs are TRUE, other wise it will output TRUE. The NOT in front of it will then then reverse whatever was outputted by the NAND gate so that you get TRUE if and only if both inputs were TRUE, and FALSE otherwise, which is the equivalent to an AND gate.


Thanks; that really makes sense!

Spoiler

Original post by Jeeves CP
Thanks; that really makes sense!

Spoiler


A NAND gate outputs TRUE if and only if not both of the inputs are TRUE, it outputs TRUE if and only if at least one of its inputs is FALSE. Similarly, an OR gate outputs TRUE if and only if at least one of its inputs are TRUE.

Therefore if you reverse both inputs going into a NAND gate using NOT gates (formed from NAND gates), then if and only if at least one of the original inputs is TRUE, the NAND gate will receive at least one FALSE input. This is enough to ensure that not both of the inputs are TRUE, so that the NAND gate outputs TRUE, and acts like a single OR gate.

Quick Reply

Latest