DSD Boolean Algebra and Logic Gates
DSD Boolean Algebra and Logic Gates
2.1 Introduction
2.2 Basic Definitions
2.3 Axiomatic Definition of Boolean Algebra
2.4 Basic Theorems and Properties of Boolean Algebra
2.5 Boolean Functions
2.6 Canonical and Standard Forms
2.7 Other Logic Operations
2.8 Digital Logic Gates
2.9 Integrated Circuits
Basic Definitions
• Mathematical methods that simplify binary logics or circuits rely primarily
on Boolean algebra.
• Boolean algebra: a set of elements, a set of operators, and a number of
unproved axioms or postulates.
• A set of elements is any collection of objects, usually having a common
property. A = {1, 2, 3, 4} indicates that set A has the elements of 1, 2, 3, and 4.
• A binary operator defined on a set S of elements is a rule that assigns, to
each pair of elements from S, a unique element from S.
• The most common postulates used to formulate various algebraic structures
are as follows:
1. Closure. A set S is closed with respect to a binary operator if, for every pair
of elements of S, the binary operator specifies a rule for obtaining a unique
element of S.
2. Associative law. A binary operator * on a set S is said to be
associative whenever (x * y) * z = x * (y * z) for all x, y, z, S
3. Commutative law. A binary operator * on a set S is said to be
commutative whenever x * y = y * x for all x, y S
4. Identity element. A set S is said to have an identity element with respect to a
binary operation * on S if there exists an element e S with the property
that
e * x = x * e = x for every x S
Example: The element 0 is an identity element with respect to the binary
operator + on the set of integers I = {c, -3, -2, -1, 0, 1, 2, 3,c}, since x + 0 = 0
+ x = x for any x I
The set of natural numbers, N, has no identity element, since 0 is excluded
from the set.
5. Inverse. A set S having the identity element e with respect to a binary operator
* is said to have an inverse whenever, for every x S, there exists an element
y S such that x * y = e
Example: In the set of integers, I, and the operator +, with e = 0, the inverse of
an element a is (-a), since a + (-a) = 0.
6. Distributive law. If * and • are two binary operators on a set S, * is said to
be distributive over • whenever x * (y • z) = (x * y) • (x * z)
Field
• A field is an example of an algebraic structure.
• The field of real numbers is the basis for arithmetic and ordinary algebra.
– The binary operator + defines addition.
– The additive identity is 0.
– The additive inverse defines subtraction.
– The binary operator • defines multiplication.
– The multiplicative identity is 1.
– For a ≠ 0, the multiplicative inverse of a = 1/a defines division (i.e., a •1/a = 1).
– The only distributive law applicable is that of • over +:
a • (b + c) = (a • b) + (a • c)
Axiomatic Definition of Boolean Algebra
• 1854: George Boole developed an algebraic system now called Boolean algebra.
1904: E. V. Huntington formulated a set of postulates that formally define the
Boolean algebra
1938: C. E. Shannon introduced a two-valued Boolean algebra called switching algebra
that represented the properties of bistable electrical switching circuits
x y xy x + xy
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
DeMorgan's Theorems
– (x+y)' = x' y‘
x y x+y (x+y) x y xy
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0
– (x y)' = x' + y'
x y xy (xy) x y x+y
0 0 0 1 1 1 1
0 1 0 1 1 0 1
1 0 0 1 0 1 1
1 1 1 0 0 0 0
Operator Precedence
• The operator precedence for evaluating Boolean expressions is
1. parentheses
2. NOT
3. AND
4. OR
• Examples
– x y' + z
– (x y + z)'
Boolean Functions
• A Boolean function is an algebraic expression consists of
– binary variables
– binary operators OR and AND
– unary operator NOT
– parentheses
• A Boolean function expresses the logical relationship between binary variables
and is evaluated by determining the binary value of the expression for all
possible values of the variables.
• Examples
– F1= x + y z’ F1 = 1 if x = 1 or if y = 0 and z = 1, others F1 = 0.
– F2 = x' y' z + x' y z + x y’
F2 = 1 if (x = 0, y = 0, z = 1) or (x = 0, y = 1, z = 1) or (x = 1, y = 0),
others F2 = 0.
What are the others?
Truth Table
• Boolean function can be represented in a truth table.
• Truth table has 2n rows where n is the number of variables in the function.
• The binary combinations for the truth table are obtained from the binary
numbers by counting from 0 through 2n - 1.
F1= x + y z’
Equivalent Logics
F2 = x’y’z + x’yz + xy’
• Boolean function can be = x’z(y’ + y) + xy’
represented in truth = x’z + xy’
table only in one way.
• In algebraic form, it can
be expressed in a variety
of ways, all of which have
equivalent logic.
• Using Boolean algebra, it
is possible to obtain a
simpler expression for the
same function with less
number of gates and inputs
to the gate.
• Designers work on reducing
the complexity and number
of gates to significantly
reduce the circuit cost.
Algebraic Manipulation
• To minimize Boolean expressions
– literal: a complemented or un-complemented variable (an input to a gate)
– term: an implementation with a gate
– The minimization of the number of literals and the number of terms =>
a circuit with less equipment
EXAMPLE 2.3
Minterms and Maxterms
• A minterm (standard product): an AND term consists of all literals in
their normal form or in their complement form
• For example, two binary variables x and y, has 4 minterms
– xy, xy', x'y, x'y‘
• n variables can be combined to form 2n minterms (mj, j = 0 ~ 2n-1)
• A maxterm (standard sum): an OR term; 2n maxterms (Mj, j = 0 ~ 2n-1)
• Each maxterm is the complement of its corresponding minterm, and vice versa.
Canonical Form: Sum of Minterms
• An Boolean function can be expressed by
– a truth table
– sum of minterms f = Σ mj
– product of maxterms f = Π Mj
f1 = x'y'z + xy'z + xyz =‘ m1 + m4 +m7
f2 = x'yz + xy'z + xyz‘ + xyz = m3 + m5 +m6 + m7
Canonical Form: Product of Maxterms
• The complement of a Boolean function
– the minterms that produce a 0
– f1' = m0 + m2 +m3 + m5 + m6 = x'y'z‘ + x'yz‘ + x'yz + xy'z + xyz'
– f1 = (f1’)’ = (x + y + z)(x + y‘ + z) (x + y‘ + z') (x‘ + y + z')(x‘ + y‘ + z)
– = M0 M2 M3 M5 M6
– f2 = (x + y + z)(x + y + z’)(x + y’ + z)(x’ + y + z)
= M0 M1 M2 M4
• Canonical form: any Boolean function expressed as a sum of minterms or
a product of maxterms
Minterm Expansion
• EXAMPLE 2.4: Express the Boolean function F=A+B’C as a sum of minterms.
– F = A + B'C = A (B + B') + B'C = AB + AB' + B'C
– = AB(C + C') + AB'(C + C') + (A + A')B'C
– = ABC + ABC‘ + AB'C + AB'C‘ + A'B'C
– = A'B'C + AB'C' + AB'C + ABC‘ + ABC
– = m1 + m4 +m5 + m6 + m7
– F(A,B,C) = Σ (1, 4, 5, 6, 7)
– or, built the truth table first
Maxterm Expansion
EXAMPLE 2.5: Express the Boolean function F = xy + x’z as a product of
maxterms.
– F = xy + x'z = (xy + x') (xy + z) = (x + x')(y + x')(x + z)(y + z)
– = (x’ + y)(x + z)(y + z)
• F3 = AB + C(D + E)
= AB + C(D + E) = AB + CD + CE
• Which kind of gate will have the least delay (high switching speed)?
• The delay through a gate is largely dependent on the circuit design and
Nonstandard Forms
technology, as well as manufacturing process used. (taught in VLSI
design)
Other Logic Operations
• 2n rows in the truth table of n binary variables
n
• 22 functions for n binary variables (each row may either be 0 or 1)
2
2
• 16 (2 )functions of two binary variables
Digital Logic Gates of Two Inputs
Digital Logic Gates of Two Inputs
Extension to Multiple Inputs
• A gate can be extended to multiple inputs
– if its binary operation is commutative and associative
• AND and OR are commutative and associative
– commutative: x + y = y + x , xy = yx
– associative: (x + y) + z = x + (y + z) = x + y + z , (x y)z = x(y z) = x y z
x x
y F
F yz
z
x x
F
y F yz
z
Multiple-input NOR/NAND
• NAND and NOR are commutative but not associative => they are not
extendable (x ↓ y) ↓ z = [(x + y)’ + z]’ = (x + y) z’ = xz’ + yz’
x ↓ (y ↓ z) = [x + (y + z)’]’ = x’(y + z) = x’y + x’z
Multiple-input NOR/NAND
• Multiple-input NOR = a complement of OR gate (x ↓ y ↓ z) = (x + y + z)’
• Multiple-input NAND = a complement of AND (x ↑ y ↑ z) = (xy z)’
• The cascaded NAND operations = sum of products
• The cascaded NOR operations = product of sums
Multiple-input XOR/XNOR
DeMorgan’s theorems are useful here.
Multiple-input XOR/XNOR
• 2.9 (c)
• 2.11 (b)
• 2.22 (b)
• 2.28