From WikiChip
Boolean Algebra
Revision as of 00:30, 29 November 2015 by Jon (talk | contribs)

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. 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 are an excellent way of seeing the relationships between input values and given Boolean expressions.

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