组合逻辑设计问题,断言输入意味着什么
问题如下:考虑一个 4 输入布尔函数,每当其两个输入被断言时,该函数就被断言,构建其真值表,然后构建问题的其他部分。
我不需要答案,我想自己解决这个问题,我只想知道断言的含义以及如何从真值表开始。任何帮助表示赞赏。
The question reads: consider a 4-input boolean function that is asserted whenever exactly two of its inputs are asserted, construct its truth table, and then other parts for the question.
I don't want an answer i would like to solve this myself, i just want to know the meaning of assert and how to start with the truth table. Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为在这种情况下它意味着 true (所以你有 4 个布尔值,并且当恰好 2 个为 true 时你必须生成 true )。你的教科书应该更能说明这个问题。通常你断言某件事是真的。
编辑。这是
联合范式
的 3 变量示例。只要其中两个为假,我就认为该函数为真。请注意如何通过水平读取变量然后垂直读取变量来获得数字的二进制表示形式。理论上,您将每条线视为一个单独的方程。如果变量值为 0,则将其写为
v
,如果变量值为 1,则将其写为~v
。一行上的变量之间使用逻辑或 (\/
),不同行之间使用逻辑与 (^
)。你只和在一起的线是假的。因此,考虑到第 1 列 -
p
、第 2 列 -q
和第 3 列 -r
,第一行是p \/ q \/ r
结果为 false,因此将其添加到最终公式中,第二个p \/ q \/ ~r
但结果为 true,因此不添加到公式中,等等。当且仅当该行的公式为假时,您才需要将这些行和
(^
)放在一起。因此,在上面,您可以通过将 L1、L4、L6、L7、L8 行与在一起来获得 CNF。一旦你有了这个巨大的公式,你就可以努力让它变得更小。我已经很久没有这样做了,我不太记得为什么会这样的细节,但我记得在某个时候研究过证明。
I think that in this context it means true (so you have 4 booleans and you must produce true when exactly 2 are true). Your textbook should make more sense of the issue. Usually you assert that something is true.
Edit. Here's a 3 variable example for
Conjunctive normal form
. I'm considering the function true whenever two of them are false. Notice how by reading the variables horizontally and then vertically you get the binary representation of numbers.The theory is that you treat each line as a separate equation. If the variable value is 0, you write it as
v
, and if it is 1 you write it as~v
. You use the logical or (\/
) between variables on one line, and logican and (^
) between different lines. You only and together lines which are false.So, considering column 1 -
p
, column 2 -q
and column 3 -r
, the first line isp \/ q \/ r
and the result is false, so it is added to the final formula, the second onep \/ q \/ ~r
but true so not added to the formula etc. You need toand
(^
) the lines together if and only if the formula for the line is false. So above, you would get the CNF by and-ing together lines L1, L4, L6, L7, L8. Once you have that gigantic formula, you can work on making it smaller.It's been so long since I've done this I can't really remember the details as to why it is like this but I remember studying the proof at some point.
问题的另一半是真值表。我会帮忙开始...
The other half of the question is the truth table. I'll help start that...