Boolean Algebra
Boolean Algebra
Definition: A Boolean Algebra is a math construct (B,+, . , ‘, 0,1) where B is a non-empty set, + and . are
binary operations in B, ‘ is a unary operation in B, 0 and 1 are special elements of B, such that:
Examples:
Theorem 1: Let (B,+, . , ‘, 0,1) be a Boolean Algebra. Then the following hold:
Proof:
1
=x.1 using (b)
=x Identity laws
Corollary 1: (x’)’=x.
Proof, since x’+x=1 and x’x=0, it follows that x is a complement of x’. Since the complement of x’ is
unique, it follows then that (x’)’ , which is a complement of x’, and x, which is also a complement of x’,
must be equal. Thus, (x’)’=x. QED
QED.
Definition: Let (B,+, . , ‘, 0,1) be a Boolean Algebra. Define the following ≤ relation in B:
x ≤ y if xy=x
2
x =xy because x≤y
=yx because . is commutative
=y because y≤x
Therefore, x=y.
Transitivity: x≤y and y≤z => x≤z ?
xz =(xy)z because xy=x since x≤y
=x(yz) because . is associative
=xy because yz=y since y≤z
=x because xy=x since x≤y
Therefore, xz=x and hence x≤z.
Theorem 5 (without proof): If B is a finite Boolean Algebra, then |B| is a power of 2 and the Hasse
Diagram of B with respect to ≤ is a hypercube.
Definition: A Boolean variable x is a variable (placeholder) where the set from which it takes on its
values is a Boolean algebra.
Definition: A Boolean expression is any string that can be derived from the following rules and no other
rules:
a) 0 and 1 are Boolean expressions
b) Any Boolean variable is a Boolean expression
c) If E and F are Boolean expressions, then (E), (E+F), (E.F), and E’ are Boolean expressions.
Examples:
f: Bn B
Definition: Two Boolean expressions are said to be equivalent if their corresponding Boolean functions
are the same.
3
Definition: A literal is any Boolean variable x or its complement x’.
f(x,y)=xy+x’y’; g(x,y,z) = xy’z’+x’y’z+x’yz’;
x y f x y z g
1 1 1 1 1 1 0
1 0 0 1 1 0 0
0 1 0 1 0 1 0
0 0 1 1 0 0 1
0 1 1 0
0 1 0 1
0 0 1 1
0 0 0 1
u(x,y,z,w)= 1 if the string xyzw has an
h(x,y,z,w) = x’y’w’+xyzw+xz’;
odd number of 1’s; otherwise, it is 0.
x y z w h
1 1 1 1 1 x y z w u
1 1 1 0 0 1 1 1 1 0
1 1 0 1 1 1 1 1 0 1
1 1 0 0 1 1 1 0 1 1
1 0 1 1 0 1 1 0 0 0
1 0 1 0 0 1 0 1 1 1
1 0 0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0 1 0
0 1 1 1 0 1 0 0 0 1
0 1 1 0 0 0 1 1 1 1
0 1 0 1 0 0 1 1 0 0
0 1 0 0 0 0 1 0 1 0
0 0 1 1 1 0 1 0 0 1
0 0 1 0 0 0 0 1 1 0
0 0 0 1 1 0 0 1 0 1
0 0 0 0 0 0 0 0 1 1
0 0 0 0 0
4
Definitions of Minterms and Maxterms:
Suppose we’re dealing with n Boolean variables. A minterm is any product of n literals where
each of the n variable appears once in the product.
o Example, where n=3 and the variables are x, y and z:
Then, xyz, xy’z, xy’z’ are all miterms.
xy is not a minterm because z is missing.
Also, xyzy’ is not a minterm because y appears multiple times (once as y, and
another time as y’).
o For n=2 where the variables are x and y, there are 4 minterms in total: xy, xy’, x’y, x’y’.
A maxterm is any sum of n literals where each of the n variable appears once in the sum.
o Example, where n=3 and the variables are x, y and z:
x+y+z, x+y’+z’ are both maxterms (of 3 variables).
x+y’ is not a maxterm because z is missing.
Examples:
Examples:
Observation: Thanks to De Morgan’s Laws, if f is in DNF, then f’ derived from the DNF using De
Morgan’s Laws (that is, changing every literal to its complement, and every “.” to “+”, and every “+” to
“.”) is in CNF, and vice versa.
5
2. For each row where the value of f is 1, create a minterm as follows: put in the position of every
variable x in the minterm either x or x’ according to whether the corresponding value in that
combination is 1 or 0.For example:
For combination 111, the midterm is xyz.
For combination 010, the minterm is x’yz’.
3. The DNF of f is the sum of all the minterms created in step 2.
Examples:
6
Finally, applying De Morgan’s, we get the CNF of f: f=(f’)’= (x’+y’+z’)(x+y’+z’)(x+y’+z)(x+y+z).
x’y’z + xz + xy’z’
y y’
x 1 1 1
x’ 1
z z’ z
Minimized form: xz + xy’ + y’z
xz + yz’ + y’z’
y y’
x 1 1 1 1
x’ 1 1
z z’ z
1. The Karnaugh map is a table of squares (2n squares when you have n variables)
2. Divide the map into regions so that each variable “owns” half of the squares, and its complement
owns the other half. Each square will end up being owned by n literals (making up a minterm).
7
For example, for 3 variables, the map (of 8 sqaures) is
y y’
x
x’
z z’ z
The variable x owns the top 4 yellow squares. Its complement x’ owns the bottom yellow row of
squares. The variable y owns the left half of the squares, and y’ owns the right half. The variavle
z owns the left and right column of yellow squares, and its complement z’owns the two middle
columns of yellow squares.
y y’
x w
w’
x’
w
z z’ z
o The variable x owns the top two rows of yellow squares. Its complement x’ owns the
bottom two yellow rows of squares.
o The variable y owns the left half of the squares, and y’ owns the right half.
o The variavle z owns the left and right column of yellow squares, and its complement
z’owns the two middle columns of yellow squares.
o Finally, the variable w owns the top and bottom row of yellow squares, and its
complement owns the two middle rows of the yellow squares.
3. Fill the map for a given function f: for each minterm in f, put “1” inside the square corresponding
to (or owned by) that minterm.
4. Grouping the filled squares: Group the 1’s into rectangles of totally filled squares such that
o the length and width of each rectangle are powers of 2
o no filled square remains ungrouped
o rectangles can overlap
o each rectangle must exclusively own at least one filled square.
5. Convert each rectangle to a product of literals: For each rectangle, identify the literals where each
literal owns the entire rectangle, then multiply those literals.
6. The minimized form is the sum of the products derived in the previous steps.
8