Professional Documents
Culture Documents
CHAPTER 3
Combinational Logic
PART1: Essentials
In previous chapters we have seen that AND, OR & NOT operations are basic logical operations in
digital circuits, that any other complex logical operation can be expressed with combinations of
these three basic operations.
A logical expression with combinations of variables, constants and basic logical operations is termed
as Boolean expression.
EXAMPLE
A, ̅, . , ̅ . , , .
Boolean algebra
We know that in the “Conventional Algebra” that we learned in our math classes include variables,
constants, basic operations like addition, subtraction, division and multiplication, and properties like
Commutative Property, Associative Property and Distributive Property.
1
Zelalem Birhanu November, 2012
In digital logic we have a modified version of this conventional algebra called Boolean algebra. Like
the conventional algebra, Boolean algebra has basic operations, properties and laws, but it is easier
to learn Boolean algebra because we have only two possibilities for the variables, 0 or 1.
We have three basic operations in Boolean algebra, logical (Boolean) addition (OR operation),
logical (Boolean) multiplication (AND operation) and inversion (NOT operation). We have seen
these operations in chapter 2.
0+0=0
0+1=1
1+0=1
1+1=1
Note: Boolean addition is different from the arithmetic addition of binary numbers
discussed in chapter 1.
0.0 = 0
0.1 = 0
1.0 = 0
1.1 = 1
Observing the above two operations we can conclude that, for any binary variable A,
1 A+0=A 5 A.0 = 0
2 A+1=1 6 A.1 = A
3 A+A=A 7 A.A = A
4 A A=1 8 A. A = 0
The above eight relationships constitute laws of Boolean algebra. There are also other laws we will
see shortly, but first let us discuss properties of Boolean algebra.
2
Zelalem Birhanu November,2012
Boolean algebra, Properties
i. Commutative Property
A+B = B+A
According to this property, the order of the OR operation performed on the variables A and B
makes no difference.
A. B = B. A
A+ B+C = A+B +C
A. B. C = A. B . C
According to this property, it makes no difference in what order the variables are grouped during
the AND & OR operations of several variables.
A + B. C = A + B . A + C
Note that this is a different relation than we know from conventional algebra. Also, Boolean
multiplication is distributive over Boolean addition:
A. B + C = A. B + A. C
Using these properties and the previous eight laws we can derive more Boolean algebra laws.
Absorption laws
9 A + A. B = A 10 A. A + B = A
Consensus laws
3
Zelalem Birhanu November,2012
DeMorgan’s Theorems
Two theorems that are an important part of Boolean algebra were proposed by DeMorgan. They
gave as follows:
1 A. B = ̅ B
2 A B = A. B
So what is the use of the Boolean algebra laws in digital circuit design?
Y=A AB
We can realize the above expression using two logic gates as follows:
Y=A AB = . 1
Y = .1 = A
Looking the above equation it can be seen that we don’t need any gate at all. Therefore we can use
Boolean algebra laws to simplify (minimize) Boolean expression, so that we can utilize the minimum
possible number of gates to realize a Boolean expression. We will discuss more about this in the
coming sections.
PRACTICE1
Simplify (minimize) the following Boolean expressions using Boolean algebra laws.
a. Y = AB BC BC
b. Y = AB AB AB
c. Y = BCD ACD ABD Hint: ABD = ABD . C C
4
Zelalem Birhanu November,2012
1.2 Sum of Products and Products of Sums
In designing combinational circuits the following general steps are followed:
The task the digital circuit is expected to perform is first given in the specification or problem
statement. It is usually easier to put the functionalities (specification) in a truth table than to
directly come up with the logical (Boolean) expression. Therefore the second step would be to
change the specification in to a truth table. After constructing the truth table we derive the Boolean
expression using various methods.
The logical expression that we get from a truth table may not always result in the minimum number
of logic gates during the implementation stage. Therefore, using Boolean algebra or other methods
we will discuss in the coming sections, we have to simplify or minimize the original Boolean
expression. Finally the simplified expression is implemented using logic gates and various
combinational logic blocks. Of course the design is verified whether it satisfies the specification
using various methods.
In this section we will concentrate on extracting Boolean expression from a truth table.
Consider the following truth table with two input variables A and B.
A B Y
0 0 1
0 1 0
1 0 0
1 1 1
5
Zelalem Birhanu November,2012
We want to express the output (Y) in terms of A and B (we want to find the logical expression for Y).
One possibility is to concentrate on the inputs that give a value of Y=1. From the table, Y=1 when A
is 0 and B is 0 or when A is 1 and B is 1. Therefore we can express the case where Y=1 using two
logical AND operations and one logical OR operation. We can express the two cases as:
= . + .
We found the above expression by complementing an input variable if it appears as a 0 in the truth
table or without complementing it if it appears as a 1 in the truth table. If you compute the above
expression for all four possible combinations of A and B, you will see that all the given outputs (Y
values) in the truth table are satisfied, not just the ones that give Y=1. Therefore this is one way of
extracting a logical expression from a truth table.
In the above expression, we have two product terms, . and . , combined using logical addition.
Such an expression, with several product terms combined using logical addition is called Sum of
Products (SOP) expression.
If a product term contains all the variables of a function in either complemented or uncomplemented
form it is called a minterm.
EXAMPLE
For a two variable function we have four possible minterms. These are . , . , . and . .
PRACTICE2
A product term in a SOP may not be a minterm but in a SOP extracted directly from a truth table,
like in the above example, all product terms are also minterms. A Sum of Products (SOP) with all the
product terms also minterms is called Canonical Sum of Products. Therefore, to summarize, one
way of extracting Boolean expression from a truth table is to express the table as a canonical
sum of products.
In general to extract a Boolean expression from a truth table using Canonical Sum of Products form
we can follow the following steps:
1. Give a product term for each input combination in the table, containing an output value of 1.
2. Each product term contains its input variables in either complemented or uncomplemented
form (it is a minterm). If an input variable is 0, it appears in complemented form; if the
input variable is 1, it appears in uncomplemented form.
3. All the product terms are logically added (OR operated) together in order to produce the
final canonical SOP expression of the input.
6
Zelalem Birhanu November,2012
PRACTICE3
Given the following three variable truth table find the Canonical SOP expression for Y.
A B C Y
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1
Another possibility, you may have guessed it already, is to concentrate on the inputs that give an
output value of 0. In our truth table we can express the two cases where Y=0 as:
= + . +
We found the above expression by complementing an input variable if it appears as a 1 in the truth
table or without complementing it if it appears as a 0 in the truth table. If you compute the above
expression for all four possible combinations of A and B, you will see that all the given outputs (Y
values) in the truth table are satisfied, not just the ones that give Y=0 implying that this is another
way of extracting a logical expression from a truth table.
In the above expression, we have two sum terms, + and + , combined using logical
multiplication. Such an expression, with several sum terms combined using logical multiplication is
called Product of Sums (POS) expression.
Analogously, if a sum term contains all the variables of a function in either complemented or
uncomplemented form it is called a maxterm.
EXAMPLE
For a two variable function we have four possible minterms and maxterms. They are listed as
follows:
A B Minterm Maxterm
0 0 . +
0 1 . +
1 0 . ̅+
1 1 . ̅+
PRACTICE4
7
Zelalem Birhanu November,2012
A Product of Sums (POS) with all the sum terms also maxterms is called Canonical Product of
Sums. Therefore another way of extracting Boolean expression from a truth table is to
express the table as a canonical product of sums.
In general to extract a Boolean expression from a truth table using Canonical Product of Sums form
we can follow the following steps:
1. Give a sum term for each input combination in the table, which has an output value of 0.
2. Each sum term contains its input variables in either complemented or uncomplemented
form (it is a maxterm). If an input variable is 1, it appears in complemented form; if the
input variable is 0, it appears in uncomplemented form.
3. All the sum terms are logically multiplied (AND operated) together in order to produce the
final canonical POS expression of the input.
PRACTICE5
For the truth table given in PRACTICE3 find the Canonical POS expression for Y.
A B Y
0 0 1
0 1 1
1 0 0
1 1 0
Y = AB + A
Y= A B+
Y = A … … … … … … … . since B + =1
8
Zelalem Birhanu November,2012
From the original expression we can see that variable A remained unchanged (A = 0) during the two
cases when Y = 1. But variable B changed from 0 to 1. Therefore simplifying, Y takes the unchanged
value, A (the variable B is dropped) . In general for two variables A and x, the following rule applies:
Ax + Ax = A
This basic rule is used for simplification of Boolean expressions using Karnaugh maps.
A Karnaugh map (K-map) is a modified form of a truth table with variable combinations arranged in
such a way that it is easier to see cases like the previous example. It provides a systematic method
for simplifying and manipulating Boolean expressions.
In an n-variable K-map, there are 2n cells. A two variable K-map is shown below.
A 0 1
B
0 0(00) 2(10)
1 1(01) 3(11)
As we can see there are four cells in the map corresponding to the values of Y for each combinations
of A and B. For example the previous truth table is expressed in a K-map as:
A 0 1
B
0 1 0
1 1 0
Adjacent cells: Cells in a K-map that differ in the value of only one variable are called adjacent cells.
For example in a two variable K-map cell 0 (00) is adjacent with cells 1 (01) and 2 (10), because in
the case of cell 1 (01), only the value of variable B changed from 0 to 1, and in the case of 2 (10),
only the value of A changed from 0 to 1. But if we consider cell 3 (11), both the values of A and B
change from 0 to 1, therefore 3 (11) is not adjacent to cell 0 (00). Similarly cells 0 and 3 are adjacent
to cell 1.
PRACTICE 6
The variables in a K-map are arranged in such a way that adjacent cells are next to each other. That
is, a cell’s adjacent cells are to the left, to the right, above or below that cell (not diagonal). This is
9
Zelalem Birhanu November,2012
more obvious for 3 and 4 variable K-maps. Three variable and four variable K-maps are shown
bellow.
AB 00 01 11 10
C
0 0 2 6 4
1 1 3 7 5
AB 00 01 11 10
CD
00 0 4 12 8
01 1 5 13 9
11 3 7 15 11
10 2 6 14 10
Adjacent cells are arranged next to each other so that we can simplify truth tables by applying the
rule Ax Ax = A.
Groups: To simplify a logic expression using K-map we first form groups of adjacent cells. A group is
formed by combining multiples of two (2, 4 and 8) adjacent cells that has output values 1 or 0
depending on whether we are expressing the table as SOP or POS respectively. If we are expressing
a table as SOP we only consider cells with output values of 1, and if we are expressing a table as POS,
we only consider cells with output values of 0. A group is indicated by circling the cells that form
the group.
In a two variable K-map we can form groups of 2 or 4. In our example we have two adjacent cells
that have output values 1, so they can form a group as shown in the figure below.
10
Zelalem Birhanu November,2012
If you observe the group, you can see that throughout the group variable A remained 0 while B
changed values from 0 to 1. Therefore the group has a value A. Since we don’t have other groups Y
takes the value A. So you can see that we simply arranged the truth table so that we can group cells
that can be simplified with the rule Ax Ax = A.
EXAMPLE
What are the other possibilities of forming groups of 2 cells in a two variable K-map?
If we have more than one group in a K-map, the output will be the sum of the value of each group
(assuming we are expressing the truth table as SOP).
EXAMPLE
A B Y
0 0 1
0 1 1
1 0 0
1 1 1
1. Translate the truth table into k-map. (Note that we can directly form the K-map without
first forming the canonical SOP)
A 0 1
B
0 1 0
1 1 1
2. Form groups of two adjacent cells if possible. If a cell cannot be grouped take it as it is (a
group of one cell)
11
Zelalem Birhanu November,2012
3. Find the simplified expression for each group.
In our example we have two groups. The first group simplified as A and the second group is
simplified as B.
4. Combine simplified values with logical addition to find the minimized SOP.
Y= A B
PRACTICE
A B Y
0 0 1
0 1 0
1 0 1
1 1 1
12
Zelalem Birhanu November,2012