Académique Documents
Professionnel Documents
Culture Documents
Dr. I. Damaj 1
Overview
n Part 1 – Gate Circuits and Boolean Equations
n Binary Logic and Gates
n Boolean Algebra
n Standard Forms
n Part 2 – Circuit Optimization
n Two-Level Optimization
n Map Manipulation
n Multi-Level Circuit Optimization
n Part 3 – Additional Gates and Circuits
n Other Gate Types
n Exclusive-OR Operator and Gates
n High-Impedance Outputs
Dr. I. Damaj 2
1
Binary Logic and Gates
Dr. I. Damaj 3
Binary Variables
2
Logical Operations
Dr. I. Damaj 5
Notation Examples
n Examples:
n Y = A.B is read “Y is equal to A AND B.”
n z = x + y is read “z is equal to x OR y.”
n X = ~A is read “X is equal to NOT A.”
3
Operator Definitions
Dr. I. Damaj 7
Truth Tables
n Truth table − a tabular listing of the values of a function
for all possible combinations of values on its arguments.
Z=X
X Y Z = X+Y
X Y Z = X·Y X
0 0 0
0 0 0 0 1
0 1 1
0 1 0 1 0
1 0 1
1 0 0 1 1 1
1 1 1
Dr. I. Damaj 8
4
Logic Function Implementation
n Using Switches Switches in parallel => OR
n For inputs:
n logic 1 is switch closed
Dr. I. Damaj 9
Logic Gates
n In the earliest computers, switches were opened and
closed by magnetic fields produced by energizing
coils in relays. The switches in turn opened and
closed the current paths.
Dr. I. Damaj 10
5
Logic Gate Symbols and Behavior
n Logic gates have special symbols:
X X
Z 5 X·Y Z5 X1 Y X Z5 X
Y Y
AND gate OR gate NOT gate or
inverter
(a) Graphic symbols
n And waveform behavior:
X 0 0 1 1
Y 0 1 0 1
(AND) X ·Y 0 0 0 1
(OR) X1 Y 0 1 1 1
(NOT) X 1 1 0 0 11
Dr. I. Damaj
(b) Timing diagram
n Truth tables are unique; expressions and logic diagrams are not. This gives
flexibility in implementing functions.
Dr. I. Damaj 12
6
Boolean Algebra
An algebraic structure defined on a set of at least two elements, B,
together with three binary operators (denoted +, · and ~ ) that
satisfies the following basic identities:
1. X +0= X 2. X .1= X
X +1 =1 X . 0=0
3. 4.
5. X+X = X 6. .
X X =X
7. X+X =1 8. X.X = 0
9. X= X
10. X + Y =Y + X 11. XY = YX Commutative
12. (X + Y) + Z = X + (Y + Z) 13. (XY) Z = X(Y Z) Associative
14. X(Y + Z) = XY + XZ 15. X + YZ = (X + Y) (X + Z) Distributive
16. X + Y =X . Y 17. X . Y = X + Y DeMorgan’s
Dr. I. Damaj 13
n Example: F = (A + C) · B + 0
dual F = (A · C + B) · 1 = A · C + B
Dr. I. Damaj 14
7
Boolean Operator Precedence
n A + A ·B = A (Absorption Theorem)
A + A ·B
= A · 1 + A· B X=X ·1
= A · ( 1 + B) X · Y + X · Z = X ·(Y + Z)(Distributive Law)
= A·1 1+X=1
= A X·1=X
n Careful and efficient use of the identities and theorems of Boolean algebra,
and
Dr. I. Damaj 16
8
Example 2: Boolean Algebraic Proofs
AB + AC + BC = AB + AC (Consensus Theorem)
Proof:
AB + AC + BC
= AB + AC + 1 · BC
= AB +AC + (A + A) · BC
= AB +AC + ABC + ABC
= AB(1 + C) +AC (1 + B)
= AB + AC
Dr. I. Damaj 18
9
Complementing Functions
n Use DeMorgan's Theorem to complement a
function:
n Interchange AND and OR operators
n Complement each constant value and literal
n Example: Complement F
nF = (x’yz’) + (xy’z’)
n F’ = (x + y’ + z)(x’ + y + z)
Dr. I. Damaj 19
x y z F1 F2 F3 F4
0 0 0 0 0
F1 = xy z 0 0 1 0 1
F2 = x + yz 0 1 0 0 0
F3 = x y z + x y z + x y 0 1 1 0 0
F4 = x y + x z 1 0 0 0 1
1 0 1 0 1
1 1 0 1 1
1 1 1 0 1
Dr. I. Damaj 20
10
Overview – Canonical Forms
Dr. I. Damaj 21
Canonical Forms
Dr. I. Damaj 22
11
Minterms
n Minterms are AND terms with every variable present in either true
or complemented form.
Maxterms
n Maxterms are OR terms with every variable in true or
complemented form.
Dr. I. Damaj 24
12
Maxterms and Minterms
n For Minterms:
n “1” means the variable is “Not Complemented” and
n “0” means the variable is “Complemented”.
n For Maxterms:
n “0” means the variable is “Not Complemented” and
n “1” means the variable is “Complemented”.
Dr. I. Damaj 26
13
Index Example in Three Variables
Dr. I. Damaj 27
Dr. I. Damaj 28
14
Index Examples – Four Variables
n Two-variable example:
and
M2 = x + y m 2 = x·y
Thus M2 is the complement of m2 and vice-versa.
n giving:
and
Mi = m i mi = M i
Thus Mi is the complement of mi.
Dr. I. Damaj 30
15
Minterm Function Example
n Example: Find F 1 = m1 + m4 + m7
n F1 = x’y’z + xy’z’ + xyz
x y z index m1 + m4 + m7 = F1
000 0 0 + 0 + 0 =0
001 1 1 + 0 + 0 =1
010 2 0 + 0 + 0 =0
011 3 0 + 0 + 0 =0
100 4 0 + 1 + 0 =1
101 5 0 + 0 + 0 =0
110 6 0 + 0 + 0 =0
Dr. I. Damaj 111 7 0 + 0 + 1 =1 31
111 7 1 ⋅ 1 ⋅ 1 ⋅ 1 ⋅ 1 =1
16
SOP and POS
A
B
C
F = ABC + A’B’C’
A
B
C
F
Dr. I. Damaj 33
Dr. I. Damaj 34
17
Shorthand SOP and POS Forms
n F = m1 +m4+m5 +m6+m7
n This can be denoted in the formal shorthand:
F(A,B,C)=Sm(1,4,5,6,7)
n F = M1 .M4.M5.M6 .M7
n This can be denoted in the formal shorthand:
F(A,B,C)= ∏ M (1,4,5,6,7)
Dr. I. Damaj 35
Reading Assignment
Circuit Optimization
n Goal: To obtain the simplest implementation for a given function.
Dr. I. Damaj 36
18
Reading Assignment
Literal Cost
n Examples:
n F = BD + AB’C + AC’D’
n L=8
Dr. I. Damaj 37
Reading Assignment
19
Reading Assignment
n L (literal count) counts the AND inputs and the single literal OR
input.
n G (gate input count) adds the remaining OR gate inputs
n GN(gate input count with NOTs ) adds the inverter inputs
Dr. I. Damaj 39
Reading Assignment
Dr. I. Damaj 40
20
Boolean Function Optimization
n Minimizing the gate input (or literal) cost of a (a set of) Boolean equation(s)
reduces circuit cost.
n Boolean Algebra and graphical techniques are tools to minimize cost criteria
values.
n Treat optimum or near-optimum cost functions for two-level (SOP and POS)
circuits first.
Dr. I. Damaj 41
Dr. I. Damaj 42
21
Some Uses of K-Maps
Dr. I. Damaj 43
Dr. I. Damaj 44
22
K-Map and Truth Tables
n The K-Map is just a different form of the truth table.
n Example – Two variable function:
n We choose a,b,c and d from the set {0,1} to implement a particul ar
function, F(x,y).
Function Table
Input Function K-Map
Values Value
y=0 y=1
(x,y) F(x,y)
0 0 a x=0 a b
0 1 b x=1 c d
1 0 c
1 1 d
Dr. I. Damaj 45
n Example: F(x,y) = x
F=x y=0 y=1
x=0 0 0
x=1 1 1
F( x, y ) = x y + x y = x
Dr. I. Damaj 46
23
K-Map Function Representation
x=1 1 1
G( x, y ) = (x y + x y )+ (xy + x y )= x + y
Duplicate xy
Dr. I. Damaj 47
Dr. I. Damaj 48
24
Three Variable Maps
n A three-variable K-map:
n Note that if the binary value for an index differs in one bit position,
the minterms are adjacent on the K-Map
Dr. I. Damaj 49
x 4 5 7 6
x 1 4 5 7 6
z z z
z
Dr. I. Damaj 50
25
Example Functions
n By convention, we represent the minterms of F by a "1“
n Example:
y
F(x,y,z) = Σm(2,3,4,5) 0 1 3 2
1 1
n Example:
x 41 5
1 7 6
G(a,b,c) = Σm(3,4,6,7) z
n Learn the locations of the 8 y
indices based on the variable 0 1 3 2
order shown (x, most significant 1
and z, least significant) on the x 41 5 7
1 6
1
map boundaries
z
Dr. I. Damaj 51
Combining Squares
n By combining squares, we reduce number of literals in a
product term, reducing the literal cost, thereby reducing
the other two cost criteria.
n On a 3-variable K-Map:
n One square represents a minterm with three variables
n Two adjacent squares represent a product term with
two variables
n Four “adjacent” terms represent a product term with
one variable
n Eight “adjacent” terms is the function of all ones (no
variables) = 1.
Dr. I. Damaj 52
26
Example: Combining Squares
y
n Example: Let yz
x 00 01 11 10
F = Σm(2,3,6,7) 0 0 1 3
1 2
1
x 1 4 5 77
1 6
1
z
n Applying the Minimization Theorem three times:
F( x, y, z ) = x y z + x y z + x y z + x y z
= yz + y z
= y
n Thus the four terms that form a 2 × 2 square
correspond to the term "y".
Dr. I. Damaj 53
Three-Variable Maps
n Reduced literal product terms for SOP standard forms
correspond to rectangles on K-maps containing cell
counts that are powers of 2.
Dr. I. Damaj 54
27
Three-Variable Maps
n Topological warps of 3-variable K-maps that
show all adjacencies:
§ Venn Diagram ¢ Cylinder
0 4 X
6 7 5
Y 3 1Z
2
Dr. I. Damaj 55
Three-Variable Maps
n Example Shapes of 2-cell Rectangles:
y
0 1 3 2
4 5 7 6
x
z
n Read off the product terms for the rectangles
shown
Dr. I. Damaj 56
28
Three-Variable Maps
n Example Shapes of 4-cell Rectangles:
y
0 1 3 2
4 5 7 6
x
z
n Read off the product terms for the rectangles
shown
Dr. I. Damaj 57
z
F(X,Y,Z) = Z + X’Y
Dr. I. Damaj 58
29
Example
Dr. I. Damaj 59
Example
Dr. I. Damaj 60
30
Three-Variable Map Simplification
Dr. I. Damaj 61
01 4 5 7 6
12 15 14 X
11 13
W 11 10
8 9
10
Z
Dr. I. Damaj 62
31
Four Variable Terms
Dr. I. Damaj 63
Four-Variable Maps
n Example Shapes of Rectangles:
Y
0 1 3 2
4 5 7 6
12 13 15 14 X
W
8 9 11 10
64
Dr. I. Damaj
Z
32
Four-Variable Maps
n Example Shapes of Rectangles:
Y
0 1 3 2
4 5 7 6
12 13 15 14 X
W
8 9 11 10
Dr. I. Damaj 65
Z
Four-Variable Maps
n Example Shapes of Rectangles:
Dr. I. Damaj 66
33
Four-Variable Maps
Dr. I. Damaj 67
Dr. I. Damaj 68
34
Four-Variable Map Simplification
n F(W, X, Y, Z) = Σ m(3,4,5,7,9,13,14,15)
Dr. I. Damaj 69
n By placing “don't cares ” ( an “x” entry) in the function table or map, the
cost of the logic circuit may be lowered.
n Example 1: A logic function having the binary codes for the BCD digits
as its inputs. Only the codes for 0 through 9 are used. The six codes,
1010 through 1111 never occur, so the output values for these codes
are “x” to represent “don’t cares.”
Dr. I. Damaj 70
35
Example
Dr. I. Damaj 71
Multiple-Level Optimization
Dr. I. Damaj 72
36
Reading Assignment
Transformations
n Factoring - finding a factored form from SOP
or POS expression
n Algebraic - No use of axioms specific to
Boolean algebra such as complements or
idempotence
n Boolean - Uses axioms unique to Boolean
algebra
Reading Assignment
Transformations (continued)
n Substitution of G into F - expression function
F as a function of G and some or all of its
original variables
Dr. I. Damaj 74
37
Reading Assignment
Transformation Examples
n Algebraic Factoring
F = A’C’D’ + A’BC’ + ABC + ACD’ -- G = 16
n Factoring:
n F = A’(C’D’ + BC’) + A (BC + CD’) -- G = 16
n Factoring again:
n F = A’C’(B + D’) + AC (B + D’) -- G = 12
n Factoring again:
F = (A’C’ + AC) (B + D’) -- G = 10
Dr. I. Damaj 75
Reading Assignment
Transformation Examples
n Decomposition
n The terms B + D’ and A’C’+ AC can be
defined as new functions E and H respectively,
decomposing F:
Dr. I. Damaj 76
38
Reading Assignment
Transformation Examples
n Substitution of E into F
n Returning to F just before the final factoring step:
nF = A’C’(B + D’) + AC (B + D’) -- G = 12
Dr. I. Damaj 77
Reading Assignment
Transformation Examples
n Elimination
n Beginning with a new set of functions:
nX=B+C
nY=A+B
n Z = A’X + C Y G = 10
n This has increased the cost, but has provided a new SOP expression for
two-level optimization.
Dr. I. Damaj 78
39
Reading Assignment
Transformation Examples
n Two-level Optimization
n The result of 2-level optimization is:
Z = A’B + C G=4
Reading Assignment
Transformation Examples
n Extraction
n Beginning with two functions:
E = A’B’D’ + A’BD
H = B’CD’ + BCD G = 16
n Finding a common factor and defining it as a function:
F = B’D’ + BD
n We perform extraction by expressing E and H as the
three functions:
F = B’D’ + BD, E = A’F, H = CF G = 10
n The reduced cost G results from the sharing of logic
between the two output functions
Dr. I. Damaj 80
40
Other Gate Types
n Why?
n Implementation feasibility and low cost
n Power in implementing Boolean functions
n Convenient conceptual representation
n Gate classifications
n Primitive gate - a gate that can be described using a
single primitive operation type (AND or OR) plus an
optional inversion(s).
n Complex gate - a gate that requires more than one
primitive operation type for its description
n Primitive gates will be covered first
Dr. I. Damaj 81
Buffer
n A buffer is a gate with the function F = X:
X F
Dr. I. Damaj 82
41
NAND Gate
n The basic NAND gate has the following symbol,
illustrated for three inputs:
n AND-Invert (NAND)
X
Y F( X, Y, Z) = X ×Y ×Z
Z
Dr. I. Damaj 83
NOR Gate
n The basic NOR gate has the following symbol,
illustrated for three inputs:
n OR-Invert (NOR)
X
Y F( X, Y, Z) = X +Y+ Z
Z
Dr. I. Damaj 84
42
Exclusive OR/ Exclusive NOR
n The eXclusive OR (XOR) function is an important Boolean
function used extensively in logic circuits.
Dr. I. Damaj 85
n Definitions
n The XOR function is: X ⊕ Y = X Y + X Y
n The eXclusive NOR (XNOR) function, otherwise
X ⊕ Y = X Y + XY
known as equivalence is:
43
Truth Tables for XOR/XNOR
n Operator Rules: XOR XNOR
X Y X⊕Y X Y (X ⊕ Y)
or X ≡ Y
0 0 0
0 0 1
0 1 1
1 0 1 0 1 0
1 1 0 1 0 0
1 1 1
n The XOR function means:
X OR Y, but NOT BOTH
XOR/XNOR (Continued)
n The XOR function can be extended to 3 or more variables. For
more than 2 variables, it is called an odd function or modulo 2
sum (Mod 2 sum), not an XOR:
X ⊕ Y⊕ Z = XYZ + XYZ + X YZ + X YZ
n The complement of the odd function is the even function.
n The XOR identities:
X⊕0= X X ⊕1 = X
X⊕X = 0 X⊕X =1
X ⊕ Y = Y⊕ X
( X ⊕ Y) ⊕ Z = X ⊕ ( Y ⊕ Z) = X ⊕ Y ⊕ Z
Dr. I. Damaj 88
44
Symbols For XOR and XNOR
n XOR symbol:
n XNOR symbol:
Dr. I. Damaj 89
XOR Implementations
n The simple SOP implementation uses the following
X
structure:
X Y
Y
n A NAND only implementation is:
X Y
Y 90
Dr. I. Damaj
45
Reading Assignment
Reading Assignment
Dr. I. Damaj 92
46
Reading Assignment
Dr. I. Damaj 93
Reading Assignment
Parity Generators and Checkers
47
Hi-Impedance Outputs
n Logic gates introduced thus far
n have 1 and 0 output values,
n cannot have their outputs connected together, and
n transmit signals on connections in only one direction.
Dr. I. Damaj 95
Dr. I. Damaj 96
48
Reading Assignment
Transmission Gates
n The transmission gate is one of the designs for an
electronic switch for connecting and disconnecting
two points in a circuit.
Dr. I. Damaj 97
Reading Assignment
A TG0
A C TG1 TG0 F
C F 0 0 No path Path 0
0 1 Path No path 1
(a) (b)
n The basis for the function implementation is TG-
controlled paths to the output
Dr. I. Damaj 98
49
Problems
n No. 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.10,
2.12, 2.14, 2.15, 2.16, 2.17, 2.18, 2.19, 2.20,
2.21, 2.22, 2.23, 2.24, 2.27, 2.31, 2.32, 2.34.
Dr. I. Damaj 99
50