我计算的卡诺图,但我的代码是不正确的。我得到错误:“D ='1'的错误C ='0'B ='1'A ='0'预计O ='1',收到O ='0'”。
我在哪里犯错?
library IEEE;
use IEEE.std_logic_1164.all;
entity truth_table is port( A,B,C,D : in std_logic;
O : out std_logic);
end truth_table;
architecture behavior of truth_table isbegin
O <= (((not A) and C and D) or ((not D) and B and C) or (A and (not C) and D) or (A and C and (not B)));
end behavior;
您应该避免将代码发布为链接图像。代码很好地显示为问题中的文本。 – Tome
如果您的代码没有复制真值表,那是因为您在K-map中发生了错误。你没有显示这个,所以我们不能说出你做错了什么!就我个人而言,我发现这一个更容易处理反向输出,然后在最后反转整个方程。这给了4个产品总和而不是6个。 –
我的错误,反转并不能减少产品的总和,但是如果这对于应用来说非常重要的话,它确实使用较少的门控输入。 –