0% found this document useful (0 votes)
44 views30 pages

Unit 3.3

1. The document discusses Boolean functions and how to derive them from truth tables using sum-of-products and product-of-sums expressions. 2. It also covers minimizing Boolean functions using Karnaugh maps, which arrange the truth table in a two-dimensional grid to group ones and find simplified expressions as sums of products. 3. Examples are provided to demonstrate deriving simplified expressions from truth tables and Karnaugh maps with up to 5 variables.

Uploaded by

Marwa Barbou
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)
44 views30 pages

Unit 3.3

1. The document discusses Boolean functions and how to derive them from truth tables using sum-of-products and product-of-sums expressions. 2. It also covers minimizing Boolean functions using Karnaugh maps, which arrange the truth table in a two-dimensional grid to group ones and find simplified expressions as sums of products. 3. Examples are provided to demonstrate deriving simplified expressions from truth tables and Karnaugh maps with up to 5 variables.

Uploaded by

Marwa Barbou
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/ 30

Boolean functions from truth

tables and simplification methods

Unit 3.3
Boolean functions from truth tables
- Boolean function → truth table
- How can I do it?. Evaluate the function for each
combination of the inputs
- Truth tables → Boolean function.
- A Boolean function can be done as:
- Sum-of-products (SOP). Example:
- Product-of-sums (POS). Example:

- How can I do it? Review the following slides


Sum-of-products (SOP)
Rule: Look for 1’s in the truth table
Note that F(A,B,C,D)=1 for the following combinations:
0011 (3), 1011 (11), 1110 (14), 1111 (15)

If A-B-C-D=0-0-1-1, the expression ABCD will be 1


If A-B-C-D=1-0-1-1, the expression ABCD will be 1
If A-B-C-D=1-1-1-0, the expression ABCD will be 1.
If A-B-C-D=1-1-1-1, the expression ABCD will be 1.

Therefore, F is equal to 1 if at least one of these cases occurs

F= ABCD + ABCD + ABCD+ ABCD  F is obtained as a SOP

product terms
Product-of-sums (POS)
Rule: Look for 0’s in the truth table.
Note that F(A,B,C,D) = 0 for the following combinations:
0010(2),0100(4),0111(7),1010(10),1101(13)

If A-B-C-D=0-0-1-0, the expression A+B+C+D will be 0


If A-B-C-D=0-1-0-0, the expression A+B+C+D will be 0
If A-B-C-D=0-1-1-1, the expression A+B+C+D will be 0
If A-B-C-D=1-0-1-0, the expression A+B+C+D will be 0
If A-B-C-D=1-1-0-1, the expression A+B+C+D will be 0
Therefore, F is equal to 0 if at least one of these cases occurs

F=(A+B+C+D)(A+B+C+D)(A+B+C+D)(A+B+C+D)(A+B+C+D)
 F is obtained as a POS
sum terms
Minimization of logic functions

• A logic function can have several equivalent expressions


- The simplest expression will lead us to the best implementation
• Optimization criteria:
- Area or size:
- Logic gates with less inputs
- Speed or delay:
- Smallest number of logic gates from input to output
• We will focus on area optimization
Minimization of logic functions
• Optimization methods
• Manual: direct application of Boolean Algebra laws
- Very difficult, unsystematic
• Two level (Karnaugh maps): find an optimal expression as a sum of
products or a product of sums
- There are systematic optimal solutions
- Feasible in a manual way (for few variables) or with the help of a
computer
• Multilevel
- Better solution, but much more difficult
- Feasible only with the help of a computer
Karnaugh map method
• It is a two-level optimization method (1953).
• It is suitable for functions from 3 to 6 variables
• The K-map is a truth table disposed in two dimensions in
which a K cell corresponds to a row of the truth table.
• The grid numbering follows the Gray code, so that the
numbers (in binary code) of two adjacent cells differ in just
one bit.
Karnaugh map method
• Example
Variables

Function K-map numbering BC

F 00 01 11 10
Variable MSB
0 1 3 2
0 1 1 1 0
A
4 5 7 6
1 0 1 1 0

Value of the variable


Value of function F in row #5 (ABC=101)
Karnaugh map method
• Adjacency and Numbering. 3 K-maps
- Each cell has 3 adjacent cells

F(a, b, c) in which a is MSB

- K-maps can be represented as follows:


The bar covers cells in which the
Corresponds to row 011
variable is 1

Corresponds to row 101


Karnaugh map method
• Adjacency and Numbering. 4 K-maps
- Each cell has 4 adjacent cells

F(A,B,C,D) in which A is MSB


Karnaugh map method
• Adjacency. 5 K-maps

Mirror
Karnaugh map method
• Numbering. 5 K-maps

F(A,B,C,D,E) in which A is MSB


Grouping 1s in K-maps
• Goal: Take groups of 2n adjacent cells which contain 1s, n being
as highest as possible
• Each group of 1s is a product of literals (product term), a literal
being a variable or an inverted variable.
• Systematic grouping algorithm
1. Get cells that cannot form groups of 2 cells
2. Get cells that can form groups of 2 cells, but not of 4 cells
3. Get cells that can form groups of 4cells, but not of 8 cells
4. Get cells that can form groups of 8 cells, but not of 16 cells
5. …
Grouping 1s in K-maps
• A Product term is obtained after grouping a set of 1s:
- If the variable takes value 1 in the group, the corresponding
product term contains the variable.
- If the variable takes value 0 in the group, the corresponding
product term contains the inverted variable.
• The function is the sum of all possible product terms.
Grouping 1s in K-maps
• 3K-map Example 1:
(A literal is a variable or its inverse) Given a truth table of F,
find the simplified
1 cell → product of 3 literals
expression of F.
2 cells → product of 2 literals
4 cells → 1 literal
(8 cells → F=1)

BC BC BC BC
00 01 11 10
F = C + AB 0 1 3 2
A 0 1 1 1 0
4 5 7 6
A 1 0 1 1 0
Grouping 1s in K-maps
Example 2:
• 4K-map Given X, calculate its simplified expression

1 cell → product of 4 literals X = ABCD+ABCD+ABCD +ABCD+


2 cells → product of 3 literals +ABCD+ABCD
4 cells → product of 2 literals
8 cells → 1 literal
CD CD CD CD
00 01 11 10
A B 00 1
A B 01 1 1
A B 11 1 1
A B 10
1

X = ABD + ABC + CD
Grouping 1s in K-maps
Example 3:
Given Z , calculate its simplified expression

Z ( A, B, C , D) = BCD + BCD + CD + BCD + ABC


Step1: Insert 1’s in the K-map

Z = BCD + BCD + CD + BCD + ABC


CD

00 01 11 10 F C
F

00 1 1 1 1 1 1 1 1
01 1 1 1 1 1 1
AB B

11 1 1 1 1 1 1
A

10 1 1 1 1
D
Step2: Group 1’s in the K-map

CD

F 00 01 11 10

00 1 1 1 1

AB
01 1 1 1
11 1 1 1
10 1 1

Z = C + AB + BD
Grouping 1s in K-maps
• 5K-map
1 cell → product of 5 literals
2 cells → product of 4 literals
4 cells → product of 3 literals
8 cells → product of 2 literals
16 cells → 1 literal
Grouping 1s in K-maps
Example 1:
Given a 5K-map, calculate the simplified expression of f

f = a + c·d·e + b·c·d
Grouping 1s in K-maps
Example 2:
Function f takes value 1 in positions
1,4,6,7,9,12,14,15,22,23,30,31,
find the simplified expression of f

F C

1 1 1 1 f = ACDE + ACE + CD

1 1 1 1 B?
B

1 1
A

1 1
D

E E
Grouping 1s in K-maps
Example 3:
Given f = ABC + ABC + CDE + BCDE + ABE
calculate the simplified expression of f

Step1: Inserting 1’s in the K-map

F C

1 1 1 1 1 1 1 1
1 1 B

1 1
A

1 1 1 1
D
E E
Grouping 1s in K-maps
Example 3:
Given f = ABC + ABC + CDE + BCDE + ABE
calculate the simplified expression of f

Step2: Grouping 1’s in the K-map

F C

1 1 1 1 1 1 1 1 f = AB + DE + BE

1 1
B

1 1
A

1 1 1 1
D
E E
Grouping 0s in K-maps
• Goal: Take groups of 2n adjacent cells which contain 0s, n being
as highest as possible
• Each group of 0s is a sum of literals (sum term)
• Systematic grouping algorithm. The same that in the 1s case
1. Get cells that cannot form groups of 2 cells
2. Get cells that can form groups of 2 cells, but not of 4 cells
3. Get cells that can form groups of 4cells, but not of 8 cells
4. Get cells that can form groups of 8 cells, but not of 16 cells
5. …
Grouping 0s in K-maps

• A Sum term obtained after grouping a set of 0s:


- If the variable takes value 1 in the group, the corresponding sum
term contains the inverted variable.
- If the variable takes value 0 in the group, the corresponding sum
term contains the variable.
• The function is the product of all possible sum terms.
• Example 1:

yz
x 00 01 11 10

0 0 1 1 0
F = ( x + y )( x + z )
1 0 0 1 1
Grouping 0s in K-maps
Example 2:
Given Z , calculate its simplified expression as a POS

Z ( A, B, C , D) = BCD + BCD + CD + BCD + ABC


Step1: Insert 1’s in the K-map

Z = BCD + BCD + CD + BCD + ABC

F C

1 1 1 1
1 1 1
B

1 1 1
A

1 1
D
Step2: Group 0’s in the K-map

F C

1 1 1 1
1 1 0 1
B

1 1 0 1
A

1 1 0 0
D

Z = ( B + C + D)( A + C + D)( A + B + C )
Grouping 0s in K-maps
Example 3:
Given the following K-map calculate the simplified expression of F as POS

F C

1 1 1 1 1 1 1 1
0 0 0 1 1 0 0 0 B

0 0 0 1 1 0 0 0
A

1 0 0 1 1 0 0 1
D
E E

f = ( B + E )( B + D)( A + E )

You might also like