简体   繁体   中英

Constructing logic gates from only AND, OR and NOT gates

I am doing some revision for my exams and one of the questions that frequently occurs is to construct logic gates using only the functions AND, OR and NOT. The most commonly occurring ones are NAND, NOR, XOR, XNOR and the equivalence function.

Am I right in saying that NAND is simply an AND gate with a NOT gate after it? And the same is true for NOR? That seems all too simple!

The next question is: "Draw another circuit realization of the NOR function but now you may only use NAND gets.". I remember this, but I can't explain it.

So, we have NOR, which is NOT(A+B). Applying De Morgans to this, I get NOT(A). NOT(B)...Ooh, and then we can't use AND, so AND = a NAND and a NAND...so we get NOT( NOT ( NOT(A). NOT(B)))? Is this a correct reasoning? How would you then get any other function in NAND only form?

My other question is for the XOR, XNOR and Equivalence functions. How do you work these out using only AND, OR and NOT gates?

Also, in relation to XOR and Equivalence function, how would you answer this question - Give a formula that shows their relation, ie a formula that shows how one of these two functions can be expressed in terms of the other. ?

You are correct about NAND and NOR - NAND(A,B) = (A*B)' , NOR(A,B) = (A+B)' .
To implement NOR with NAND, you are correct in using De-Morgan: NOR(A,B) = (A+B)' = A'*B' . As for the rest: A' = NAND(A,A) , B' = NAND(B,B) , AND(X,Y) = (NAND(X,Y))' , and so we get: NAND(NAND(NAND(A,A),NAND(B,B)),NAND(NAND(A,A),NAND(B,B))) .
XOR is like unequivalence (it gives 1 if A isn't equal to B, and 0 if they are equal). Thus, XNOR is like equivalence.
Furthermore: XOR(A,B) = A*B'+A'*B , XNOR(A,B) = A*B+A'*B'

Allow me to suggest reading about complete operator sets: eg here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM