组合逻辑设计问题,断言输入意味着什么

发布于 2024-08-18 03:20:34 字数 122 浏览 1 评论 0原文

问题如下:考虑一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

在巴黎塔顶看东京樱花 2024-08-25 03:20:34

我认为在这种情况下它意味着 true (所以你有 4 个布尔值,并且当恰好 2 个为 true 时你必须生成 true )。你的教科书应该更能说明这个问题。通常你断言某件事是真的。

编辑。这是联合范式的 3 变量示例。只要其中两个为假,我就认为该函数为真。请注意如何通过水平读取变量然后垂直读取变量来获得数字的二进制表示形式。

     1   2    3   R      
L1   0   0    0   0
L2   0   0    1   1
L3   0   1    0   1
L4   0   1    1   0
L5   1   0    0   1
L6   1   0    1   0
L7   1   1    0   0
L8   1   1    1   0

理论上,您将每条线视为一个单独的方程。如果变量值为 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.

     1   2    3   R      
L1   0   0    0   0
L2   0   0    1   1
L3   0   1    0   1
L4   0   1    1   0
L5   1   0    0   1
L6   1   0    1   0
L7   1   1    0   0
L8   1   1    1   0

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 is p \/ q \/ r and the result is false, so it is added to the final formula, the second one p \/ q \/ ~r but true so not added to the formula etc. You need to and (^) 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.

開玄 2024-08-25 03:20:34

问题的另一半是真值表。我会帮忙开始...

1 2 3 4    output
F F F F    F
F F F T    F
F F T F    F
F F T T    T
F T F F    F
F T F T    T
. . .

The other half of the question is the truth table. I'll help start that...

1 2 3 4    output
F F F F    F
F F F T    F
F F T F    F
F F T T    T
F T F F    F
F T F T    T
. . .
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文