简化布尔表达式 F=(Not B and Not C) 或 (B and Not C) 或 (Not A and C)

Simplify the boolean expression F=(Not B and Not C) or (B and Not C) or (Not A and C)

提问人:user14421841 提问时间:10/10/2020 更新时间:10/28/2022 访问量:2158

问:

我需要简化这个表达式。我知道答案一定是(不是 A 或不是 C),但我一直得到 C 或(不是 A 和 C)

数学 布尔逻辑

评论

0赞 user2864740 10/10/2020
这是使用真值表图(每个 A、B、C、F 的列;8 行)的好时机。它显示了什么?它可用于减少和显示等价性,以验证预期/假定的答案。另外,确保展示工作..
0赞 500 - Internal Server Error 10/10/2020
给出的答案是正确的——你如何得出你的答案?

答:

1赞 B2B 10/10/2020 #1

在 Lua 中尝试过这个:

local a = false
local b = true
local c = true

local f = (not b and not c) or (b and not c) or (not a and c)
local f_= not c or (not a and c)

print(f, f_)

输出:false,false
我还尝试了所有三个变量的所有可能性,并且“f”和“f_”都保持不变。

F = (Not B and Not C) or (B and Not C) or (Not A and C)
-> (Not B and Not C) or (B and Not C) == Not C
F  = Not C or (Not A and C)
1赞 RFairey 10/10/2020 #2

我喜欢使用 Karnaugh 映射进行布尔简化:https://en.wikipedia.org/wiki/Karnaugh_map

对于您的示例,我们构建了一个 2D 真值表:

Empty karnaugh map

然后填写你的问题中的术语,它们都得到'或'在一起:

Terms in karnaugh map

然后,您可以找到覆盖所需零件的最小数量的正方形/矩形。正方形和矩形的幂必须以 2 为维度,因此 2x2 可以,1x4 等,但不能使用 3x2 例如。这些被称为“minterms”,正方形越大,它们表示的布尔表达式就越简单。在下面的示例中,“not C”的最小项从地图的一端到另一端,但仍被视为 2x2 正方形。

Minterms

您也可以通过用 'maxterms' 覆盖未使用的空间来做到这一点,然后再次反转它以获得原始表达式:

Maxterms

根据德摩根定律,“不是 A 或不是 C”和“不是(A 和 C)”的结果等价。(https://en.wikipedia.org/wiki/De_Morgan%27s_laws)

评论

1赞 Andrew 2/21/2022
这似乎是不正确的——Karnaugh 地图应该使用灰色代码序列 (00 01 11 10);BC 的序列 (00 01 10 11 ) 不是灰色代码
0赞 RFairey 10/28/2022
纠正。迟到总比不到好!
0赞 Light 10/19/2020 #3
(Not B and Not C) or (B and Not C) or (Not A and C)
  |
  | Distributive Law
  V
((Not B or B) and Not C) or (Not A and C)
  |
  | Complement Law
  V
Not C or (Not A and C)
  |
  | Absorption Law
  V
Not C or Not A

评论

0赞 Andrew 10/29/2022
一些定律被遗漏了,但结果是正确的