Professional Documents
Culture Documents
Chapter 1
Logic Gates and Boolean Algebra
Topic 1 : Boolean Logic & Logic Gates
Boolean Logic
Binary logic consists of :
• logic variables
o designated by alphabet letters, e.g. A, B, C… x, y, z, etc.
o have ONLY 2 possible values: 1 or 0
• logic operators
o 3 basic logical operators representing 3 basic logical operations: AND, OR and NOT
• Each logic gate represents a single processing unit that performs binary logic operations.
Truth Table
• Truth table is a table of all possible combinations of the input binary variables.
• Truth tables show the relationship between the input binary values that the output binary result of
the operation.
a
2¹
0
1
2² a b 0 0 0
0 0 0 0 1
0 1 0 1 0
1 0 0 1 1
1 1 1 0 0
1 0 1
1 1 0
1 1 1
A (23) = 8 B (22) = 4 C (21) = 2 D (20) = 1
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
Timing Diagram
• Timing diagram is a graphical representation that describe the relationship between input(s) and
output signals in a digital circuit system.
• In actual implementation, the input and output signals are electrical signals that can be categorized
into binary logic state of 1 or 0 based the defined range of voltages associated with each state.
• Input signal can either static (e.g. logic state 0 if grounded) or dynamic (e.g. if received input from
flip flops)
AND Gates
• Truth Table
• Symbol dot (.) or none
A B Y
• Boolean Equation 0 0 0
o A . B = Y or AB = Y
0 1 0
• Output variable is 1 if all input variables is 1 1 0 0
1 1 1
• Logic Gate:
AND Gates
• Truth Table
• Boolean Equation
o A . B. C = Y or ABC = Y A B C Y
0 0 0 0
• Logic Gate:
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
OR Gates
• Truth Table
• Symbol plus (+)
A B Y
• Boolean Equation 0 0 0
o A+B =Y
0 1 1
• Output variable is 1 if any input variables is 1 1 0 1
1 1 1
• Logic Gate:
OR Gates
• Truth Table
• Boolean Equation
o A+B+C =Y A B C Y
0 0 0 0
• Logic Gate:
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
NOT Gates
• Truth Table
• Symbol prime(‘) or overbar ( ‾ )
A Y
• Boolean Equation 1 0
o = Y or A‘ = Y
0 1
• Output variable is always opposite of input variable
• Logic Gate:
NAND Gates
• Truth Table
• A combination of AND operation followed by NOT
A B AB AB’
• Boolean Equation 0 0 0 1
o = Y or = Y (A.B)’ = Y AB’ = Y
0 1 0 1
• Logic Gate: 1 0 0 1
1 1 1 0
NOR Gates
• Truth Table
• A combination of OR operation followed by NOT
A B A+B Y
• Boolean Equation 0 0 0 1
o =Y
0 1 1 0
• Logic Gate: 1 0 1 0
1 1 1 0
XOR Gates
• Truth Table
• Exclusive OR (XOR)
A B A’ B’ AB’ A’B Y Y’
• Symbol
0 0 1 1 0 0 0 1
• Boolean Equation 0 1 1 0 0 1 1 0
o AB’ + A’B = Y 1 0 0 1 1 0 1 0
o AB=Y
1 1 0 0 0 0 0 1
• Logic Gate:
XNOR Gates
• Truth Table
• Exclusive NOR (XNOR)
A B Y
• Symbol (A B)’ 0 0 1
0 1 0
• Boolean Equation
o AB + A’B’ = Y 1 0 0
o (A B)’ = Y 1 1 1
• Logic Gate:
NAND and NOR gates
• Digital circuits are more frequently constructed with NAND or NOR gates rather than with AND or
OR gates.
• The main reason behind this is that NAND and NOR gates are easier to fabricate with electronic
components.
NAND and NOR gates
• Exclusive OR gates are often used for error detection and correction purposes.
• This is done by using XOR gates in building the parity generator and checker digital logic circuits.
Topic 2 : Boolean Algebra
Boolean Algebra
• Boolean Algebra is used to simplify the design of digital logic circuits.
Simpler design
Complicated Boolean Algebra with less digital
design with logic circuits
many digital
logic circuits Both performs similar function
but the latter is cheaper
B = {0,1}
• A two valued Boolean Algebra reflects the basis for digital logic circuit (i.e. whereby digital signals
being the IO to the digital logic circuit can only be either 0 or 1).
a b c ab ac F
0 0 0 0 0 0
0 0 1 0 0 0
0 1 0 0 0 0
0 1 1 0 0 0
1 0 0 0 0 0
1 0 1 0 1 1
1 1 0 1 0 1
1 1 1 1 1 1
Boolean Algebra
• Postulate 1: Closure
The Boolean system is closed with respect to binary operator + and . since for every
possible combination of Boolean values from set {1, 0} , it produces a Boolean result from
set {1, 0}.
Boolean Algebra
• Postulate 2: Identity Element
The element 0 is an identity element with respect to + operator:
a+ 0=a a 0
0 0 0
1 0 1
a+ b=b+a
a. b=b.a
Boolean Algebra
• Postulate 4: Associative
Associativity of the + operation
a + (b + c) = (a + b) + c
a . (b . c) = (a . b) . c
Boolean Algebra
• Postulate 5: Distributive
Distributivity of the + operation
a + (b . c) = (a + b) . (a + c)
a . (b + c) = (a . b) + (a . c)
Boolean Algebra
• Postulate 6: Complement
For every a in K set, there exists a unique element called a’ (complement of a) such that
a a'
a + a’ = 1
0 1 1
1 0 1
a a'
and 0 1 0
1 0 0
a . a’ = 0
Boolean Algebra
• Duality
If an expression is valid in Boolean Algebra, the dual of the expression is also valid.
Example : a + (b . c) = (a + b) . (a + c)
Thus thorough duality : a . (b + c) = (a . b) + (a . c)
Boolean Algebra
• Theorem 1: Idempotency
The output value does not change by its input multiplication whereby:
x x
x+x=x
0 0 0
and based on duality property: 1 1 1
x.x=x x x
0 0 0
1 1 1
Boolean Algebra
• Theorem 2: Null Element
The output value is not affected by the changes in the input value, whereby:
x 1
x+1=1 0 1 1
and based on duality property: 1 1 1
x.0=0 x 0
0 0 0
1 0 0
Boolean Algebra
• Theorem 3: Involution
The double inverse output value of an input is equivalent to the input:
(x’’) = x
x x' x‘’
0 1 0
1 0 1
Boolean Algebra
• Theorem 4: Redundancy a + (b . c) = (a + b) . (a + c)
Proving: a . (b + c) = (a . b) + (a . c)
a + (a’ . b)
= (a + a’).(a + b) (via Postulate 5: Distributive) a + a’ = 1
= (1)(a+b) (via Postulate 6: Complement)
= a+ b (via Postulate 2: Identity Element) a.1=a
a b a + (a’.b) a+b
0 0 0 + (1 . 0) = 0 0+0=0
0 1 0 + (1 . 1) = 1 0+1=1
1 0 1 + (0 . 0) = 1 1+0=1
1 1 1 + (0 . 1) = 1 1+1=1
Boolean Algebra
• Theorem 5: DeMorgan’s Law
This theorem is based on DeMorgan’s Law, whereby:
= .
and based on duality property:
= +
Boolean Algebra
• Theorem 6: Absorption
This theorem is the result of the application of several other theorems that neglects a
certain input variable, whereby:
𝒂 .( 𝒂+ 𝒃)= 𝒂
Boolean Algebra
• Theorem 6: Absorption
a + (b . c) = (a + b) . (a + c)
Proving:
a + (a . b) =Y (via Postulate 5: Distributive)
F1 = x . (x’ + y)
F2= x . y
Logic Design Simplification
• Simplify the following Boolean function
= AC + A’BC + A’CC
= AC + A’BC + A’C
= AC + A’C(B + 1)
= AC + A’C
= C(A + A’)
= C(1)
=C
(A+C) . (AD + AD’) + AC + C
= AAD + AAD’ + ACD + ACD’ + AC + C
= AD + AD’ + ACD + ACD’ + AC + C
= AD + AD’ + C(AD + AD’ + A + 1)
= AD + AD’ + C(1)
= AD + AD’ + C
= A(D + D’) + C
= A(1) + C
=A+C
Topic 4 : Boolean Algebra Representation
Boolean Algebra Representation
• A Boolean Algebraic representation can appear in any of the following forms:
Sum of Minterms
canonical form
Product of Maxterms
• Example:
contain AND terms with one or more input binary variables
• Example:
contain OR terms with one or more input binary variables
• Example:
contain minterms with similar input binary variables
&
Must be consistent
Sum of Minterms
• Each input binary variable in a minterm can be associated with a binary value, whereby:
• normal form = 1 (e.g. x = 1)
x y z minterm designation F1
• complement form = 0 (e.g. x’ = 0)
0 0 0 x’y’z’ m0 0
• Example: If given F1: 0 0 1 x’y’z m1 0
F1 = xy’z’+ xy’z+ xyz 0 1 0 x’yz’ m2 0
0 1 1 x’yz m3 0
• the equivalence
1 0 0 xy’z’ m4 1
F1 = m4 + m5 + m7 1 0 1 xy’z m5 1
= ∑ (m4, m5, m7)
1 1 0 xyz’ m6 0
• Thus, output is only associated with binary 1
1 1 1 xyz m7 1
x y z minterm designation F1
0 0 0 x’y’z’ m0 0
normal form = 1 (e.g. x = 1)
0 0 1 x’y’z m1 0
Sum of Minterms Boolean expression for F1. 0 1 0 x’yz’ m2 1
• = M2 + M3 + M4 0 1 1 x’yz m3 1
1 0 0 xy’z’ m4 1
• = 010 + 011 + 100
1 0 1 xy’z m5 0
• = x’yz’ + x’yz + xy’z’
1 1 0 xyz’ m6 0
1 1 1 xyz m7 0
Product of Maxterm Boolean expression for F1
• = M0 . M1 . M5 . M6 . M7
• = 000 . 001 . 101 . 110 . 111
• = (x+y+z) . (x+y+z’) . (x’+y+z’) . (x’+y’+z) . (x’+y’+z’)
Sum of Minterms
• Exercise
• Example:
contain maxterms with similar input binary variables
0 0 0 x+y+z M0 0
0 0 1 x+y+z’ M1 1
0 1 0 x+y’+z M2 1
0 1 1 x+y’+z’ M3 0
1 0 0 x’+y+z M4 0
1 0 1 x’+y+z’ M5 0
1 1 0 x’+y’+z M6 1
1 1 1 x’+y’+z’ M7 0
Product of Maxtrems
• Exercise
Sum of Product of
Minterms Maxterms
x y z Y
0 0 0 0
0 0 1 0
0 1 0 0 • Derive the Sum of Minterms Boolean expression for Y.
• Derive the Product of Maxterms Boolean expression for Y.
0 1 1 1
• Prove that both expressions are equal.
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
Sum of Minterms & Product of Maxterm Conversion
• Answer:
x y z Y m M
0 0 0 0 m0 M0
Sum of Minterms
Y1 = m3 + m5 + m6 + m7 0 0 1 0 m1 M1
= x’yz + xy’z + xyz’ + xyz 0 1 0 0 m2 M2
0 1 1 1 m3 M3
1 0 0 0 m4 M4
Product of Maxterms
1 0 1 1 m5 M5
Y2 = M0.M1.M2.M4
= (x+y+z)(x+y+z’) (x+y’+z) (x’+y+z) 1 1 0 1 m6 M6
1 1 1 1 m7 M7
Sum of Minterms & Product of Maxterm Conversion
• Answer: x y z Y m M
Proving: 0 0 0 0 m0 M0
Sum of Minterms = 0 0 1 0 m1 M1
0 1 0 0 m2 M2
Product of Maxterms
0 1 1 1 m3 M3
Y1 = m3 + m5 + m6 + m7
1 0 0 0 m4 M4
(Y1)’= m0+m1+m2+m4
1 0 1 1 m5 M5
Y1 = (Y1’)’= (m0+m1+m2+m4)’
1 1 0 1 m6 M6
Y1=M0.M1.M2.M4 = Y2
1 1 1 1 m7 M7
a + b’c
a + a’ = 1
= a(1) + b’c via Identity Element
= a(b + b’) + (b’c) via Complement a . a’ = 0
= ab + ab’ + b’c via Distributive
= (ab + ab’)(1) + (b’c)(1) via Identity Element
= (ab + ab’)(c+c’) + b’c(a + a’) via Complement
= abc + abc’ + ab’c + ab’c’ + ab’c + a’b’c via Distributive
= abc + abc’ + ab’c + ab’c’ + a’b’c via Idempotency
Conversion between Boolean Algebra Representations
• Convert the following Boolean Function
F(x, y, z) = xy +x’z
• to its canonical Product of Maxterms form.
F(x, y, z) = xy +x’z
to its canonical Product of Maxterms form.
(2nd step – convert Sum of Minterms into Product of Maxterms)
F(x,y,z)= m7+m6+m3+m1 Sum of Minterms
Thus F (x, y, z)’= m5+m4+m2+m0= xy’z + xy’z’+x’yz’+x’y’z’
F(x,y,z)={F (x, y, z)’}’
=(xy’z + xy’z’+x’yz’+x’y’z’)’ via Involution
=(xy’z)’ . (xy’z’)’.(x’yz’)’+(x’y’z’)’ via DeMorgan’s
=(x’+y’’+z’).(x’+y’’+z’’).(x’’+y’+z’’).(x’’+y’’+z’’) via DeMorgan’s
=(x’+y+z’).(x’+y+z).(x+y’+z).(x+y+z) via Involution
= M5 + M4+M2+M0 Product of Maxterms
Topic 5 : Karnaugh map (K-Map)
Karnaugh Map (K-Map)
• In Topic 2, we have learned how to simplify the design of digital logic circuits by manipulating
Boolean Algebra. However, this method lacks of standardization.
• There is another alternative of design simplification which is through the use of Karnaugh Map or
K-Map.
• Karnaugh Map (or K-Map) is a 2D pictorial form of a truth table that describes the relationship
between input and output variables.
Minimizing Steps:
1. Before start minimizing the equation using K-Map, convert Sum of Minterms
Sum of Product format
the equation from Sum of Product to Sum of Minterms or format
• Group as many cells as possible. The larger the group, the fewer number of
input variables.
• E.g.
Group 1: xy’
• E.g.
yz
x 00 01 11 10
0
1
Exercise 2
• Simplify the following equation using Karnaugh map:
yz
x 00 01 11 10
0
1
Exercise 3
• Simplify the following equation using Karnaugh map:
• The X can be replaced by either 1 or 0, depending on which combination that gives the simplest
expression.
Don’t Care Terms
By using K-map, simplify the following equation: xyz Designation
F(x, y, z)= ∑(5,6,7) 000 m0
= xy’z + xyz’ + xyz 101 110 111
001 m1
whereby the ‘don’t care’ terms:
010 m2
d(x, y, z)= ∑(3,4) yz
x 00 01 11 10 011 m3
= x’yz + xy’z ‘ 011 100
0 0 0 X 0 100 m4
1 X 1 1 1 101 m5
110 m6
yz Group 1 = x
x 00 01 11 10 111 m7
0 0 0 X 0 F(x, y, z)= xz + xy
F(x, y, z)= x
1 X 1 1 1
Don’t Care Terms
By using K-map, simplify the following equation: abcd Designation abcd Designation
0000 m0 1000 m8
F(a, b, c, d)= ∑(1,3,7,11,15)
0001 m1 1001 m9
whereby the ‘don’t care’ terms:
0010 m2 1010 m10
d(a, b, c, d)= ∑(0,2,5) 0011 m3 1011 m11
0100 m4 1100 m12
cd
ab 00 01 11 10
00 X 1 1 X
01 0 X 1 0 F(a, b,c, d)= a’b’ + cd
11 0 0 1 0
10 0 0 1 0
Don’t Care Terms
Solution 2 :
cd
ab 00 01 11 10
00 X 1 1 X
01 0 X 1 0
F(a, b,c, d)= a’d + cd
11 0 0 1 0
10 0 0 1 0
End of module
Questions??