chapter 4
chapter 4
1
Boolean Operations & Expressions
Variable
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
The inverse of a variable
Indicated by an over bar (Ā) or prime (A’)
If A = 1 , then Ā = 0
Literal = both variable and its complement in a term.
Ā + B + C 3 literals
2
Laws & Rules of Boolean Algebra
Basic laws of BA
1. Commutative Laws
For addition and multiplication
2. Associative Laws
For addition and multiplication
3. Distributive Laws
1. Commutative Laws
3
2. 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
A(B + C) = AB + AC
B A
B+C
C B
AB + AC
A(B + C)
A
A
C
5
Rules of Boolean Algebra
1 A+0=A
2 A+1=1
3 A 0=0
4 A 1=A
5 A+A=A
6 A+A=1
7 A A=A
8 A A=0
9 A=A
10 A + AB = A
11 A + AB = A + B
12 (A + B)(A + C) = A + BC
6
Rules of Boolean Algebra: Proof
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
7
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
8
Rule 6:
A= 0 A= 1
X=1 X=1
A= 1 A= 0
X=A+A=1
Rule 7:
A= 0 A= 1
X=0 X=1
A= 0 A= 1
X=A A=A
Rule 8:
A= 1 A= 0
X=0 X=0
A=0 A=1
X=A A=0
Rule 9:
A =0
A =1
A= 1 A=1
A= 0 A=0
A=A
9
Rules 10, 11 and 12 can be proven using BA laws.
Rule 10:
A + AB = A(1 + B) Factoring (distributive law)
=A.1 Rule 2: (1 + B) = 1
=A Rule 4: A . 1 = A
Rule 11:
A + AB = (A + AB) + AB Rule 10: A = A + AB
= (AA + AB) + AB Rule 7: A = AA
= AA + AB + AA + AB Rule 8: adding AA = 0
= (A + A)(A + B) Factoring
= 1 . (A + B) Rule 6: A + A = 1
= A+B Rule 4: drop the 1
Rule 12:
(A + B)(A + C) = AA + AC + AB + BC Distributive law
= A + AC + AB + BC Rule 7: AA = A
= A(1 + C) + AB + BC Factoring (distributive law)
= A . 1 + AB + BC Rule 2: 1 + C = 1
= A(1 + B) + BC Factoring (distributive law)
= A . 1 + BC Rule 2: 1 + B = 1 10
= A + BC Rule 4: A . 1 = A
DeMorgan’s Theorems
12
Examples for DeMorgan’s Theorems
13
Constructing a Truth Table for a Logic Circuit
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
E.g. A(B + CD) x = 4; n = 24=16
Steps in constructing 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)
14
All the other output values will be 0
Example A(B + CD)
Step 1: x = 4 ; n = 2x = 24 = 16
Step 2:
A(B + CD) = 1 • 1 = 1 A = 1
What makes B + CD = 1?
B + CD = 1 + 0 = 1
B + CD = 0 + 1 = 1
B + CD = 1 + 1 = 1 B = 1 or 0
What makes CD = 1?
CD = 1 . 1 = 1 C = 1; D = 1
So for A(B + CD) = 1
A = 1, B = 1, C = 0/1, D = 1/0
A = 1, B = 1/0 , C = 1, D = 1
15
Step 3 : Fill in the grid and results from Step 2
INPUTS OUTPUT
A B C D A(B + CD)
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
16
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)
Simplification using Boolean Algebra
Simplification:
To reduce an expression to its simplest form
To change a form to a more convenient one for
efficient implementation
We use:- basic laws, rules, theorems of Boolean
algebra
17
Example
Assignment:
18
Standard Form of Boolean Expressions
Boolean expression can be converted into one of 2 standards
forms:
The sum-of-products (SOP) form
The product-of-sums (POS) form
Standardization makes the evaluation, simplification, and
implementation of Boolean expressions more systematic and
easier
Product term = a term with the product (Boolean
multiplication) of literals
Sum term = a term with the sum (Boolean addition) of literals
The Sum-of-Products (SOP) Form
SOP = when 2 or more product terms are summed
e.g ABP1 + ABCP2
ABCP1 + CDEP2 + BCDP3
SOP can also contain a single variable term 19
In SOP a single overbar cannot extend over more than 1
variable, but more than 1 variable can have an overbar.
20
A logic expression can be changed to SOP form using
Boolean algebra techniques.
A(B + CD) = AB + ACD
AB + B(CD + EF) = AB + BCD + BEF
Standard SOP form = where all the variables in the
domain appear in each product term in the expression.
21
Convert this Boolean expression to standard SOP form:
Domain = A, B, C, D.
What is missing?
Term 1: missing D or D’
Term 2: missing (C/C’) and (D/D’)
Complete these terms by applying Boolean rule 6
Term 1: ABC ABC( D D) ABCD ABC D
Now we have
ABC AB ABC D
ABCD ABC D ABCD ABC D ABC D ABC D ABC D
22
Binary representation of a standard product term
23
Determine the binary value for which the following standard SOP
expression is equal to 1:
ABCD = 1.1.1.1 = 1
The term ABCD is equal to 1 when A = 1, B = 0, C = 0, and D = 1
ABCD = 1.0.0.1 = 1.1.1.1 = 1
The term ABCD is equal to 1 when A = 0, B = 0, C = 0, and D = 0
ABCD = 0.0.0.0 = 1.1.1.1 = 1
The SOP expression equals 1 when any or all of the three product
terms is 1.
24
Product-of-Sums (POS) Form
A B C A B C
Domain = a set of variables contained in an expression
(A + B + C)(A + B + D)(A + B + C + D) domain = A,
B, C, D
25
Implementation of the POS expression (A + B(B + C + D)(A + C)
A
B
B
C X = (A + B)(B + C + D)(A + C)
D
A
C
32
C C
0 1 0 1
AB AB
00 00 ABC ABC
01 01 ABC ABC
3-Variable Karnaugh Map
11 11 ABC ABC
10 10 ABC ABC
CD CD
00 01 11 10 00 01 11 10
AB AB
00 00 ABCD ABCD ABCD ABCD
33
K-Map SOP Minimization
K-Map is used to simplify Boolean expressions to their
minimum form.
A minimized SOP expression has the fewest possible
term with each term having fewest possible variables.
A minimized SOP expression needs fewer logic gates
than standard expression.
To map an SOP expression to a map:
Step 1: determine the binary value of each product term
Step 2: Place a 1 in a cell that have the same value as the
product term
Example: Map SOP expression of ABC + ABC + ABC + ABC
01
34
11 1
10 1
Map the following expression
ABCD + ABCD + ABCD + ABCD + ABCD + ABCD + ABCD
ABCD
CD
AB 00 01 11 10
00 1 1 ABCD
01 1
ABCD
11 1 1 1
ABCD 10 1 ABCD
ABCD ABCD
35
To use K-maps, expressions must be in standard form.
For expressions that are not standard, it must be
converted to a standard form.
Recall: AB + ABC
AB(C/C’) 11(1/0) ABC + ABC’
So: ABC + ABC’ + ABC
Map the following expression on a K-map:
C
A + AB + ABC 0 1
AB
000 100 110
00 1 1
001 101
010 01 1 1
011
11 1
10 1 1
36
K-Map Simplification of SOP Expressions
There are 3 steps to obtain a minimum SOP
expression from a K-map.
1. Grouping the 1s
2. Determine product term for each group
3. Summing the resulting product terms
Group must contain cells in 2x combination (i.e.
1,2,4,8,16
Each cell must be adjacent to at least 1 other cell in
the group, but all cells in a group need not be adjacent
Try to have the biggest possible group of 1s
Each 1 must be in at least one group.
The 1s already in a group may be included in another
group so long as the overlapping group includes non-
common 1s 37
(a) (b) (c) (d)
C C CD CD
AB 0 1 AB 0 1 00 01 11 10 AB 00 01 11 10
AB
00 1 00 1 1 00 1 1 00 1 1
01 1 01 1 01 1 1 1 1 01 1 1 1
11 1 1 11 1 11 11 1 1 1
10 10 1 1 10 1 1 10 1 1 1
C C
AB 0 1 0 1 CD CD
AB AB 00 01 11 10 AB 00 01 11 10
00 1 00 1 1
00 1 1 00 1 1
01 1 01 1 01 1 1 1
01 1 1 1 1
11 1 1 11 1 11 1 1 1
11
10 10 1 1 10 1 1 1
10 1 1