Changes

Boolean algebra

662 bytes added, 15:03, June 23, 2016
/* See also */clean up
'''Boolean algebra''' or '''[[boolean logic]]''' is the formal mathematical discipline that deals with "truth values"—"true" or "false". Its fundamental operations are "and", "or" and "not". One can write "propositions" (equations) of boolean algebra, such as
P = (Q+R)•(T')
and manipulate them the way one would manipulate ordinary algebraic equations.
==Boolean Algebra and Computer Hardware==
The thing that elevates boolean algebra from a somewhat obscure branch of mathematics to one of the driving forces of modern society is that it is the basis for computers. Computers do Boolean logic is implemented in electrical circuitry by means of gates (built from many [[CMOS]] and [[nMOS]] [[transistor]]s wired together) representing the basic AND, NOT, and OR operators. These gates are then wired together to create computer chips. Therefore, everything a computer does must be represented in boolean logic. All numbers are represented internally in [[binary]] (base 2) notation, with digits ("bits") 1 and 0, corresponding to "true" and "false", respectively; and each letter is represented by a [[ASCII|binary code]]. Computers are  Computation is then designed in terms of done by boolean algebra equationsoperations. For example, addition is performed by 32 copies of these equationsperforming this function on each [[bit]]:
S = (A•B•C) + (A•B'•C') + (A'•B•C') + (A'•B'•C)
D = (A•B) + (A•C) + (B•C)
A modern computer processing chip has tens of millions of transistors, all calculating boolean operations.
 
===Computer Programming===
The operations of boolean logic are also extremely important in computer software. Modern computer languages usually have some kind of "boolean" data type. For example, in the C++ language, it is called "bool".
==Three Basic Operations==
The three basic operations of boolean algebra are AND (analogous to [[multiplication]]), OR (analogous to [[addition]]), and NOT(analogous to [[inversion]]). See the table tables below for a numerical descriptionand pictorial descriptions. From these functions, the other functions of boolean algebra can be derived. In the following descriptions, we will use the 1-and-0 notation rather than the true-and-false notation.
{| class="wikitable" align="center"! colspan=10 | Truth Table for the Operators |- alight="left"! colspan=3 | AND: A•B=C !! || !! || colspan=3 | OR: A+B=C !! !! || || colspan=2 | NOT A'=B
|- align="center"
| '''A''' || '''B''' || '''C''' || rowspan=5 | || '''A''' || '''B''' || '''C''' || rowspan=5 | || '''A''' || '''B'''
| 1 || 0 || 0 || 1 || 0 || 1
|- align="center"
| 1 || 1 || 1 || 1 || 0 1 || 1
|}
 
===AND===
[[Image:VennAnd1.gif|right|250px|thumb|Pictorial description of AND]]
AND is the boolean equivalent of multiplication. The product of two numbers are non-zero if both numbers are non-zero. In words, the AND function states: "If A AND B are true then C is true". The AND function is commutative, so it results in the same answer no matter what order the values are in. For example, A • B = B • A, and A • (B • C) = (A • B) • C.
 
{{clear}}
===OR===
[[Image:VennOr1.gif|right|250px|thumb|Pictorial description of OR]]
OR is the boolean equivalent of addition. The sum of two positive numbers is non-zero if either number is non-zero. In words, the OR function states: "If A OR B is true then C is true". Like AND, the OR function is commutative.
===NOT===
NOT is a function which is not the Boolean equivalent of an algebraic functioninversion. It is represented by an apostrophe (A') or an overbar (<math>\bar A</math>). NOT reverses the value of any variable: if A = 0, A' = 1, and if A = 1, A' = 0.
NOT can be combined with AND and NOT for interesting results. A•A' (A AND NOT A) always equals 0 (false), since no matter the value of A, one of the two values is always 0. Similarly, A+A' (A OR NOT A) always equals 1 (true), since no matter the value of A, one of the two values is always 1.
==Derived Functions==
From the three functions mentioned above, other functions can be derived. Some common derivatives ones are NAND, NOR and XOR. See the table below for a numerical description.
{| class="wikitable" align="left"
| 1 || 0 || 1 || 1 || 0 || 0 || 1 || 0 || 1
|- align="center"
| 1 || 1 || 0 || 1 || 0 1 || 0 || 1 || 1 || 10
|}
XOR (or "exclusive OR") gives a 1 ("true") if either of its inputs are 1, but not both. Symbolically this can be broken down into its basic operations by the expression: A XOR B = A'B + B'A.
==Boolean Algebra and Computer Programming==The operations of boolean logic are extremely important in computer software. Modern computer languages usually have some kind of "boolean" data type. For example, in the C++ language, it is called "bool".
{{clear}}
== See also ==*[http://www.learn-c.com/boolean.htm Boolean logic tutorial] [[Category:Logic]][[Category:MathematicsComputer Science]]
[[Category:Electronics]]
Block, SkipCaptcha, bot, edit
57,719
edits