From WikiChip
Difference between revisions of "boolean algebra"

Line 183: Line 183:
  
 
== Canonical Forms ==
 
== Canonical Forms ==
Earlier we've covered [[truth tables]] which are like signatures; there are many ways to represent the same logic, however it will always result in the very same truth table. When two Boolean functions result in the same exact truth table, the two functions are said to be [[logically equivalent]]. The different representations of a truth table are known as '''forms'''. In an attempt to eliminate confusion, a few forms were were chosen to be '''canonical''' or '''standard''' forms.
+
Earlier we've covered [[truth tables]] which are like signatures; there are many ways to represent the same logic, however it will always result in the very same truth table. When two Boolean functions result in the same exact truth table, the two functions are said to be [[logically equivalent]]. The different representations of a truth table are known as '''forms'''. In an attempt to eliminate confusion, a few forms were were chosen to be '''canonical''' or '''standard''' forms. Before we describe those forms we need to go over a few terms.
 +
 
 +
:A '''[[minterm]]''' is the Boolean product (ANDing) of <math>n</math> variables and contains all <math>n</math> variables of the function just once, in either normal or complemented form. For example, for the function <math>f(a, b)</math> with two variables, we can have the following minterms: <math>a \land b</math>, <math>a  \land  \bar b</math>, <math>\bar a  \land  b</math>, and <math>\overline{a  \land  b}</math>. If the value assigned to a variable is 0, the variable is complemented, conversely a variable remains uncomplemented if the value assigned to it is 1. Consider the table to the right, since in the first row, the variables <math>a</math>, <math>b</math>, and <math>c</math> are all <math>0</math>, the minterms for them
 +
 
 +
:A '''[[maxterm]]''' is the Boolean sum (ORing) of <math>n</math> variables and contains all <math>n</math> variables of the function just once, in either normal or complemented form. For example, for the function <math>f(a, b)</math> with two variables, we can have the following maxterms: <math>a \lor b</math>, <math>a \lor \bar b</math>, <math>\bar a \lor b</math>, and <math>\bar a \lor \bar b</math>.
 +
 
 +
:A '''[[sum term]]''' is the Boolean sum (ORing) of  variables as a subset of the possible variables or their complements. For example, for the function <math>f(a,b,c)</math>, the following are a few possible sum terms: <math>\bar c</math>, <math>a \lor b</math>, and <math>\bar a \lor b</math>.
 +
 
 +
:A '''[[product term]]''' is the Boolean product (ANDing) of variables as a subset of the possible variables or their complements. For example, for function <math>f(a,b,c)</math>, the following are possible product terms: <math>\bar c</math>, <math>a \land \bar b</math>, and <math>c \land a</math>.
 +
 
 +
The '''[[sum of minterms]]''' (also called '''canonical sum of products''', '''minterm expansion''', and '''disjunctive normal form''') ('''SoP''') is a Boolean expression in which each term contains all the variables, either in normal or complemented form. For example, consider the following Boolean functions.
 +
:<math>f(a,b,c, d) = a \land (b \lor c \lor d)</math>
 +
We can express that function in SoP form by expanding all the terms.
 +
:<math>f(a,b,c, d) = (a \land b) \lor (a \land c) \lor (a \land d)</math>
 +
Or
 +
:<math>f(a,b,c,d) = ab+ac+ad</math>
  
 
== Minimization ==
 
== Minimization ==

Revision as of 07:59, 2 December 2015

Boolean algebra (or less commonly symbolic logic) is a branch algebra that deals with only two logic values - 0 (corresponding to false) and 1 (corresponding to true).

Today, Boolean algebra is the primary mathematical tool used in designing modern digital systems. Switching functions are described using Boolean algebra since they deal with two discrete states - ON and OFF (or 1 and 0). Those functions are in turn implemented via transistors which act as switches, a natural implementation for representing Boolean algebra operations. Once primitive Boolean operation circuits such as NOT, AND, and OR gates are implemented, any conceivable system of logic can be implemented using them like Lego pieces.

Variables

Main articles: Boolean Variables and boolean data type

Boolean algebra uses variables just like normal algebra. Those variables can only have one of two values - either a 0 or a 1. Variable are commonly represented as a single alphabet letter. While there is no one acceptable convention, a it's not uncommon to see letters such as Equation upper A comma upper B comma and upper C used for inputs and Equation upper P comma upper Q comma upper R comma and upper Z for output. That's also the convention used on WikiChip. Sometimes it's desired to represent the negated (opposite) value of a variable, that's often done with a bar or a tick (prime) above or next to the letter, for example Equation upper A overbar or Equation normal not-sign upper B although other notations exist. Equation upper A overbar is read "not A", regardless of notation.

Operations & Truth tables

Main articles: Boolean Operations and truth table

Boolean algebra has a set of operations that can be performed on Boolean values, those operations are conveniently enough called binary operations. The three common Boolean operators are AND, OR, and NOT. Understanding those operators can better be done by examining their behavior via tool called a truth table. truth tables is a table that lists all possible input values and their respective output values. Truth tables can be said to be the unique signature of a specific Boolean function. Truth tables are an excellent way of seeing the relationships between input values and given Boolean expressions. While there may be many ways to realize or construct a Boolean function to represent a specific relation, they all share the very same truth table.

AND operator

Main article: conjunction
Inputs Outputs
A B Q
0 0 0
0 1 0
1 0 0
1 1 1

The Boolean operator AND is usually represented by either Equation logical-and , Equation dot , or no symbol at all: for example " Equation upper A logical-and upper B ", " Equation upper A dot upper B ", and " Equation upper A upper B " are all equivalent and are read "A AND B". The behavior of this operator is shown in the truth table on the right. The result of "A AND B" is true if both A and B are true; otherwise the result is false. This expression is also called a Boolean product.

For example, suppose we have the function Equation f left-parenthesis a comma b comma c right-parenthesis equals left-parenthesis a logical-and b right-parenthesis logical-and c

Equation StartLayout 1st Row 1st Column upper Q 2nd Column equals f left-parenthesis 1 comma 0 comma 1 right-parenthesis 2nd Row 1st Column Blank 2nd Column equals left-parenthesis 1 logical-and 0 right-parenthesis logical-and 1 3rd Row 1st Column Blank 2nd Column equals 0 logical-and 1 4th Row 1st Column Blank 2nd Column equals 0 Subscript 2 EndLayout

Or

Equation StartLayout 1st Row 1st Column upper Q 2nd Column equals f left-parenthesis 1 comma 1 comma 1 right-parenthesis 2nd Row 1st Column Blank 2nd Column equals left-parenthesis 1 logical-and 1 right-parenthesis logical-and 1 3rd Row 1st Column Blank 2nd Column equals 1 logical-and 1 4th Row 1st Column Blank 2nd Column equals 1 Subscript 2 EndLayout

OR operator

Main article: disjunction
Inputs Outputs
A B Q
0 0 0
0 1 1
1 0 1
1 1 1

The Boolean operator OR is usually represented by Equation logical-or or Equation plus operators. For example " Equation upper A logical-or upper B " and " Equation upper A plus upper B ". The expression Equation upper A plus upper B is read "A or B". The result of "A OR B" is true if either A is true or B is true; otherwise the result is false. This expression is also called a Boolean sum.

For example, suppose we have the function Equation f left-parenthesis a comma b comma c right-parenthesis equals left-parenthesis a logical-or b right-parenthesis logical-or c

Equation StartLayout 1st Row 1st Column upper Q 2nd Column equals f left-parenthesis 1 comma 0 comma 1 right-parenthesis 2nd Row 1st Column Blank 2nd Column equals left-parenthesis 1 logical-or 0 right-parenthesis logical-or 1 3rd Row 1st Column Blank 2nd Column equals 1 logical-or 1 4th Row 1st Column Blank 2nd Column equals 1 Subscript 2 EndLayout

Or

Equation StartLayout 1st Row 1st Column upper Q 2nd Column equals f left-parenthesis 0 comma 0 comma 1 right-parenthesis 2nd Row 1st Column Blank 2nd Column equals left-parenthesis 0 logical-or 0 right-parenthesis logical-or 1 3rd Row 1st Column Blank 2nd Column equals 0 logical-or 1 4th Row 1st Column Blank 2nd Column equals 1 Subscript 2 EndLayout

NOT operator

Main article: negation
Inputs Outputs
A Q
0 1
1 0

The Boolean operator NOT is represented by many notations, the three most popular ones are " Equation normal not-sign upper A ", " Equation upper A overbar ", and " Equation upper A prime ". Note that unlike the AND and OR operators, the NOT operator is a unary operator and is thus drawn above or on the side of the variable. The expression Equation upper A overbar is read "not A". The truth table for the NOT operator is shown on the right. The result of the NOT operator is true if A is false, otherwise the result is true. This expression is called a Boolean complement.

For example, suppose we have the function Equation f left-parenthesis a right-parenthesis equals a overbar

Equation StartLayout 1st Row 1st Column upper Q 2nd Column equals f left-parenthesis 1 right-parenthesis 2nd Row 1st Column Blank 2nd Column equals ModifyingAbove 1 With bar 3rd Row 1st Column Blank 2nd Column equals 0 Subscript 2 EndLayout

Or

Equation StartLayout 1st Row 1st Column upper Q 2nd Column equals f left-parenthesis 0 right-parenthesis 2nd Row 1st Column Blank 2nd Column equals ModifyingAbove 0 With bar 3rd Row 1st Column Blank 2nd Column equals 1 Subscript 2 EndLayout

Order of operations

Main article: Order of Operations

So far we've made it simple by explicitly using parenthesis in all of our examples to indicate a certain part of the expression is evaluated before another part. The order of operations of a Boolean expression is very important to obtain correct result. For example consider the function Equation f left-parenthesis a comma b comma c right-parenthesis equals a logical-and b logical-or c for input Equation f left-parenthesis 0 comma 0 comma 1 right-parenthesis . Does it mean Equation left-parenthesis 0 logical-and 0 right-parenthesis logical-or 1 equals left-parenthesis 0 right-parenthesis logical-or 1 equals 1 ? or does it mean Equation 0 logical-and left-parenthesis 0 logical-or 1 right-parenthesis equals 0 logical-and left-parenthesis 1 right-parenthesis equals 0 ? Same expression, different results. It turns out the the correct order is Equation left-parenthesis a logical-and b right-parenthesis logical-or c (and Equation f left-parenthesis 0 comma 0 comma 1 right-parenthesis equals 1 ). In Boolean expressions, the NOT operator has the highest precedence, followed by AND, then OR.

For example,

Equation f left-parenthesis a comma b comma c right-parenthesis equals upper A logical-and upper B overbar logical-or upper A logical-and upper C overbar logical-or upper A logical-and upper B logical-and upper C equals left-parenthesis left-parenthesis upper A logical-and left-parenthesis upper B overbar right-parenthesis right-parenthesis logical-or left-parenthesis upper A logical-and left-parenthesis upper C overbar right-parenthesis right-parenthesis logical-or left-parenthesis left-parenthesis upper A logical-and upper B right-parenthesis logical-and upper C right-parenthesis right-parenthesis

and

Equation f left-parenthesis a comma b right-parenthesis equals upper A overbar logical-or upper B logical-and upper A equals left-parenthesis left-parenthesis upper A overbar right-parenthesis logical-or left-parenthesis upper B logical-and upper A right-parenthesis right-parenthesis

Axioms

Main article: Boolean Algebra Axioms

Boolean algebra is govern by a set of special axioms that say what kind of Boolean expression manipulations can be done. They are called axioms because they not things that have to be proven but rather part of the definition of Boolean algebra. Many of those laws are common to both Boolean algebra and ordinary algebra. Using those laws, equations can be converted into different forms. One particular transformation known as minimization plays a crucial role in the design of logic circuits. One last thing to note before we get to the actual laws is that Boolean algebra identities come in pairs. This is known as duality principle and it is covered in much more detail later on.

Axiom AND form OR form
Identity Axiom Equation a logical-and 1 equals a Equation a logical-or 0 equals a
Inverse Axiom Equation a logical-and a overbar equals 0 Equation a logical-or a overbar equals 1
Commutative Axiom Equation a logical-and b equals b logical-and a Equation a logical-or b equals b logical-or a
Associative Axiom Equation left-parenthesis a logical-and b right-parenthesis logical-and c equals a logical-and left-parenthesis b logical-and c right-parenthesis Equation left-parenthesis a logical-or b right-parenthesis logical-or c equals a logical-or left-parenthesis b logical-or c right-parenthesis
Distributive Axiom Equation a logical-or left-parenthesis b logical-and c right-parenthesis equals left-parenthesis a logical-or b right-parenthesis logical-and left-parenthesis a logical-and c right-parenthesis Equation a logical-and left-parenthesis b logical-or c right-parenthesis equals left-parenthesis a logical-and b right-parenthesis logical-or left-parenthesis a logical-or c right-parenthesis


In addition to those five axioms, there are a number of other handful laws. Those laws can be proven using the axioms we've introduced above.

Law AND form OR form
Complement Law Equation ModifyingAbove 1 With bar equals 0 Equation ModifyingAbove 0 With bar equals 1
Dominance Law Equation a logical-and 0 equals 0 Equation a logical-or 1 equals 1
Idempotent Law Equation a logical-and a equals a Equation a logical-or a equals a
Absorption Law Equation a logical-and left-parenthesis a logical-or b right-parenthesis equals a Equation a logical-or left-parenthesis a logical-and b right-parenthesis equals a
DeMorgan's Law Equation ModifyingAbove left-parenthesis a logical-and b right-parenthesis With bar equals a overbar logical-or b overbar Equation ModifyingAbove left-parenthesis a logical-or b right-parenthesis With bar equals a overbar logical-and b overbar
Involution Law Equation ModifyingAbove left-parenthesis a overbar right-parenthesis With bar equals a

It's interesting to note that it's easy to see the divergence between Boolean algebra and ordinary algebra from those laws. For example consider Equation 1 plus 1 . From Dominance Law we know the answer is Equation 1 . This is clearly not true for ordinary algebra where Equation 1 plus 1 equals 2 . Likewise from the Absorption Law we know that Equation 1 plus left-parenthesis 1 dot 1 right-parenthesis equals 1 while in ordinary algebra this is not true either.

Axioms explanation

The Identity Axiom simply states that any expression ANDed with 1 or ORed with 0 results in the original expression. Identity elements or simply identities are elements that when used with their appropriate operator leave the original element unchanged. In the case of Boolean algebra, the identity element for AND is 1 and 0 for OR.

Example:

Equation StartLayout 1st Row 1st Column f left-parenthesis a right-parenthesis 2nd Column equals a logical-and 1 logical-or 0 2nd Row 1st Column Blank 2nd Column equals a logical-or 0 3rd Column By Identity Axiom 3rd Row 1st Column Blank 2nd Column equals a 3rd Column By Identity Axiom EndLayout

The Inverse Axiom simply states that when you AND or OR an expression with its complement results in the identity element for that operation.

Example:

Equation StartLayout 1st Row 1st Column f left-parenthesis a comma b right-parenthesis 2nd Column equals left-parenthesis a logical-and a overbar right-parenthesis logical-or ModifyingAbove left-parenthesis b logical-and b overbar right-parenthesis With bar 2nd Row 1st Column Blank 2nd Column equals 0 logical-or ModifyingAbove left-parenthesis b logical-and b overbar right-parenthesis With bar 3rd Column By Inverse Axiom 3rd Row 1st Column Blank 2nd Column equals 0 logical-or ModifyingAbove 0 With bar 3rd Column By Inverse Axiom 4th Row 1st Column Blank 2nd Column equals 1 3rd Column By Inverse Axiom EndLayout

The Commutative Axiom states that individual elements in an expressions can be reordered without affecting the meaning of the expression. For example Equation a logical-and b logical-and c equals c logical-and a logical-and b .


The Associative Axiom states that individual elements in an expression can be regrouped without affecting the meaning of the expression. For example Equation left-parenthesis a logical-and b right-parenthesis logical-and left-parenthesis c logical-and d right-parenthesis equals a logical-and left-parenthesis b logical-and c right-parenthesis logical-and d . Simply put, it makes no difference in what order you group the expressions when ANDing or ORing several expressions together.


The Distributive Axiom states that ANDing distributes over over ORing. That is, ORing several expressions and ANDing the result is equaivilent to ANDing the result with a each of the individual expressions then ORing the product. Often times the Distributive Axiom is applied in reverse in a similar way to factoring in ordinary algebra. For example, given Equation left-parenthesis a logical-and b right-parenthesis logical-or left-parenthesis a logical-and c right-parenthesis , the Equation a expression can be factored out to Equation a logical-and left-parenthesis b logical-or c right-parenthesis

Canonical Forms

Earlier we've covered truth tables which are like signatures; there are many ways to represent the same logic, however it will always result in the very same truth table. When two Boolean functions result in the same exact truth table, the two functions are said to be logically equivalent. The different representations of a truth table are known as forms. In an attempt to eliminate confusion, a few forms were were chosen to be canonical or standard forms. Before we describe those forms we need to go over a few terms.

A minterm is the Boolean product (ANDing) of Equation n variables and contains all Equation n variables of the function just once, in either normal or complemented form. For example, for the function Equation f left-parenthesis a comma b right-parenthesis with two variables, we can have the following minterms: Equation a logical-and b , Equation a logical-and b overbar , Equation a overbar logical-and b , and Equation ModifyingAbove a logical-and b With bar . If the value assigned to a variable is 0, the variable is complemented, conversely a variable remains uncomplemented if the value assigned to it is 1. Consider the table to the right, since in the first row, the variables Equation a , Equation b , and Equation c are all Equation 0 , the minterms for them
A maxterm is the Boolean sum (ORing) of Equation n variables and contains all Equation n variables of the function just once, in either normal or complemented form. For example, for the function Equation f left-parenthesis a comma b right-parenthesis with two variables, we can have the following maxterms: Equation a logical-or b , Equation a logical-or b overbar , Equation a overbar logical-or b , and Equation a overbar logical-or b overbar .
A sum term is the Boolean sum (ORing) of variables as a subset of the possible variables or their complements. For example, for the function Equation f left-parenthesis a comma b comma c right-parenthesis , the following are a few possible sum terms: Equation c overbar , Equation a logical-or b , and Equation a overbar logical-or b .
A product term is the Boolean product (ANDing) of variables as a subset of the possible variables or their complements. For example, for function Equation f left-parenthesis a comma b comma c right-parenthesis , the following are possible product terms: Equation c overbar , Equation a logical-and b overbar , and Equation c logical-and a .

The sum of minterms (also called canonical sum of products, minterm expansion, and disjunctive normal form) (SoP) is a Boolean expression in which each term contains all the variables, either in normal or complemented form. For example, consider the following Boolean functions.

Equation f left-parenthesis a comma b comma c comma d right-parenthesis equals a logical-and left-parenthesis b logical-or c logical-or d right-parenthesis

We can express that function in SoP form by expanding all the terms.

Equation f left-parenthesis a comma b comma c comma d right-parenthesis equals left-parenthesis a logical-and b right-parenthesis logical-or left-parenthesis a logical-and c right-parenthesis logical-or left-parenthesis a logical-and d right-parenthesis

Or

Equation f left-parenthesis a comma b comma c comma d right-parenthesis equals a b plus a c plus a d

Minimization

New text document.svg This section is empty; you can help add the missing info by editing this page.

Complementary Function

New text document.svg This section is empty; you can help add the missing info by editing this page.

See also