Monday 25 March 2013

Rules of Boolean Algebra


NOT Rule

In algebra, the negative of a negative is a positive and taking the inverse of an inverse returns the original value. Although the NOT gate does not have an equivalent in mathematical algebra, it operates in a similar manner. If the boolean inverse of a boolean inverse is taken, the original value results.

This is proven with a truth table.





Since the first column and the third column have the same pattern of ones and zeros, they must be equivalent. Figure shows this rule in schematic form.




OR Rules
If an input to a logic gate is a constant 0 or 1 or if the same signal is connected to more than one input of a gate, a simplification of the expression is almost always possible. This is true for the OR gate as is shown with the following four rules for simplifying the OR function.
First, what happens when one of the inputs to an OR gate is a constant logic 0? It turns out that the logic 0 input drops out leaving the remaining inputs to stand on their own. Notice that the two columns in the truth table below are equivalent thus proving this rule.

Rule: A + 0 = A
A                    A + 0
0                     0+0 = 0
1                     1+0 = 1

Rule: A + 1 = 1
A                    A + 1
0                     0+1 = 1

Rule: A + A = A
A                    A+ A
0                     0+0 = 0
1                     1+1 = 1

Rule: A + A^ = 1
A                    A + A^
0                     0+1 = 1
1                     1+0 = 1

AND Rules
Just as with the OR gate, if either of the inputs to an AND gate is a constant (logic 0 or logic 1) or if the two inputs are the same or inverses of each other, a simplification can be performed. Let's begin with the case where one of the inputs to the AND gate is a logic 0. Remember that an AND gate must have all ones at its inputs to output a one. In this case, one of the inputs will always be zero forcing this AND to always output zero. The truth table below shows this.

Rule: A · 0 = 0
A                 A · 0
0                  0 · 0 = 0
1                  1 · 0 = 0

Rule: A · 1 = A
A                 A · 1
0                  0 · 1 = 0
1                  1 · 1 = 1

Rule: A · A^= 0
A                 A · A^
0                   0 · 1 = 0
1                   1 · 0 = 0

Rule: A · A = A
A                  A · A
0                    0 · 0 = 0
1                    1 · 1 = 1

XOR Rules
Now let's see what happens when we apply these same input conditions to a two-input XOR gate. Remember that a two-input XOR gate outputs a 1 if its inputs are different and a zero if its inputs are the same. If one of the inputs to a two-input XOR gate is connected to a logic 0, then the gate's output follows the value at the second input. In other words, if the second input is a zero, the inputs are the same forcing the output to be zero and if the second input is a one, the inputs are different and the output equals one.

Rule: A ⊕ 0 = A
A                      A ⊕ 0
0                        0 ⊕ 0 = 0
1                        1 ⊕ 0 = 1

Rule: A ⊕ A = 1
A                         A ⊕ A
0                           0 ⊕ 1 = 1
1                           1 ⊕ 0 = 1

Rule: A ⊕ A^ = 0
A                          A ⊕ A^
0                            0 ⊕ 0 = 0
1                            1 ⊕ 1 = 0

Rule: A ⊕ 1 = A
A                           A ⊕ 1
0                             0 ⊕ 1 = 1
1                             1 ⊕ 1 = 0




No comments:

Post a Comment