Writing an expression using only NAND, OR, XNOR

瘦欲@ 提交于 2020-02-23 07:34:13

问题


I have a 2-1 mux and I'm trying to write z = s'd0 + sd1 using only NAND, XNOR, and OR gates (not necessarily all of them).

I tried simplifying it and what I ended up with is z = NAND(NAND(s', d0), NAND(s, d1)), but I can't use NOT ('), so is there a way to write NAND(s', d0) without the NOT?


回答1:


You can build NOT from NAND:

NAND(X,X) == NOT(X)




回答2:


NAND gate is an universal gate; you can use it to make any other gate.

s' = nand(s,s)




回答3:


Initial solution

Full version of the solution proposed by others is (A NAND S) NAND (B NAND (S NAND S)) .

By the way, NOT X could also be expressed as X NAND 1, not only as X NAND X.

Advanced solution

(S OR (A XNOR B)) XNOR A

The latter solution is definitely more interesting:

  • It uses a fewer number of gates (though of two different types).
  • It uses not functionally complete set of gates (thereby is less trivial).

How to find the latter solution?

  1. Construct the Zhegalkin polynomial of 2:1 mux and simplify it slightly: (S AND (A XOR B)) XOR B.
  2. Note that the boolean function dual to 2:1 mux is also 2:1 mux, but for swapped input signals.
  3. Now "dualize" the polynomial (replace AND and XOR with OR and XNOR respectively) and swap A with B.


来源:https://stackoverflow.com/questions/59410748/writing-an-expression-using-only-nand-or-xnor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!