Escolar Documentos
Profissional Documentos
Cultura Documentos
Rain
OR Take Umbrella
Bad
Weather
\Forecast Output proposition
Input propositions OR connective
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
Match the items on the right with the items on the left.
X-OR
b) Gives a 1 if either Input A
or Input B is a 1, but not both.
OR
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
Exercise 1
• Apply De Morgan theorem to the following
equations:
F=V+A+L
F=A+B+C+D
• Verify the following expressions:
S.T + V.W + R.S.T = S.T + V.W
A.B + A.C + B.A = A.B + A.C
Relationship Between Boolean
Function and Logic Circuit
Boolean function Q = AB + B
= (NOT A AND B) OR B
Logic circuit
A
A AB
B B Q
= AB + B
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
Try to work out the output of the combination.
C = A.B
A = 0, B = 0, C = ?, Q = ? C = 1, Q = 0
A = 1, B = 0, C = ?, Q = ? C = 1, Q = 0
A = 0, B = 1, C = ?, Q = ? C = 1, Q = 0
A = 1, B = 1, C = ?, Q = ? C = 0, Q = 1
Truth Table
The Exclusive OR gate (XOR)
A
B Output
A B OUTPUT
0 0 0
1 0 1
0 1 1
1 1 0
The NAND gate
A
Output
B
For the NAND gate the truth table looks like this:
A B OUTPUT
0 0 1
1 0 1
0 1 1
1 1 0
The NOR gate
A
Output
B
For the NOR gate the truth table looks like this:
A B OUTPUT
0 0 1
1 0 0
0 1 0
1 1 0
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
A
A AB
B B Q
= AB + B
0 0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
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
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
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)
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 A+ B
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
G = A . (B + C + D)
Karnaugh Map
• A graphical way of depicting the content of a truth table
where the adjacent expressions differ by only one variable
• For the purposes simplification, the Karnaugh map is a
convenient way of representing a Boolean function of a
small number (up to four) of variables
• The map is an array of 2n squares, representing all possible
combination of values of n binary variables
• Example: 2 variables, A and B
B B
A B B 1 0
A
A AB AB 00 01
0
A AB AB 1 10 11
• The number of squares in Karnaugh map depends
on the number of variables
• e.g., if 2 variables, A, and B, there are 22 = 4
squares in the Karnaugh map
• e.g., if 3 variables, A, B, and C, there are 23=8
squares
C AB
AB C C AB AB AB AB
C
AB 000 001 000
C
AB 010 011
C 001
or
110 111
AB
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 AB AB AB AB
C
only one variable 000 010 110 100
• List combinations in 0 C
C 0 1
AB C C
00 AB 000 001
01 AB 010 011
AB 110 111
11
10 AB 100 101
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
1 1
A 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
1 1
A 1
BC AB ABC F = BC + AB + ABC
3 variables:
BC BC BC BC BC 23-1 = 22 = 4
A 00 01 11 10
22-1 = 21 = 2
A 0
1 1 21-1 = 20 = 1
1 1 1
A 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
A 0
1 21-1 = 20 = 1
BC
1 1 1 1
A 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
1 1
11
10 1 1
The following diagram illustrates some of the possible pairs of
values for which simplification is possible:
Karnaugh Map
Boolean Function
Logic Circuit
Exercise 3
Transform the following truth table to Karnaugh Map and
find the Boolean function
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
INPUT VARIABLES OUTPUT
Time Door Window Bell
1 1 1 1
TD TW
• 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)
• From the expression obtained, the logical circuit
for B= T(W + D) is as follow :
T
T(W + D)
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)
• 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. To change it, the De
Morgan and Involution Theorems are used.
The Involution Theorem is as follow:
A=A
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