Professional Documents
Culture Documents
Computer Fundamentals
Pradeep K. Sinha
Priti Sinha
Chapter 6
Boolean Algebra
and Logic Circuits
Chapter 06: Boolean Algebra and Logic Circuits Slide 1/86
Learning Objectives
Boolean algebra
Fundamental concepts and basic laws of Boolean
algebra
Boolean function and minimization
Logic gates
Logic circuits and Boolean expressions
Combinational circuits and their design
1
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Boolean Algebra
Boolean Algebra
Ref. Page 63 Chapter 06: Boolean Algebra and Logic Circuits Slide 4/86
2
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Ref. Page 64 Chapter 06: Boolean Algebra and Logic Circuits Slide 5/86
A + B = C A B = C
0 0 0 0 0 0 A A
0 1 1 0 1 0
0 1
1 0 1 1 0 0
1 1 1 1 1 1 1 0
Truth Table for OR (+) Truth Table for AND (.) Truth Table for NOT (-)
Ref. Page 64 Chapter 06: Boolean Algebra and Logic Circuits Slide 6/86
3
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Operator Precedence
Ref. Page 65 Chapter 06: Boolean Algebra and Logic Circuits Slide 7/86
Operator Precedence
X + Y Z
Ref. Page 65 Chapter 06: Boolean Algebra and Logic Circuits Slide 8/86
4
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Postulate 2:
(a) x + 0 = x
(b) x 1 = x
Ref. Page 65 Chapter 06: Boolean Algebra and Logic Circuits Slide 9/86
Postulate 6:
x x
(a) x + =1
(b) x =0
Ref. Page 65 Chapter 06: Boolean Algebra and Logic Circuits Slide 10/86
5
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
For example, in the table below, the second row is obtained from
the first row and vice versa simply by interchanging + with .
and 0 with 1
Ref. Page 66 Chapter 06: Boolean Algebra and Logic Circuits Slide 11/86
2 x+1=1 x0=0
4 x =x Involution Law
5 x (x + y ) = x y x +x y = x + y
Ref. Page 66 Chapter 06: Boolean Algebra and Logic Circuits Slide 12/86
6
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Ref. Page 66 Chapter 06: Boolean Algebra and Logic Circuits Slide 13/86
Theorem:
x+xy=x
Proof:
L.H.S.
= x+xy
= x1+xy by postulate 2(b)
= x (1 + y) by postulate 5(a)
= x (y + 1) by postulate 3(a)
= x1 by theorem 2(a)
= x by postulate 2(b)
= R.H.S.
Ref. Page 67 Chapter 06: Boolean Algebra and Logic Circuits Slide 14/86
7
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Proving a Theorem by Perfect Induction
(Example)
Theorem:
x + x y = x
=
x y xy x+xy
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
Ref. Page 67 Chapter 06: Boolean Algebra and Logic Circuits Slide 15/86
Theorem:
x+x=x
Proof:
L.H.S.
=x+x
= (x + x) 1 by postulate 2(b)
= (x + x) (x + X) by postulate 6(a)
= x + x X by postulate 5(b)
=x+0 by postulate 6(b)
=x by postulate 2(a)
= R.H.S.
Ref. Page 66 Chapter 06: Boolean Algebra and Logic Circuits Slide 16/86
8
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Proving a Theorem by the
Principle of Duality (Example)
Dual Theorem:
xx=x
Proof:
L.H.S.
=xx
Notice that each step of
=xx+0 by postulate 2(a)
the proof of the dual
= x x + x X by postulate 6(b)
theorem is derived from
= x (x + X ) by postulate 5(a) the proof of its
=x1 by postulate 6(a) corresponding pair in
=x by postulate 2(b) the original theorem
= R.H.S.
Ref. Page 66 Chapter 06: Boolean Algebra and Logic Circuits Slide 17/86
Boolean Functions
9
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Boolean Functions
Binary variables
An algebraic expression, or
A truth table
Ref. Page 70 Chapter 06: Boolean Algebra and Logic Circuits Slide 19/86
W = X + Y Z
Variable W is a function of X, Y, and Z, can also be
written as W = f (X, Y, Z)
Ref. Page 70 Chapter 06: Boolean Algebra and Logic Circuits Slide 20/86
10
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
X Y Z W
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
W= X+ Y Z
Ref. Page 70 Chapter 06: Boolean Algebra and Logic Circuits Slide 21/86
Ref. Page 70 Chapter 06: Boolean Algebra and Logic Circuits Slide 22/86
11
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Ref. Page 71 Chapter 06: Boolean Algebra and Logic Circuits Slide 23/86
F1 = x y z + x y z + x y
F1 has 3 literals (x, y, z) and 3 terms
F2 = x y + x z
F2 has 3 literals (x, y, z) and 2 terms
Ref. Page 71 Chapter 06: Boolean Algebra and Logic Circuits Slide 24/86
12
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
x y z F1 F2
0 0 0 0 0
0 0 1 1 1
0 1 0 0 0
0 1 1 1 1
1 0 0 1 1
1 0 1 1 1
1 1 0 0 0
1 1 1 0 0
Ref. Page 71 Chapter 06: Boolean Algebra and Logic Circuits Slide 25/86
(a ) x + x y
(
(b ) x x + y )
(c ) x y z + x y z + x y
(d ) x y + x z + y z
(e ) ( x + y ) ( x + z ) ( y +z )
Ref. Page 71 Chapter 06: Boolean Algebra and Logic Circuits Slide 26/86
13
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
A +A +A +...+A = A A A ... A
1 2 3 n 1 2 3 n
A A A ... A = A +A +A +...+A
1 2 3 n 1 2 3 n
Ref. Page 72 Chapter 06: Boolean Algebra and Logic Circuits Slide 27/86
F = x y z+ x y z
1
( x + y +z ) ( x + y +z )
Now we complement each literal giving
F = ( x + y +z ) ( x + y + z )
1
Ref Page. 73 Chapter 06: Boolean Algebra and Logic Circuits Slide 28/86
14
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Ref. Page 74 Chapter 06: Boolean Algebra and Logic Circuits Slide 29/86
0 0 1
x y z m 1 x + y + z M 1
0 1 0
x y z m 2 x + y + z M 2
0 1 1
x y z m 3 x + y + z M 3
1 0 0 x y z m 4 x + y + z M 4
1 0 1 x y z m 5 x + y + z M 5
1 1 0 x y z m 6
x + y + z M 6
1 1 1 x y z m 7
x + y + z M 7
Note that each minterm is the complement of its corresponding maxterm and vice-versa
Ref. Page 75 Chapter 06: Boolean Algebra and Logic Circuits Slide 30/86
15
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
x x+ y
x + y z x y+z
xy + xy xy + x yz
Ref. Page 75 Chapter 06: Boolean Algebra and Logic Circuits Slide 31/86
Ref. Page 75 Chapter 06: Boolean Algebra and Logic Circuits Slide 32/86
16
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Expressing a Function in its
Sum-of-Products Form (Example)
x y z F1
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
Ref. Page 75 Chapter 06: Boolean Algebra and Logic Circuits Slide 33/86
x y z, x y z, and x y z
Taking the OR of these minterms, we get
Ref. Page 75 Chapter 06: Boolean Algebra and Logic Circuits Slide 34/86
17
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
x ( x+y )( x+ y )( x+y )
x+y ( x + y )( x+ y+z )
( x+y ) z ( x+y )( x+ y )
Ref. Page 77 Chapter 06: Boolean Algebra and Logic Circuits Slide 35/86
Ref. Page 77 Chapter 06: Boolean Algebra and Logic Circuits Slide 36/86
18
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Expressing a Function in its
Product-of-Sums Form
x y z F1
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
Ref. Page 77 Chapter 06: Boolean Algebra and Logic Circuits Slide 37/86
( x+y+ z ) , ( x+ y+ z ), ( x+ y+ z ) ,
( x+y+ z ) and ( x+ y+ z )
Taking the AND of these maxterms, we get:
F1 ( x,y,z ) = ( 0,2,3,5,6 )
Ref. Page 77 Chapter 06: Boolean Algebra and Logic Circuits Slide 38/86
19
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Conversion Between Canonical Forms
(Sum-of-Products and Product-of-Sums)
Example:
( ) ( ) (
F x,y,z = 0,2,4,5 = 1,3,6,7 )
F( x,y,z ) = (1,4,7 ) = ( 0,2,3,5,6 )
Ref. Page 78 Chapter 06: Boolean Algebra and Logic Circuits Slide 39/86
Logic Gates
20
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Logic Gates
Ref. Page 79 Chapter 06: Boolean Algebra and Logic Circuits Slide 41/86
AND Gate
Ref. Page 80 Chapter 06: Boolean Algebra and Logic Circuits Slide 42/86
21
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
AND Gate (Block Diagram Symbol
and Truth Table)
A
C= AB
B
Inputs Output
A B C=AB
0 0 0
0 1 0
1 0 0
1 1 1
Ref. Page 80 Chapter 06: Boolean Algebra and Logic Circuits Slide 43/86
OR Gate
Ref. Page 80 Chapter 06: Boolean Algebra and Logic Circuits Slide 44/86
22
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
OR Gate (Block Diagram Symbol
and Truth Table)
A
C=A+B
B
Inputs Output
A B C=A +B
0 0 0
0 1 1
1 0 1
1 1 1
Ref. Page 80 Chapter 06: Boolean Algebra and Logic Circuits Slide 45/86
NOT Gate
Ref. Page 81 Chapter 06: Boolean Algebra and Logic Circuits Slide 46/86
23
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
NOT Gate (Block Diagram Symbol
and Truth Table)
A A
Input Output
A A
0 1
1 0
Ref. Page 81 Chapter 06: Boolean Algebra and Logic Circuits Slide 47/86
NAND Gate
Ref. Page 82 Chapter 06: Boolean Algebra and Logic Circuits Slide 48/86
24
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
NAND Gate (Block Diagram Symbol
and Truth Table)
A
B C= A B= A B= A +B
Inputs Output
A B C = A +B
0 0 1
0 1 1
1 0 1
1 1 0
Ref. Page 82 Chapter 06: Boolean Algebra and Logic Circuits Slide 49/86
NOR Gate
Complemented OR gate
Ref. Page 82 Chapter 06: Boolean Algebra and Logic Circuits Slide 50/86
25
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
NOR Gate (Block Diagram Symbol
and Truth Table)
A
B C= A B=A + B=A B
Inputs Output
A B C =A B
0 0 1
0 1 0
1 0 0
1 1 0
Ref. Page 82 Chapter 06: Boolean Algebra and Logic Circuits Slide 51/86
Logic Cicruits
26
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Logic Circuits
The three logic gates (AND, OR, and NOT) are logically
complete because any Boolean expression can be
realized as a logic circuit using only these three gates
Ref. Page 83 Chapter 06: Boolean Algebra and Logic Circuits Slide 53/86
A
A
NOT D= A (B + C )
B B+C AND
C
OR
Ref. Page 83 Chapter 06: Boolean Algebra and Logic Circuits Slide 54/86
27
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Finding Boolean Expression
of a Logic Circuit (Example 2)
OR
A A +B
B
(
C= ( A +B ) A B )
A B A B AND
AND NOT
Ref. Page 85 Chapter 06: Boolean Algebra and Logic Circuits Slide 55/86
Boolean Expression = A B + C
AND
A A B
B
A B + C
C
OR
Ref. Page 86 Chapter 06: Boolean Algebra and Logic Circuits Slide 56/86
28
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Constructing a Logic Circuit from a Boolean
Expression (Example 2)
Boolean Expression = A B + C D + E F
AND NOT
A A B A B
B
AND AND
C C D
D A B + C D + E F
AND
E E F E F
F NOT
Ref. Page 86 Chapter 06: Boolean Algebra and Logic Circuits Slide 57/86
Ref. Page 87 Chapter 06: Boolean Algebra and Logic Circuits Slide 58/86
29
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Implementation of NOT, AND and OR
Gates by NAND Gates
A A = A + A = A
A
(a) NOT gate implementation.
A A B A B = A B
B
(b) AND gate implementation.
Ref. Page 87 Chapter 06: Boolean Algebra and Logic Circuits Slide 59/86
A A = A
A
A B = A + B = A + B
B B = B
B
(c) OR gate implementation.
Ref. Page 87 Chapter 06: Boolean Algebra and Logic Circuits Slide 60/86
30
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Method of Implementing a Boolean
Expression with Only NAND Gates
Ref. Page 88 Chapter 06: Boolean Algebra and Logic Circuits Slide 61/86
Boolean Expression = A B + C ( A + B D )
A A B
A B + C ( A + B D )
B
B B D
D A +B D
A
C C ( A +B D )
Ref. Page 89 Chapter 06: Boolean Algebra and Logic Circuits Slide 62/86
31
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Implementing a Boolean Expression with
Only NAND Gates (Example)
AND
OR
A A B
1
B
5
AND OR
B B D
2
D A+B D
A B + C ( A+B D )
3
AND
C ( A+B D )
4
C
Ref. Page 89 Chapter 06: Boolean Algebra and Logic Circuits Slide 63/86
A
1
B A B + C ( A +B D )
5
B
2
D
3
A
4
C
Ref. Page 89 Chapter 06: Boolean Algebra and Logic Circuits Slide 64/86
32
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Ref. Page 91 Chapter 06: Boolean Algebra and Logic Circuits Slide 65/86
A + A = A A = A
A
A A +B A + B=A +B
B
Ref. Page 91 Chapter 06: Boolean Algebra and Logic Circuits Slide 66/86
33
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Implementation of NOT, OR and AND
Gates by NOR Gates
A A +A=A
A + B = A B = A B
B + B =B
B
Ref. Page 91 Chapter 06: Boolean Algebra and Logic Circuits Slide 67/86
Ref. Page 92 Chapter 06: Boolean Algebra and Logic Circuits Slide 68/86
34
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Implementing a Boolean Expression with
Only NOR Gates (Examples)
Boolean Expression A B + C ( A +B D )
=
A A B
B A B + C ( A +B D )
B B D
D A +B D
A
C C ( A +B D )
(a) Step 1: AND/OR implementation.
Ref. Page 93 Chapter 06: Boolean Algebra and Logic Circuits Slide 69/86
AN
A D
A B
1
OR
A B + C ( A +B D )
B
5 6
AN
B D
B D
2
D OR
AN
3 D
A
C ( A +B D )
4
C
A +B D
(b) Step 2: Substituting equivalent NOR functions.
(Continued on next slide)
Ref. Page 93 Chapter 06: Boolean Algebra and Logic Circuits Slide 70/86
35
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Implementing a Boolean Expression with
Only NOR Gates (Examples)
A 1
B A B + C ( A +B D )
5 6
B 2
D
3
A
4
C
(c) Step 3: NOR implementation.
Ref. Page 93 Chapter 06: Boolean Algebra and Logic Circuits Slide 71/86
Exclusive-OR Function
A B =A B + A B
A C = A B = A B+ A B
B
A C = A B = A B+ A B
B
Also, ( A B ) C = A (B C ) = A B C
Ref. Page 94 Chapter 06: Boolean Algebra and Logic Circuits Slide 72/86
36
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Inputs Output
A B C =A B
0 0 0
0 1 1
1 0 1
1 1 0
Ref. Page 94 Chapter 06: Boolean Algebra and Logic Circuits Slide 73/86
A B = A B+ A B
A C = A B = A B+ A B
B
Also, (A B) = A (B C) = A B C
Ref. Page 94 Chapter 06: Boolean Algebra and Logic Circuits Slide 74/86
37
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Inputs Output
A B C=AB
0 0 1
0 1 0
1 0 0
1 1 1
Ref. Page 94 Chapter 06: Boolean Algebra and Logic Circuits Slide 75/86
Design of
Combinational Circuits
38
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Ref. Page 95 Chapter 06: Boolean Algebra and Logic Circuits Slide 77/86
Inputs Outputs
A B C S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
S = A B+ A B
Boolean functions for the two outputs.
C = A B
Ref. Page 96 Chapter 06: Boolean Algebra and Logic Circuits Slide 78/86
39
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Designing a Combinational Circuit
Example 1 Half-Adder Design
A A B
A
S = A B+ A B
B
B A B
A
B C = A B
Ref. Page 96 Chapter 06: Boolean Algebra and Logic Circuits Slide 79/86
Inputs Outputs
A B D C S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
Truth table for a full adder
(Continued on next slide)
Ref. Page 97 Chapter 06: Boolean Algebra and Logic Circuits Slide 80/86
40
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Designing a Combinational Circuit
Example 2 Full-Adder Design
S = A B D+ A B D+ A B D+ A B D
C = A B D+ A B D+ A B D+ A B D
= A B+ A D+B D (when simplified)
Ref. Page 97 Chapter 06: Boolean Algebra and Logic Circuits Slide 81/86
A A B D
B
D
A A B D
B
D
S
A
B A B D
D
A A B D
B
D
Ref. Page 98 Chapter 06: Boolean Algebra and Logic Circuits Slide 82/86
41
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
Designing a Combinational Circuit
Example 2 Full-Adder Design
A A B
B
A A D
C
D
B BD
D
Ref. Page 98 Chapter 06: Boolean Algebra and Logic Circuits Slide 83/86
AB
A
C
HA AB+ AB = A B ( A B) D
B
HA
D S
A B D
Ref. Page 98 Chapter 06: Boolean Algebra and Logic Circuits Slide 84/86
42
Computer Fundamentals : Pradeep K. Sinha & Priti Sinha
A4 A3 A2 A1
B4 B3 B2 B1
FA FA FA HA
Carry Carry Carry
S5 S4 S3 S2 S1
Ref. Page 99 Chapter 06: Boolean Algebra and Logic Circuits Slide 85/86
Key Words/Phrases
Absorption law Equivalence function NOT gate
AND gate Exclusive-OR function Operator precedence
Associative law Exhaustive enumeration OR gate
Boolean algebra method Parallel Binary Adder
Boolean expression Half-adder Perfect induction
Boolean functions Idempotent law method
Boolean identities Involution law Postulates of Boolean
Canonical forms for Literal algebra
Boolean functions Logic circuits Principle of duality
Combinational logic Logic gates Product-of-Sums
circuits Logical addition expression
Cumulative law Logical multiplication Standard forms
Complement of a Maxterms Sum-of Products
function Minimization of Boolean expression
Complementation functions Truth table
De Morgans law Minterms Universal NAND gate
Distributive law NAND gate Universal NOR gate
Dual identities
43