Boolean Algebra and Logic Gate: SSK3207 - Chapter 7 1
Boolean Algebra and Logic Gate: SSK3207 - Chapter 7 1
SSK3207 - Chapter 7 1
Topics
7.1) Basic Operations of Boolean Algebra
7.2) Relationship between basic operation
of Boolean and basic logic gate
7.3) Basic Theorems of Boolean Algebra
7.4) Relationship between Boolean
Function and Logic Circuit
SSK3207 - Chapter 7 2
7.5) Truth Table
7.6) Karnaugh Map
7.7) Example of Digital Problem
7.8) Create a Logic Circuit Using Only
NAND Gates or NOR Gates
SSK3207 - Chapter 7 3
7.1) Basic Operations of Boolean Algebra
• Boolean Algebra was introduced by George Boole
in the year 1854.
SSK3207 - Chapter 7 4
• There are 3 basic logical operations, i.e. AND (.),
OR (+) and NOT ( ).
X = NOT X
SSK3207 - Chapter 7 6
The following is a truth table for the logical operations
of AND, OR, NOT, NAND, NOR and XOR.
0 0 1 0 0 0 1 1
0 1 1 0 1 1 1 0
1 0 0 0 1 1 1 0
1 1 0 1 1 0 0 0
SSK3207 - Chapter 7 7
Summary
1. AND (symbol: .)
☞The AND operation only gives the TRUE (or value
1 in binary) result if and only if the value of all the
variables are TRUE
2. OR (symbol : +)
☞The OR operation only gives the TRUE result if the
value of one or all of the variables is/are TRUE.
3. NOT (symbol : )
☞The NOT operation will change the value of the
operand, i.e. TRUE to FALSE and vice-versa
SSK3207 - Chapter 7 8
4. NAND
☞ The NAND operation only gives the TRUE result
if one or both of the operands are FALSE
5. NOR
☞ The NOR operation only gives the TRUE result if
and only if both operands are FALSE
6. XOR
☞ The XOR operation only gives the TRUE result if
and only if only one of the operands is TRUE
SSK3207 - Chapter 7 9
7.2) Relationship Between Basic Operation
of Boolean and Basic Logic Gate
• The basic construction of a logical circuit is gates.
• The logical functions are presented through the
combination of gates.
• Gate is an electronic circuit that emits an output
signal as a result of a simple Boolean operation on
its inputs.
• The basic gates that used in a digital logic is the
same as the basic Boolean Algebra operations
such AND, OR, NOT, NAND and NOR.
SSK3207 - Chapter 7 10
• Table below shows the symbols, Boolean algebra
and the truth table for the gates
Name Graphic Symbol Boolean Algebra Truth Table
F =A.B A B F
A 0 0 0
AND B F Or
0 1 0
F = AB 1 0 0
1 1 1
A B F
A F 0 0 0
OR B
F=A+B 0 1 1
1 0 1
1 1 1
_
B
NOT A F F=A F
0 1
1 0
____ A B F
A F=A.B 0 0 0
NAND B F
Or 0 1 1
1 0 1
F = AB 1 1 1
A B F
A
_____ 0 0 0
NOR B F F =A+ B 0 1 0
1 0 0
1 1 1
SSK3207 - Chapter 7 11
7.3) Basic Theorems of Boolean Algebra
1 .A=A A.A= 0
0+A=A A+A= 1
3. Idempotent Laws 4. Boundess Laws
A+A=A A + 1 = 1
A.A=A A. 0 = 0
5. Distributive Laws 6. Order Exchange Laws
A . (B + C) = A.B + A.C A . B = B . A
A + (B . C) = (A+B) . (A+C) A+B=B+A
SSK3207 - Chapter 7 12
7. Absorption Laws 8. Associative Laws
A + (A . B) = A A + (B + C) = (A + B) + C
A . (A + B) = A A . (B . C) = (A . B) . C
9. Elimination Laws 10. De Morgan Theorem
_ ______ _ _
A + (A . B) = A + B (A + B) = A . B
_ _____ _ _
A . (A + B) = A . B (A . B) = A + B
SSK3207 - Chapter 7 13
• All the theorems and laws can be proven by
substituting the value of 0 or 1 for each
variables A, B and C based on the Truth
Table for each logical operation given.
• These theorems and laws are extremely
important in the computer environment
because it is used to simplify logical
expressions that are produced when
designing the logical circuit of the computer
SSK3207 - Chapter 7 14
7.5) Relationship Between Boolean Function
and Logic Circuit
SSK3207 - Chapter 7 15
1) F = A . B + C + D
A A.B
B
F
C
D
C+D
SSK3207 - Chapter 7 16
2) G = A . (B + C + D)
A G
C
D
SSK3207 - Chapter 7 17
7.5) Truth Table
⇨A truth table displays the relationship between
the truth values of propositions.
⇨Eg: Construct a truth table for a Boolean
function, X = A + B . C
SSK3207 - Chapter 7 18
A B C A+B A+B A+B . C
0 0 0 0 1 0
0 0 1 0 1 1
0 1 0 1 0 0
0 1 1 1 0 0
1 0 0 1 0 0
1 0 1 1 0 0
1 1 0 1 0 0
1 1 1 1 0 0
SSK3207 - Chapter 7 19
Logical Equivalence:
⇨ Two logic expressions are called logically
equivalent if and only if, they have identical values for
each of the statements variables.
Logically equivalent : X + Y = X . Y
SSK3207 - Chapter 7 20
7.6) Karnaugh Map
SSK3207 - Chapter 7 21
⇒ Example: Karnaugh Map with 2
variables, A and B
B _ B
B B A 0 1
A
_ _ _ _ 0 00 01
A A B A B
_ 1 10 11
A
A B A B
SSK3207 - Chapter 7 22
TRUTH TABLE
A B F B
A 0 1
0 0 0 00 01
0 1
1 10 11
1 0
1 1 KARNAUGH MAP
inpu outpu
t t
Relationship between Truth Table and Karnaugh Map
SSK3207 - Chapter 7 23
The number of squares in Karnaugh map depends
on the number of variables:
⇨ if n variables, there are 2n squares in the
Karnaugh Map
Example : i) 2 Variables
2² = 4 squares in the Karnaugh Map
ii) 3 Variables
2³ = 8 squares in the Karnaugh Map
SSK3207 - Chapter 7 24
The arrangement of squares in the Karnaugh
map is free as long as the adjacent squares
that are next to each other only differ by one
variable.
BC _ _ _ _ BC
BC BC BC BC A 00 01 10 11
A
_
A 000 001 011 010 0 000 001 010 011
Cannot!
SSK3207 - Chapter 7 25
Example:
a) 3 variables
AB
C _ _ _ _ _
AB C C C AB AB AB AB
_ _ _
A B 001 001
C 000 010 110 100
_
A B 010 011
C 001 011 111 101
A B 110 111
_
A B 100 101
SSK3207 - Chapter 7 26
b) 4 variables
CD
AB 00 01 11 10
SSK3207 - Chapter 7 27
Getting an expression from a Karnaugh map
Example : Given the following Truth Table with 3 inputs (A, B
and C) and 1 output (F).
A B C F
0 0 0 1
0 0 1 0
0 1 0 0 Only 4
0 1 1 1 combinations of
1 0 0 1 input that give
1 0 1 1 output, F = 1
1 1 0 0
1 1 1 0
SSK3207 - Chapter 7 28
Step 1:
⇒ Make a Karnaugh Map with 3 variables.
BC
A 00 01 11 10
Step 2:
⇒ For each output F = 1, write 1 in the square that has the same
combination of input as in the truth table.
BC
A 00 01 11 10
0 1 1
1 1 1
SSK3207 - Chapter 7 29
Step 3:
⇒ group the adjacent squares with the following steps :
SSK3207 - Chapter 7 30
BC AB C
A 00 01 11 10
BC AB
Answer : F = B C + A B + A B C
SSK3207 - Chapter 7 31
Explaination:
BC
A 00 01 11 10
0 1 1
3 variables => n = 3
1 1 1
⇨ begin grouping with 23-1 = 4 adjacent squares. (none in the above Karnaugh
map)
⇨ proceed with 23-2 = 2 adjacent squares (there are 2 in the above Karnaugh
map)
⇨ if there are still squares with value 1 that are not grouped yet, proceed with
2 3-3 = 1 square (there is one in the above Karnaugh map)
⇨ get the expression from each group of squares.
SSK3207 - Chapter 7 32
SUMMARY (3 variables) n = 3
A A
_
B B
_
C
SSK3207 - Chapter 7 33
(2) 2 adjacent squares
_
A C
BC
_ _ _ _
AB C BC BC BC
_ _
A A B
_ _
A B A B
A
_
A B
A C
SSK3207 - Chapter 7 34
Other examples
_
BC BC
BC
A A
00 01 11 10 00 01 11 10
0 1 1 0 1
1 1 1 1 1 1 1 1 1
_ AB A
C _ _
F = C + AB F =A+ BC
SSK3207 - Chapter 7 35
CD _ _ _ _
AB_ _ CD CD CD CD
AB 1 1
_
AB 1
__ __ _ _
AB
_ 1 F = C D + B D + AB C
AB 1 1 1
BC
A 00 01 11 10
0 1 1 1 _
1 1 1 1 F=B+C
B
_
SSK3207 - Chapter 7 C 36
7.7) Example of Digital Problem
SSK3207 - Chapter 7 37
1. Problem Determination
Determine the problem that has to be solved
⇨ to design a logic circuit for an alarm system
that will trigger the emergency bell if door or
window is/are opened outside office hours.
2. Conceptualization
Obtain the relevant logical variables and make a
logical table and also a truth table. Obtain the
logical expression from the truth table
SSK3207 - Chapter 7 38
• The related variables are :
Time T = 0 (work time) T = 1 (not work time)
Doors D = 0 (closed) D = 1 (opened)
Windows W = 0 (closed) W = 1 (opened)
SSK3207 - Chapter 7 39
Logic Table
INPUT OUTPUT
Time Door Window Bell
SSK3207 - Chapter 7 40
Truth Table
(based on logical table above)
INPUTS OUTPUT
T D W B
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
SSK3207 - Chapter 7 41
• B is the output or the function that we have to
find. The B function or expression can be obtained
through many methods based on the truth table.
One of the methods is by using a Karnaugh map.
• Below is the Karnaugh Map for the Truth Table
above
WD
00 01 11 10
T
0 From the Karnaugh
Map above,
1 1 1 1 B = TW + TD
TD TW
SSK3207 - Chapter 7 42
3. Solution or summary
• The expression B above can be further
summarized using theorem or the laws in Boolean
algebra
B = TW + TD
= T(W + D) (from the Law of Distribution)
4. Execution
• From the expression obtained, the following is the
logic circuit for B.
SSK3207 - Chapter 7 43
T
T(W + D)
W (W + D)
D
SSK3207 - Chapter 7 44
7.8) Building logical circuits using only
NAND or only NOR gates
• Most components in computers are built using
only type of gate either the NAND or the NOR
gates. This can further simplify the construction of
such circuits (i.e. do not need to use various gates
in a logic circuit)
• To build a circuit that only uses NAND or NOR
gates, firstly the expression for the circuit has to
be changed into an expression that only has either
the NAND or NOR operations only. To change it,
the De Morgan and Involution theorems are used.
SSK3207 - Chapter 7 45
The Involution theorem is as follow:
=
A=A
Example:
Using the logic expression in section 6.7 , B = T(W + D),
draw a logic circuit by using:
1. Only NAND gates
2. Only NOR gates
SSK3207 - Chapter 7 46
1. Using only the NAND gate
To get an expression that only uses the NAND operations,
eliminate the OR operation in the expression by using the
Involution theorem and De Morgan theorem.
B = T.(W + D)
= T. (W . D) Involution Theorem
SSK3207 - Chapter 7 47
Hence, the logic circuit for B that use only the NAND gates
can be drawn as follow:
SSK3207 - Chapter 7 48
2. Using only the NOR gate
To get an expression that only uses the NOR
operations, eliminate the AND operation in the
expression by using the Involution theorem and
the De Morgan Theorem.
B = T.(W + D)
= T + (W + D) De Morgan theorem
SSK3207 - Chapter 7 49
• The expression no longer has the AND operation
and all the OR operation has the complement sign
or NOT symbol (or the NOR operation). Hence,
the logic circuit for B that only uses the NOR
gates can be drawn as follow:
W
D
SSK3207 - Chapter 7 50