Module 4a Boolean Algebra (Student)
Module 4a Boolean Algebra (Student)
• Variable (Pembolehubah)
– A symbol that represents a logical quantity
– Usually italic uppercase (A, B, C, D)
– A single variable can have a 1 or 0 value
• Complement (Pelengkap)
– The inverse of a variable
– Indicated by an overbar (Ā) or prime (A’)
– If A = 1 , then Ā = 0
• Literal
= both variable and its complement in a term.
– Ā + B + C è 3 literals
1
FACULTY OF COMPUTER SCIENCE & INFORMATION SYSTEM Resource: Nota Dr. Siti Hajar, SCK1023 (07/08-I) 2
• AB = BA • A(BC) = (AB)C
A A
A B A(BC)
AB BA B
B A
B
Commutative law of multiplication (AB)C
BC
C C
2012/2013-I @m 1
10/4/12
Ex
tr
Distributive Laws a
Exercise 4a.1:
• A(B + C) = AB + AC
Prove the Associate Law for A(BC) = (AB)C using truth table.
B A
B+C A B C AB BC A(BC) (AB)C
C B 0 0 0
AB + AC 0 0 1
A(B + C) 0 1 0
A
A
0 1 1
C
1 0 0
1 0 1
1 1 0
1 1 1
7 8
Resource: Nota Dr. Siti Hajar, SCK1023 (07/08-I) 7
1 A+0=A
The rules can be proven by using
1 truth table. 2 A+1=1
3 A 0=0 Rule 1:
4 A 1=A A= 1 A= 0
5 A+A=A X=1 X=0
0 0
6 A+A=1
X=A+0=A
7 A A=A
The rules can be proven by using
2 Boolean algebra laws and rules. 8 A A=0 Rule 2:
9 A=A A= 1 A= 0
X=1 X=1
10 A
A ++AB
AB==A A 1 1
11 A + AB = A + B
X=A+1=1
12 (A + B)(A + C) = A + BC continue...
9 10
Rule 3:
A= 1 A= 0
X=0 X=0
0 0
X=A 0=0
Rule 4:
A= 0 A= 1
X=0 X=1
1 1
X=A 1=A
Rule 5:
A= 0 A= 1
X=0 X=1
A= 0 A= 1
X=A+A=A continue...
11 continue...
12
11 12
2012/2013-I @m 2
10/4/12
continue...
13 continue...
14
13 14
DeMorgan’s Theorems
X X
XY X+Y
Y Y
NAND Negative-OR
X X
X+Y XY
Y Y
NOR Negative-AND
15 16
15 16
DeMorgan's Theorems I
• DM theorem 1:
– The complement of a product of variables is XYZ = X + Y + Z
equal to the sum of the complements of the
variables
WXYZ = W + X + Y + Z
XY = X + Y
• DM theorem 2: DeMorgan's Theorem II
– The complement of a sum of variables is
equal to the product of the complements of X + Y + Z = XYZ
the variables
W + X + Y + Z = WXYZ
X + Y = XY 17
17 18
2012/2013-I @m 3
10/4/12
Ex
tr
a
(AB +C)(A + BC) = (AB + C) + (A + BC) Prove that AB is equal or not equal with AB by using the truth table.
XY = X + Y X + Y = XY
19 20
Ex
tr
a
Exercise 4a.2:
Example: (BC + D)
AND
OR
NOT
AND
Logic circuit
23 24
2012/2013-I @m 4
10/4/12
Ex
tr
a Logic circuit to Boolean expression
• To derive the Boolean expression for a given circuit,
follow left-2-right rule.
Exercise 4a.3: – Begin from the left-most inputs and work towards the
Draw the logic circuit represented by each expression: last.
(i) AB. + AB
(ii) AB
. + AB + ABC 1
4
(iii) AB(C
. + D) C CD
Z Z(A(B + CD))
D 2
B + CD
B A(B + CD)
A 3
1 2 3 4
26
Resource: Floyd, Digital Fundamentals, 10th Edition, 2009. 25 26
Ex
tr
a Boolean expression to truth table
Exercise 4a.4:
Determine which of the logic circuits are equivalent. • A truth table shows the output for all possible
input values.
• From a Boolean expression, a truth table can
be developed.
• Example:
– A(B + CD) è x = 4; n = 24=16
Example: F = A + B
• Step 1: Identify x and n from the Boolean exp.
29 30
2012/2013-I @m 5
10/4/12
Ti
ps
• Tips on ‘table-making’:
– For n possible combinations, the input part of
the table will register the binary value of 0 to
n-1.
– (e.g. n = 16; 0 to 15)
24 22 21 20
– Remember the sequence
8 4 2 1
0 0 0 0 (0)
0 0 0 1 (1)
0 0 1 0 (2)
0 0 1 1 (3)
32
31
Example:
33 34
33 34
Example:
35 36
35 36
2012/2013-I @m 6