Boolean Algebra and Circuits Part 1

Boolean Algebra and Circuits
Part 1
1 Boolean Operators
logical addition: (OR)
x+y=z
x+y+z = a
(x OR y equals z)
(multiple ORs)
logical multiplication: (AND)
x*y=z
or
xy=z
(x AND y equals z)
complementation: (NOT)
x' = z
(NOT x equals z) Note: not x is represented different ways in books. In
this document, we’ll use x’.)
2
Boolean Algebra and Logical expressions:
2.1
Precedence rules.
The expression, X+YZ', means X+(Y(Z')) where multiplication has precedence over addition and NOT
has the highest precedence. Use parentheses when the precedence needs to be changed.
When several identical operators are used, such as a+b+c, there is an implied precedence, such as
(a+b)+c. However, the associative law (see next section) states that the placement of parentheses is
unimportant. Hence we can simplify the expression to a+b+c. Similarly, abc can be used without
parentheses.
Example: a+b’c+d is a short-hand notation for (a + ( (b’) c )) + d. We will use parentheses only when we
wish to overload the precedence or when we wish to emphasize precedence.
1
2.2
Basic Laws of Boolean Algebra.
The following basic rules or laws correspond to similar rules of “regular” algebra (except 7a).
Note that there is a duality for laws 1-8. One for AND (in the left column) and one for OR.
(1a)
(2a)
(3a)
(4a)
(5a)
(6a)
(7a)
(8a)
(9)
1A=A
0A=0
AA=A
AA'=0
AB=BA
(AB)C=A(BC)
A+BC=(A+B)(A+C) *
(AB)'=A'+B'
(A’)’ = A
(1b)
(2b)
(3b)
(4b)
(5b)
(6b)
(7b)
(8b)
0+A=A
1+A=1
A+A=A
A+A'=1
A+B=B+A
(A+B)+C=A+(B+C)
A(B+C)=AB+AC
(A+B)'=A'B'
[commutative law]
[associative law]
[distribution law]
[DeMorgan’s law]
* I call this the funky distribution, since it does not hold in regular algebra.
Example: Prove the formula: A+A'B=A+B
Proof:
A+A'B = (A+A')(A+B)
= A+B
[funky distribution]
[A+A’=1 rule and 1A=A rule]
Example: Prove the formula: (xyz)’ = x’+y’+z’
Proof:
(xyz)’ = ((xy)z)’
= (xy)’+z’
= (x’+y’)+z’
= x’+y’+z’
[associating xy as one expression]
[DeMorgan’s law]
[same rule]
[equal precedence implies parentheses can be removed]
Example: (tricky) Prove A(A+B) = A
Proof:
A(A+B) = AA+AB = A+AB = A1+AB = A(1+B) = A1 = A
3 Derivation of a Boolean expression given a circuit’s behavior.
Given a circuit with two inputs, X and Y, and an output, Z. The relationship between inputs and output is
defined as:
1. X=Y=0
2. X=0, Y=1
3. X=1, Y=0
4. X=1, Y=1
=> Z=1
=> Z=0
=> Z=1
=> Z=1
(1 is equivalent to “true”, 0 is “false”.)
2
Thus, Z=1, only when X=Y=0, or (X=1 and Y=0), or (X=1 and Y=1). We can define this circuit using
the following formula (note: Z represents the output, and the left side is a Boolean expression for the
circuit attached to Z with inputs X, and Y):
X'Y' + XY' + XY = Z
This is a sum of products. Note that Z=1 only when each of the terms on the right evaluate to 1. Hence
we use the term X’Y’ to represent the case where X=Y=0. The other terms are similarly defined.
One question we may ask: is this the most efficient circuit (efficiency is measured by the number of basic
gates used)? The formula above uses 8 gates (try to verify this).
To answer this question without using a hit-or-miss method, we apply Boolean algebra to derive a more
efficient circuit.
Part 2 of our study of Boolean algebra will focus of simplifying expressions.
3