0% found this document useful (0 votes)
9 views38 pages

Module-4a

The document provides an overview of Boolean operations and expressions, including definitions of variables, complements, and literals. It outlines the basic laws of Boolean algebra such as commutative, associative, and distributive laws, along with DeMorgan's Theorems and their applications. Additionally, it includes exercises and examples for proving laws and constructing truth tables.

Uploaded by

minnieung2017
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views38 pages

Module-4a

The document provides an overview of Boolean operations and expressions, including definitions of variables, complements, and literals. It outlines the basic laws of Boolean algebra such as commutative, associative, and distributive laws, along with DeMorgan's Theorems and their applications. Additionally, it includes exercises and examples for proving laws and constructing truth tables.

Uploaded by

minnieung2017
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

1

FACULTY OF COMPUTING
Boolean Operations & Expressions

• 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 (A) or prime (A')
– If A = 1 , then A = 0

• Literal
= both variable and its complement in a term.
A + B + C à 3 literals
Resource: Nota Dr. Siti Hajar, SCK1023 (07/08-I) 2
Example:
f = x ' y'+ x ' y = x y + xy

3
Laws & Rules of Boolean Algebra

• Basic laws of BA
– Commutative Laws (Hukum Tukar Tertib)
• For addition and multiplication

– Associative Laws (Hukum Sekutuan)


• For addition and multiplication

– Distributive Laws (Hukum Taburan)

Resource: Nota Dr. Siti Hajar, SCK1023 (07/08-I) 4


Commutative Laws

• A+B=B+A
A B
A+B B+A
B A

Commutative law of addition

• AB = BA
A B
AB BA
B A

Commutative law of multiplication

Resource: Nota Dr. Siti Hajar, SCK1023 (07/08-I) 5


Associative Laws
• A + (B + C) = (A + B) + C
A A
A+B
A + (B + C)
B
B
(A + B) + C
B+C
C C
Associative law of addition

• A(BC) = (AB)C
A A
A(BC)
B

B
(AB)C
BC
C C

Associative law of multiplication 6


Resource: Nota Dr. Siti Hajar, SCK1023 (07/08-I) 6
Distributive Laws

• A(B + C) = AB + AC

B A
B+C
C B
AB + AC
A(B + C)
A
A
C

7
Resource: Nota Dr. Siti Hajar, SCK1023 (07/08-I) 7
Ex
tr
a

Exercise 4a.1:

Prove the Associate Law for A(BC) = (AB)C using truth table.

A B C AB BC A(BC) (AB)C
0 0 0 0 0 0 0
0 0 1 0 0 0 0
0 1 0 0 0 0 0
0 1 1 0 1 0 0
1 0 0 0 0 0 0
1 0 1 0 0 0 0
1 1 0 1 0 0 0
1 1 1 1 1 1 1
8
Rules of Boolean Algebra

1 A+0=A
The rules can be proven by using
1 truth table. 2 A+1=1
3 A 0=0
4 A 1=A
5 A+A=A
6 A+A=1
7 A A=A
The rules can be proven by using
2 Boolean algebra laws and rules. 8 A A=0
9 A=A
10 A
A ++AB
AB==A A
11 A + AB = A + B
12 (A + B)(A + C) = A + BC
9
Rules of Boolean Algebra: PROOF

Rule 1:
Rule 1:

A= 1 A= 0
X=1 X=0
0 0

X=A+0=A

Rule 2:
A= 1 A= 0
X=1 X=1
1 1

X=A+1=1
continue...
10
Rule 3:
Rule 3:
A= 1 A= 0
X=0 X=0
0 0

X=A 0=0
Rule 4:
Rule 4:
A= 0 A= 1
X=0 X=1
1 1

X=A 1=A
Rule 5:
Rule 5:
A= 0 A= 1
X=0 X=1
A= 0 A= 1

X=A+A=A continue...
11
11
Rule 6:

Rule 7:

continue...
12
12
Rule 8:

Rule 9:

continue...
13
13
Rules 10, 11, and 12 can be proven by
using Boolean algebra laws.

Rule 10:

Rule 11:

continue...
14
14
Rule 12:

15
15
DeMorgan’s Theorems

• To minimize the variety and number of logic gates IC.


• Provides mathematical verification for:
– NAND ≡ negative-OR
– NOR ≡ negative-AND

X X
XY X+Y
Y Y
NAND Negative-OR

X X
X+Y XY
Y Y

NOR Negative-AND
16
16
• DM theorem 1:
– The complement of a product of variables is
equal to the sum of the complements of the
variables

XY = X + Y
• DM theorem 2:
– The complement of a sum of variables is
equal to the product of the complements of
the variables

X + Y = XY 17
17
DeMorgan’s Theorems Application

DeMorgan's
DeMorgan’sTheorems
Theorem I I

XYZ = X + Y + Z

WXYZ = W + X + Y + Z

DeMorgan’sTheorem
DeMorgan's Theorem IIII

X + Y + Z = XYZ

W + X + Y + Z = WXYZ
18
Example of applying DeMorgan’s Theorems.

(AB +C)(A + BC) = (AB + C) + (A + BC)

(AB + C) + (A + BC) = (AB)C + A(BC)


(Theorem II)

(AB)C + A(BC) = (A + B)C + A(B + C)


(Theorem I)

(Theorem I) (Theorem II)

XY = X +Y X +Y = XY
19
Ex
tr
a

Self-Test:

Prove that AB is equal or not equal with AB by using the truth table.

20
Ex
tr
a

Self-Test:

Prove that AB is equal or not equal with AB by using the truth table.

Solution:
A B A B AB AB AB

21
Ex
tr
a

Self-Test:

Prove that AB is equal or not equal with AB by using the truth table.

Solution:
A B A B AB AB AB
0 0 1 1 0 1 1
0 1 1 0 0 0 1
1 0 0 1 0 0 1
1 1 0 0 1 0 0

AB ≠ AB
22
Ex
tr
a

Exercise 4a.2:

Resource: Floyd, Digital Fundamentals, 10th Edition, 2009. 23


24
25
Example: X = A(BC + D) = A (BC + D)
AND
4

OR
Logic circuit: 3

NOT
2
AND
1

1 2 3 4

26
Ex
tr
a

Exercise 4a.3:
Draw the logic circuit represented by each expression:
(i) . AB + AB
(ii) . AB + AB + ABC
(iii) . AB(C + D)

Resource: Floyd, Digital Fundamentals, 10th Edition, 2009. 27


Logic circuit to Boolean expression
• To derive the Boolean expression
for a given circuit, follow left-2-
right rule.
– Begin from the left-most inputs
and work towards the last.

1
4
C CD
Z Z(A(B + CD))
D 2
B + CD
B A(B + CD)
A 3

1 2 3 4
28
28
Ex
tr
a

Exercise 4a.4:
Determine which of the logic circuits are equivalent.

Resource: Floyd, Digital Fundamentals, 10th Edition, 2009. 29


Boolean expression to truth table

• A truth table shows the


output for all possible
input values.
• From a Boolean
expression, a truth table
can be developed.
x = number of input variables
Possible combinations of values, n = 2x

• Example:
– A(B + CD) è x = 4; n = 24=16

30
Example: F = A + B

31
Steps in construction a truth table

• Step 1: Identify x and n from the Boolean exp.

• Step 2: Find the values of the variables that


make the expression equal to 1.
(Hint: use the rules for Boolean addition and multiplication)

• Step 3: List in a table


• all the n combinations of 1s and 0s (input)
• The values of variables from step 2 (output)
• All the other output values will be 0

32
A A

B 1
B 0 1
B 1 1 B
CD
CD C D

33
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)
34
1

35
35
Example:

Given the truth table below, produce


the logic circuit (Module v3: page 116).

36
36
37
37
Example:

Produce a truth table from the following circuit.

38
38

You might also like