博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
逻辑符号xor_布尔代数真值表教程– XOR,NOR和逻辑符号介绍
阅读量:2526 次
发布时间:2019-05-11

本文共 9949 字,大约阅读时间需要 33 分钟。

逻辑符号xor

We all love computers. They can do so many amazing things. Within a couple of decades computers have completely revolutionized almost all the aspects of human life.

我们都喜欢计算机。 他们可以做很多令人惊奇的事情。 在几十年的时间里,计算机彻底改变了人类生活的几乎所有方面。

They can do tasks of varying degrees of sophistication, all by just flipping zeros and ones. It is remarkable to see how such a simple action can lead to so much complexity.

他们可以通过翻转零和一来完成各种复杂程度的任务。 令人惊讶的是,看到这样一个简单的动作如何导致如此多的复杂性。

But I'm sure you all know that such complexity cannot be achieved (practically) by just randomly flipping the numbers. There is indeed some reasoning behind it. There are rules that govern the way this should be done. In this article we will discuss those rules and we will see how they govern the way computers "think".

但是我敢肯定,大家都知道,仅通过随机翻转数字是无法(实际上)实现这种复杂性的。 确实有其背后的原因。 有一些规则控制该操作的方式。 在本文中,我们将讨论这些规则,并了解它们如何控制计算机的“思考”方式。

什么是布尔代数? (What is Boolean Algebra?)

The rules I mentioned above are described by a field of Mathematics called Boolean Algebra.

我上面提到的规则由称为布尔代数的数学领域描述。

In his 1854 book, British Mathematician George Boole proposed a systematic set of rules for manipulation of Truth Values. These rules gave a mathematical foundation for dealing with logical propositions. These sets of foundations led to the development of Boolean Algebra.

英国数学家乔治·布尔(George Boole)在其1854年的著作中提出了一套系统的规则,以操纵真值。 这些规则为处理逻辑命题提供了数学基础。 这些基础导致了布尔代数的发展。

To best understand Boolean Algebra, we first have to understand the similarities and differences between Boolean Algebra and other forms of Algebra.

为了最好地理解布尔代数,我们首先必须了解布尔代数和其他形式的代数之间的异同。

Algebra, in general, deals with the study of mathematical symbols and the operations that can be performed on these symbols.

一般来说,代数研究数学符号以及可以在这些符号上执行的运算。

These symbols do not have a meaning of their own. They represent some other quantity. It is this quantity that gives some value to these symbols and it is this quantity on which the operations are actually being performed.

这些符号没有自己的含义。 它们代表其他数量。 正是这些数量为这些符号赋予了一些价值,并且正是该数量实际执行了操作。

Boolean Algebra also deals with symbols and the rules that govern the operations on these symbols but the difference lies in what these symbols represent.

布尔代数还处理符号和控制这些符号上的运算的规则,但区别在于这些符号表示的内容

In case of ordinary Algebra, the symbols represent the Real numbers whereas in Boolean Algebra they represent the Truth values.

对于普通代数,符号表示实数,而在布尔代数中,符号表示真值。

The image below shows the entire set of Real numbers. The set of Real numbers includes Natural numbers(1, 2, 3, 4....), Whole numbers (all the Natural numbers and 0), Integers (.....-2, -1, 0, 1, 2, 3 ...) and so on. Ordinary Algebra deals with this entire set of numbers.

下图显示了整个实数集。 实数集包括自然数(1、2、3、4 ...),整数(所有自然数和0),整数(.....- 2,-1、0、1 2、3 ...)等。 普通代数处理这整套数字。

The Truth values, in comparison, consist of a set of only two values: False and True. Here, I would like to point out the fact that we can use any other symbol to represent these values.

相比之下,“真值”值仅由一组两个值组成:“假”和“真”。 在这里,我想指出一个事实,我们可以使用任何其他符号来表示这些值。

For example in Computer Science we mostly represent these values using 0 and 1. 0 is used for False and 1 for True.

例如,在计算机科学中,我们通常使用0和1表示这些值。0表示False,1表示True。

You can also do it in more fancy ways by representing truth values with some other symbols such as Cats and Dogs or Bananas and Oranges.

您还可以通过用其他一些符号(如猫和狗或香蕉和橘子)表示真值,以更花哨的方式做到这一点。

The point here is that the internal meaning of these symbols will remain the same irrespective of the symbol you use. But make sure that you don't change the symbols while performing the operations.

这里的要点是,无论您使用什么符号,这些符号的内部含义都将保持不变。 但是请确保在执行操作时不要更改符号。

Now the question is that if (True and False), (0 and 1) are just the representations, then what is it that they are trying to represent?

现在的问题是,如果(True和False),(0和1)仅是表示形式,那么它们试图表示什么?

The underlying meaning behind truth values comes from field of Logic where truth values are used to tell if a proposition is "True" or "False". Here the truth values represent the relation of a proposition to truth, that is, whether  the proposition is true or false.

真值背后的潜在含义来自逻辑领域,其中,真值用于判断命题是“真”还是“假”。 在这里,真值表示命题与真理关系,即命题是对还是错。

A proposition is just a statement like "All cats are cute."

命题只是“所有的猫都很可爱”这样的说法。

If the above proposition is true then we assign it the truth value of "True" or "1" otherwise we assign it "False" or "0".

如果上述命题为真,则将其真值指定为“ True”或“ 1”,否则将其赋值为“ False”或“ 0”。

In Digital Electronics, truth values are used to represent the "On" and "Off" states of electronic circuits. We will discuss more about that later in this article.

在数字电子产品中,真值用于表示电子电路的“开”和“关”状态。 我们将在本文后面详细讨论。

布尔运算和真值表 (Boolean Operations and Truth Tables)

Just like Ordinary Algebra, Boolean Algebra also has operations which can be applied on the values to get some results. Although these operations are not similar to ones in ordinary algebra because, as we discussed earlier, Boolean algebra works on Truth values rather than Real Numbers.

与普通代数一样,布尔代数也具有可应用于这些值的运算,以得到一些结果。 尽管这些运算与普通代数中的运算不同,这是因为如前所述,布尔代数适​​用于真值而不是实数。

布尔代数具有三个基本运算。 (Boolean Algebra has three basic operations.)

OR: Also known as Disjunction. This operation is performed on two Boolean variables. The output of the OR operation will be 0 when both of the operands are 0, otherwise it will be 1.

:也称为析取 。 此操作在两个布尔变量上执行。 当两个操作数都为0时,OR运算的输出将为0,否则为1。

To get a clearer picture of what this operation does we can visualize it with the help of a Truth Table below.

为了更清楚地了解此操作的内容,我们可以在下面的真值表的帮助下将其可视化。

Truth tables give us an insightful representation of what the Boolean operations do and they also act as a handy tool for performing Boolean operations.		OR OperationVariable-1	Variable-2	Output  0		0		0  0		1		1  1		0		1  1		1		1

AND: Also known as Conjunction. This operation is performed on two Boolean variables. The output of AND operations will be 1 when both operands are 1, otherwise it will be 0. The truth table representation is as follows.

AND :也称为Conjunction 。 此操作在两个布尔变量上执行。 当两个操作数均为1时,AND运算的输出将为1,否则将为0。真值表表示如下。

AND OperationVariable-1	Variable-2	Output  0		0		0  0		1		0  1		0		0  1		1		1

NOT: Also known as Negation. This operation is performed only on one variable. If the value of the variable is 1 then this operation simply converts it into 0 and if the value of the variable is 0, then it converts it into 1.

:也称为否定 。 仅对一个变量执行此操作。 如果变量的值为1,则此操作将其简单地转换为0,如果变量的值为0,则将其转换为1。

Not OperationVariable-1	Output  0		1	  1		0

布尔代数和数字电路 (Boolean Algebra and Digital Circuits)

After its initial development, Boolean Algebra, for a very long time, remained one of those concepts in Mathematics which did not have any significant practical applications.

在最初的发展之后,布尔代数在很长的一段时间内一直是数学中没有任何实际应用的概念之一。

In the 1930s, Claude Shannon, an American Mathematician, realised that Boolean Algebra could be used in circuits where the binary variables could represent the "low" and "high" voltage signals or "on" and "off" states.

在1930年代,美国数学家克劳德·香农(Claude Shannon)意识到布尔代数可以用在二进制变量可以表示“低”和“高”电压信号或“开”和“关”状态的电路中。

This simple idea of making circuits with the help of Boolean Algebra led to the development of Digital Electronics which contributed heavily in the development of circuits for computers.

这种借助布尔代数来制作电路的简单想法促成了数字电子学的发展,它为计算机电路的开发做出了巨大贡献。

Digital Circuits implement Boolean Algebra with the help of Logic Gates. Logic Gates are the circuits which represent a boolean operation. For example an OR gate will represent an OR operation. The same goes for NOT and AND gates as well.

数字电路在逻辑门的帮助下实现布尔代数。 逻辑门是代表布尔运算的电路。 例如,“或”门将表示“或”运算。 NOT和AND门也是如此。

Alongside the basic logic gates we also have logic gates that can be created using the combination of the basic logic gates.

除了基本逻辑门外,我们还可以使用基本逻辑门的组合来创建逻辑门。

NAND: NAND gate is formed by a combination of the NOT and AND gates. NAND gate gives an output of 0 if both inputs are 1, otherwise 1.

NAND :NAND门由NOT和AND门的组合形成。 如果两个输入均为1,则NAND门的输出为0,否则为1。

NAND gate holds the property of Functional Completeness, which means that any boolean function can be implemented just by using a combination of NAND gates only.

NAND门具有功能完整性的特性,这意味着仅使用NAND门的组合就可以实现任何布尔函数。

NAND GateVariable-1	Variable-2	Output  0		0		1  0		1		1  1		0		1  1		1		0

NOR: NOR gate is formed by a combination of NOT and OR gates. NOR gate gives an output of 1 if both inputs are 0, otherwise 0.

NOR :NOR门由NOT和OR门的组合形成。 如果两个输入均为0,则NOR门的输出为1,否则为0。

NOR gate, just like NAND gate, holds the property of Functional Completeness, which means that any boolean function can be implemented just by using a combination of NOR gates only.

NOR门与NAND门一样,具有功能完整性的特性,这意味着仅通过使用NOR门的组合就可以实现任何布尔函数。

NOR GateVariable-1	Variable-2	Output  0		0		1  0		1		0  1		0		0  1		1		0

Most digital circuits are built using NAND or NOR gates because of their functional completeness property and also because they are easy to fabricate.

大多数数字电路由于其功能完整性特性以及易于制造而使用NAND或NOR门构建。

Other than the above mentioned gates we also have some special kind of gates which serve some specific purpose. These are as follows:

除了上述门之外,我们还具有一些特殊的门,可用于某些特定目的。 这些如下:

XOR: XOR gate or Exclusive-OR gate is a special type of logic gate which gives 0 as output if both of the inputs are either 0 or 1, otherwise it gives 1.

XOR :XOR门或异或门是一种特殊的逻辑门,如果两个输入均为0或1,则输出为0,否则为1。

XOR GateVariable-1	Variable-2	Output  0		0		0  0		1		1  1		0		1  1		1		0

XNOR: XNOR gate or Exclusive-NOR gate is a special type of logic gate which gives 1 as output when both the inputs are either 0 or 1, otherwise it gives 0.

XNOR :XNOR门或Exclusive-NOR门是一种特殊的逻辑门,当两个输入均为0或1时输出为1,否则为0。

XNOR GateVariable-1	Variable-2	Output  0		0		1  0		1		0  1		0		0  1		1		1

结论 (Conclusion)

So, with all that we can now conclude our discussion on Boolean Algebra here. I hope by now you have a decent picture of what Boolean Algebra is all about.

因此,我们现在可以在这里结束对布尔代数的讨论。 我希望到目前为止,您对布尔代数的含义有一个了解。

This is definitely not all you need to know about Boolean Algebra. Boolean Algebra has a lot of concepts and details that we were not able to discuss in this article.

对于布尔代数,这绝对不是您需要知道的全部。 布尔代数具有许多我们在本文中无法讨论的概念和细节。

翻译自:

逻辑符号xor

转载地址:http://otzzd.baihongyu.com/

你可能感兴趣的文章
用户场景分析
查看>>
几种分布式锁的实现方式
查看>>
MySQL创建数据库及用户
查看>>
获取Android自己写好了的apk以及反编译
查看>>
Task扩展方法取消操作
查看>>
java汉字转拼音以及得到首字母通用方法
查看>>
HTTP协议详解
查看>>
将基因组数据分类并写出文件,python,awk,R data.table速度PK
查看>>
python之pandas入门操作
查看>>
Springboot静态页面放在static路径下还是访问不到
查看>>
webservice系统学习笔记5-手动构建/发送/解析SOAP消息
查看>>
BeautifulSoup与Xpath解析库总结
查看>>
javascript俄罗斯方块游戏
查看>>
关于节点的研究
查看>>
【bzoj4516】[Sdoi2016]生成魔咒 后缀数组+倍增RMQ+STL-set
查看>>
大文件webuploader的基本使用
查看>>
repeater控件在绑定的时候添加行号
查看>>
ASP.NET CORE 中用单元测试测试控制器
查看>>
LeetCode Valid Anagram (简单题)
查看>>
批量删除某些后缀结尾的文件
查看>>