在图像中,上面的电路是产品的总和
=(B‘+D’) (A+D) (A+C)
而下图是我尝试使用NAND而不是只使用gates。然而,我的感官告诉我,我做错了。请帮帮我!

发布于 2016-10-08 00:02:48
您可以将所有AND门替换为NAND门,然后取消结果。我可以看到您否定了输入,这是错误的,因为:
(ab)' != a'b'例如,考虑信号(a,b) = (1,0)。如果对它们求反并计算输出,则得到0。如果先计算输出,然后取反输出,则得到1。
关于OR门:
a + b + c -> ((a + b + c)')' -> (a'b'c')'所以OR门是与非门,所有的信号都是否定的。
发布于 2016-10-08 01:06:49
第一个电路实际实现了
AD + AC + B'D' http://latex.codecogs.com/gif.download?AD%20+%20AC%20+%20%5Cbar%7BB%7D%5Cbar%7BD%7D
这就是这个电路:

使用De Morgan's Laws,这相当于
((AD)'(AC)'(B'D')')' http://latex.codecogs.com/gif.download?%5Coverline%7B%5Coverline%7BAD%7D%5Ccdot%5Coverline%7BAC%7D%5Ccdot%5Coverline%7B%5Cbar%7BB%7D%5Cbar%7BD%7D%7D%7D
这就是这个电路:

此Python程序可用于比较电路:
import itertools
# Create all the possible input combinations
x = (True, False)
comb = set(itertools.product(x, x, x, x))
# AD + AC + B'D'
def c1(a, b, c, d):
return ((a and d) or (a and c) or ((not b) and (not d)))
# ((AD)'(AC)'(B'D')')'
def c2(a, b, c, d):
return not ((not (a and d)) and (not (a and c)) and (not ((not b) and (not d))))
# For each input combination, verify that the results are the same
for x in comb:
r1 = c1(*x)
r2 = c2(*x)
if r1 != r2:
print "Error: Input %s produced %s != %s" % (x, r1, r2)https://stackoverflow.com/questions/39921424
复制相似问题