Title: Chapter 2: Boolean Algebra and Logic Functions
1Chapter 2 Boolean Algebra and Logic Functions
- CS 3402-- Digital Logic Design
2Boolean Algebra
- Algebraic structure consisting of
- a set of elements B
- operations AND, OR
- Notation X AND Y X Y XY
- X OR Y XY
- B contains at least two elements a b such that
a ? b - Note switching algebra is a subset of Boolean
algebra where B0, 1 - Axioms of Boolean Algebra
- 1. Closure a,b in B,
- (i) a b in B
- (ii) a b in B
- 2. Identities 0, 1 in B
- (i) a 0 a
- (ii) a 1 a
- 3. Commutative Laws a,b in B,
- (i) a b b a
- (ii) a b b a
4. Associative Laws (i) a (bc) (ab)c
abc (ii) a. (b.c) (a.b).c a.b.c 5.
Distributive Laws (i) a (b c) (a
b) (a c) (ii) a (b c) (a b)
(a c) 6. Existence of the Complement exists
a unique in B (i) a a 1 (ii) a
a 0 a is complement of a
3Principle of Duality
- Definition of duality
- a dual of a Boolean expression is derived by
replacing AND operations by ORs, OR operations by
ANDs, constant 0s by 1s, and 1s by 0s (everything
else is left unchanged). - Principle of duality if a statement is true for
an expression, then it is also true for the dual
of the expression - Example find the dual of the following
equalities - 1) XYZ 0
- 2) a(bc) ab ac
4Boolean Functions
- A Boolean function consists of an algebraic
expression formed with binary variables, the
constants 0 and 1, the logic operation symbols,
parenthesis, and an equal sign. - Example
- F(X,Y,Z) X Y Z or F X Y Z
-
- X, Y and Z are Boolean variables
- A literal The appearance of a variable or its
complement in a Boolean expression - A Boolean function can be represented with a
truth table - A Boolean function can be represented with a
logic circuit diagram composed of logic gates.
5From Boolean Expression to Gates
- More than one way to map an expression to gates
- E.g., Z A' B' (C D) (A' (B' (C
D)))
A
Z
B
C
D
A
B
Z
C
D
For each Boolean function, there is only one
unique truth table representation gtTruth table
is the unique signature of a Boolean function
6Boolean Functions
- Possible Boolean Functions of Two variables
Gates
NAND
X
Z
Y
Gates
NOR
X
Z
Y
7Basic Logic Functions NAND, NOR
- NAND, NOR gates far outnumber AND, OR in typical
designs - easier to construct in the underlying transistor
technologies - they are functionally complete
- Functionally Complete Operation Set
- A set of logic operations from which any Boolean
function can be realized (also called universal
operation set) - E.g. AND, OR, NOT is functionally complete
- The NAND operation is also functionally complete
- gt any Boolean function can be realized with one
type of gate (the NAND gate). - The NOR operation is also functionally complete
8Basic Logic Functions XOR, XNOR
- XOR X or Y but not both ("inequality",
"difference") - XNOR X and Y are the same ("equality",
"coincidence")
9Logic Functions Rationale for Simplification
- Logic Minimization reduce complexity of the gate
level implementation - reduce number of literals (gate inputs, circuit
inputs) - reduce number of gates
- reduce number of levels of gates
- fewer inputs implies faster gates in some
technologies - fan-ins (number of gate inputs) are limited in
some technologies - Fewer circuit inputs implies fewer I/O pins
- fewer levels of gates implies reduced signal
propagation delays - number of gates (or gate packages) influences
manufacturing costs - In general, need to make tradeoff between circuit
delay and reduced gate count.
10Simplification Using Boolean Algebra
- Useful Theorems of Boolean Algebra
- 1. Idempotency Theorem
- a. X X X b. X X X
- 2. Null elements for and operators
- a. X 1 1 b. X . 0 0
- 3. Involution Theorem
- (X) X
- 4. Absorption Theorem
- a. X XY X b. X.(XY) X
- 5. Simplification Theorem
- a. XY XY X b. (XY).(XY) X
- 6. Another Simplification Theorem
- a. X XY X Y b. X.(X Y) X.Y
11DeMorgan's Theorems
- 7. DeMorgans Theorem
- a. (XY) X . Y b. (X.Y)
X Y - The complement of the sum is the product of the
complements - The complement of the product is the sum of the
complements - In general
- a. (AB.Z) A . B . .Z
- b. (A.B.C.Z) A B .Z
12DeMorgan's Theorem
NOR is equivalent to AND with inputs complemented
(X Y)' X' Y'
NAND is equivalent to OR with inputs complemented
DeMorgans Law can be used to get the complement
of an expression F(X1,X2,...,Xn,0,1,,)'
F(X1',X2',...,Xn',1,0,,) Example F A B'
C' A' B' C A B' C A B C' F' (A' B
C) (A B C') (A' B C') (A' B'
C)
13Function Representations
- Truth Table (Unique representation)
- Boolean Expressions
- Logic Diagrams
- From TO
- Boolean Expression gt Logic Diagram
- Logic Diagram gt Boolean Expression
- Boolean Expression gt Truth Table
- Truth Table gt Boolean Expression
14Function Representations
15Deriving Boolean Expression from Truth Table
16Product and Sum Terms --Definitions
- Definitions
- Literal A boolean variable or its complement
- X X A B
- Product term A literal or the logical product
(AND) of multiple literals X XY XYZ XYZ
ABC - Note X(YZ)'
- Sum term A literal or the logical sum (OR) of
multiple literals - X XY XYZ XYZ ABC
- Note X(YZ)'
-
17SOP POS -- Definitions
- Sum of products (SOP) expression The logic sum
(OR) of multiple product terms - AB AC B ABC
- ABC BD ACD
- Product of sums (POS) expression The logic
product (AND) of multiple sum terms - (AB).( AC).B.( ABC)
- (A B C).( C D)
- Note
- SOP expressions gt 2-level AND-OR circuit
- POS expressions gt 2-level OR-AND circuit
18Minterms Maxterms -- Definitions
- Definitions
- A Minterm for an n variable function, a minterm
is a product term that contains each of the n
variables exactly one time in complemented or
uncomplemented form. - Example if X, Y and Z are the input variables,
the minterms are - XYZ XYZ XYZ XYZ XYZ XYZ
XYZ XYZ -
- A Maxterm for an n variable function, a maxterm
is a sum term that contains each of the n
variables exactly one time in complemented or
uncomplemented form - Example if X, Y and Z are the input variables,
the maxterms are -
- XYZ XYZ XYZ XYZ XYZ
XYZ XYZ XYZ
19Minterms
- For functions of three variables X, Y, and Z
- The bit combination associated with each minterm
is the only bit combination for which the minterm
is equal to1. - Example X'Y'Z' 1 iff X0, Y0, and Z0
- Each bit represents one of the variables ( order
is important) - Un-complemented variable gt 1
- Complemented variable gt 0
20Maxterms
21Standard (Canonical) forms of an expression
- A switching function can be represented by
several different, but equivalent, algebraic
expressions. - The standard form is a unique algebraic
representation of each function. - Standard SOP sum of minterm form of a switching
function - Standard POS the product of maxterm form ofa
switching function - Each switching function has a unique standard SOP
and a unique standard POS.
22Deriving Boolean Expression from Truth Table
- Input Output Minterm
- A B C F term
designation - 0 0 0 1 ABC m0
- 0 0 1 0 ABC m1
- 0 1 0 0 ABC m2
- 0 1 1 1 ABC m3
- 1 0 0 0 ABC m4
- 1 0 1 0 ABC m5
- 1 1 0 0 ABC m6
- 1 1 1 0 ABC m7
F is 1 iff (A0 AND B0 AND C0) or (A0 AND
B1 AND C1) F is 1 iff (A1 AND B1 AND
C1) or (A1 AND B1 AND C1) F is 1 iff
A.B.C 1 OR A.B.C 1 F is 1 iff ABC
ABC 1 gt F ABC ABC gt F m0
m3 Short-hand notation F ? m ( 0, 3)
23Sum of minterms form
- A Boolean function is equal to the sum of
minterms for which the output is one. - gt the sum of minterms (also called the standard
SOP) form - Example F ? m ( 0, 3)
24Deriving Boolean Expression from Truth Table
- Input Output Minterm
Maxterm - A B C F term Designation
term Designation - 0 0 0 1 ABC m0
A B C M0 - 0 0 1 0 ABC m1 A
B C M1 - 0 1 0 0 ABC m2 A
B C M2 - 0 1 1 1 ABC m3 A
B C M3 - 1 0 0 0 ABC m4 A
B C M4 - 1 0 1 0 ABC m5 A
B C M5 - 1 1 0 0 ABC m6 A
B C M6 - 1 1 1 0 ABC m7 A
B C M7
F is 0 iff (ABC) 0 AND (ABC)0 AND
(ABC)0 AND (ABC) 0 AND (ABC) 0
AND (ABC) 0 gt F (ABC) . (ABC) .
(ABC) AND (ABC) . (ABC) .
(ABC) gt F M1.M2.M4.M5.M6.M7 gt F
? M(1,2,4,5,6,7)
25Product of Maxterms
- A Boolean function is equal to the product of
Maxterms for which the output is 0. - gt the product of Maxterms (also called the
standard Product of Sums) form - Example F ? M(1,2,4,5,6,7)
26Examples
- Find the truth table for the following switching
functions - F(A,B,C) ABC ABC
- F(A,B,C) AB AB AC
- F(X, Z) X Z
- F(A,B,C,D) A(B CD) ABC
- For each of the above functions, find their
Standard SOP and POS.
27Getting Standard Forms of a Switching Function
- F(A,B,C) AB AB AC
- get standard SOP and POS forms of F
- Method 1
- 1. Derive Truth Table for F
- 2. Get SOP and POS from truth table
- Method 2
- Use Shannons Expansion Theorem
28Shannons Expansion Theorem
- a) f(x1,x2,,xn) x1.f(1,x2,.,xn)
x1.f(0,x2,,xn) - b) f(x1,x2,,xn) x1 f(0,x2,.,xn) .
x1.f(1,x2,,xn)
29Incompletely Specified Functions
- The output for certain input combination is not
important (I.e. we don't care about it). - Certain input combinations never occur
- Example Design a circuit that takes as input a
BCD digit and outputs a 1 iff the parity of the
input is even. - Note A BCD digit consists of 4 bits
30Incompletely Specified Functions
Block Diagram
W
X
F
Y
Z
31Incompletely Specified Functions
F ? m ( 0, 3, 5, 6, 9)d(1015)
F ? M(1,2,4,7, 8) d(1015)