Professional Documents
Culture Documents
SAK3207 Chapter 3a 2
3.6) Truth Table
3.7) Karnaugh Map
3.8) Example of Digital Problem
3.9) Create a Logic Circuit Using
Suitable Gates
3.10) Create a Logic Circuit Using Only
NAND Gates or NOR Gates
SAK3207 Chapter 3a 3
Objectives
• A brief review of Boolean Algebra – a
mathematical foundation of digital logic
• Introduce concept of a gate
• Describe combinational and sequential
circuits which are constructed from gates
Overview
• Operation of most computers is based on
binary systems
• Binary number 1 and 0 called
propositional logic TRUE or FALSE
• Stated as functions of other propositions
which are connected by the three basic
logical connectives: AND, OR and NOT
An example
• I will take an umbrella with me IF AND ONLY IF
it is raining OR the weather forecast is bad
Rain
OR Take Umbrella
Bad Weather
\Forecast
Input propositions OR connective Output proposition
Example:
A AND B = A.B
A OR B = A + B
NOT A = Ā
• These operations are used to combine
operands to form logical expressions
X or NOT (X)
X.Y + Z or NOT (X AND Y) OR Z
(X.Y) + (Y.Z) or (X AND NOT(Y)) OR (Y AND Z)
Try: A + (B.C)
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
Relationship Between Basic Operation of
Boolean and Basic Logic Gate
• The basic construction of a logical circuit is gates
• Gate is an electronic circuit that emits an output
signal as a result of a simple Boolean operation on
its inputs
• Logical function is presented through the
combination of gates
• The basic gates used in digital logic is the same as
the basic Boolean algebra operations (e.g., AND,
OR, NOT,…)
• The package Truth Tables and Boolean Algebra set out the
basic principles of logic.
• Any Boolean algebra operation can be associated with an
electronic circuit in which the inputs and outputs represent
the statements of Boolean algebra.
• Although these circuits may be complex, they may all be
constructed from three basic devices. These are the AND
gate, the OR gate and the NOT gate.
• the symbols, algebra signs 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 F
NOT A F F=A 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
Basic Theorems of Boolean Algebra
Identity Elements : 1.A =A
0+A=A
Boundess Laws : A.0 =0
A+1=1
Chapter 3
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
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
Truth Table
Truth Table
A = 0, B = 0, C = 1, Q = 0
A B C Q
A = 1, B = 0, C = 1, Q = 0
0 0 1 0
A = 0, B = 1, C = 1, Q = 0
1 0 1 0
A = 1, B = 1, C = 0, Q = 1
0 1 1 0
1 1 0 1
Truth Table A B Q
0 0 0
1 0 1
0 1 0
1 1 0
p q r p.q q q+r
0 0 0 0 1 1
0 0 1 0 1 1
0 1 0 0 0 0
0 1 1 0 0 1
1 0 0 0 1 1
1 0 1 0 1 1
1 1 0 1 0 0
1 1 1 1 0 1
p q p+q p.(p+q) p.q p.p (p.p)+(p.q)
0 0 0 0 0 0 0
0 1 1 0 0 0 0
1 0 1 1 0 1 1
1 1 1 1 1 1 1
Logically equivalent
p.(p+q) = (p.p)+(p.q)
Relationship Between Boolean
Function and Logic Circuit
A A.B = AB
B
F
= AB + C + D
C
D
C+D
G = A . (B + C + D)
A
G = A . (B + C + D)
B
B+C+D
C
C+D
D
A
A AB
B B Q
= AB + B
A B A AB Q
0 0 1 0 0
0 1 1 1 1
1 0 0 0 0
1 1 0 0 1
Elimination Laws: A.(A + B) = A.B
A B A A + B A.B A.(A + B)
0 0 1 1 0 0
0 1 1 1 0 0
1 0 0 0 0 0
1 1 0 1 1 1
A A+B
A
B
A.(A+B)
A
De Morgan Theorem : (A + B) = A . B
A B A+B A B A.B (A + B)
0 0 0 1 1 1 1
0 1 1 1 0 0 0
1 0 1 0 1 0 0
1 1 1 0 0 0 0
AB 100 101
4 variables, A, B, C, D 24 = 16 squares
CD
AB CD CD CD CD
AB 0000 0001
AB 0100
AB 1100
AB 1000
00 01 11 10
AB
• The adjacent differ by C AB AB AB AB
only one variable 000 010 110 100
0 C
• List combinations in
the order 00, 01, 11, 10 1 C 001 011 111 101
C 0 1
AB C C
00 AB 000 001
01 AB 010 011
AB 110 111
11
10 AB 100 101
How to create Karnaugh Map
Truth Table
A B C F
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1 1. Place 1 in the corresponding
1 0 1 1 square
1 1 0 0
1 1 1 0 Karnaugh Map
BC BC BC BC BC
A 00 01 11 10
A 0
1 1
A 1
1 1
Karnaugh Maps to Represent Boolean Functions
AB 00 01 11 10
AB AB AB AB
1 1
F = AB + AB
BC 00 01 11 10
A BC BC BC BC
A 1 1 ABC
A 1 ABC
ABC
11 AB 1
10 AB 1
ABCD ABCD
A 0
1 1
A 1
1 1
Represent Boolean Functions
2. Group the adjacent squares:
Begin grouping square with 2n-1 for n variables
• e.g. 3 variables, A, B, and C
23-1 = 22 = 4
= 21 = 2
= 20 = 1
BC BC BC BC BC
A 00 01 11 10
A 0
1 1
A 1
1 1
AB ABC F = BC + AB + ABC
BC
3 variables:
BC BC BC BC BC 23-1 = 22 = 4
A 00 01 11 10
22-1 = 21 = 2
1 1 21-1 = 20 = 1
A 0
A 1
1 1 1
AB
C
F = C + AB
3 variables:
BC BC BC BC BC 23-1 = 22 = 4
A 00 01 11 10
22-1 = 21 = 2
1 21-1 = 20 = 1
A 0 BC
A 1
1 1 1 1
F = A + BC
4 variables, A, B, C, D 24-1 = 23 = 8 (maximum); 22 = 4;
21 = 2; 20 = 1 (minimum);
CD
AB 00 01 11 10
00 1 1
01 1
11 1
10 1 1 1
F= CD + BD + ABC
CD
AB 00 01 11 10
00
01 1 1
F = ABD
11
10
CD
AB 00 01 11 10
00 1
01 F = BCD
11
10 1
CD
AB 00 01 11 10
00
01 1 1
1 1
F = BC
11
10
CD
AB 00 01 11 10
00 1 1 1 1
01 1 1 1 1
F= A
11
10
CD
AB 00 01 11 10
00 1 1
01 1 1
F= D
11 1 1
10 1 1
Example of Digital Problem
To build a logic circuit of an Alarm System at the office (with one
door and one window) that will ring if the door or window is/are
opened after working hours.
Followings are the steps that are to be taken to build a logical circuit.
1. Problem Determination
-- Determine the problem that has to be solved
-- A logical circuit that will trigger the emergency bell if door or
window is/are opened outside office hours has to be built
2. Conceptualization
- Obtain the relevant logical variable and make a logical table and
also a truth table. Obtain the logical expression from the truth table
• 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)
• Whether Bell B will ring (1) or will not ring (0) depends
on all three logical variables (depending on the
condition or problem given)
Logic Table
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
• B is the output or the function that we have to find. The B
function or expression can be obtained through many was
based on the truth table above. 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
From the Karnaugh Map
above,
0 B = TW + TD
1 1 1 1
TD TW
W (W + D)
D
Building logical circuits using only
NAND or only NOR gates
• Most components in computers are built using only
either the NAND or the NOR. This can further
simplify the construction of such circuits (i.e. do
not need to use various gates in a logic circuit)
Example:
Take the B expression B = T(W + D) as an example.
= T. (W . D) De Morgan theorem
= T. (W . D) Involution Theorem
• Hence, the logic circuit for B that only uses the NAND gate
can be drawn as follow:
T
D
2. Using only the NOR gate
• To get an expression that only uses the NOR gate, eliminate the
AND operation in the expression by using the Involution Theorem
and the De Morgan Theorem.
Example:
B = T.(W + D)
= T . (W + D) Involution Theorem
= T + (W + D) De Morgan theorem
• It is found that the expression produced 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 L that
only uses the NOR gate can be drawn as follow:
W
D
Circuits from NAND and NOR gates