CC 2 Unit 1
CC 2 Unit 1
Manas Ku Mishra, Asst. Prof. of Comp. Sc., FM (A) College, BLS. Page 1 of 14
by any device that has only two operating states or possible conditions. E.g. a
switch is only open or closed. We arbitrarily (as we define them) let an open switch
represent binary 0 and a closed switch represent binary 1.
Octal System: The octal number system has a base of eight, meaning that it has
eight possible digits: 0,1,2,3,4,5,6 and7.
Hexadecimal System: The hexadecimal system uses base 16. Thus, it has 16
possible digit symbols. It uses the digits 0 through 9 and the letters A, B, C, D, E,
and F as the 16 digit symbols.
Code Conversion: Converting from one code form to another code form is called
code conversion, like converting from binary to decimal or converting from
hexadecimal to decimal etc.
Binary-to-Decimal Conversion: Any binary number can be converted to its
decimal equivalent simply by summing together the weights of the various positions
in the binary number which contain a 1.
Example: (11011)2 = ( _____________)10
Solution: 1*24 + 1*23+ 0*22 + 1*21 + 1*20 = 16+8+0+2+1 = (27)10
Octal-to-Decimal Conversion: Example: (274)8 = ( _____________)10
Solution: 2*82 + 7*81+ 4*80 = 128+56+4 = (188)10
Hexadecimal-to-Decimal Conversion: Example: (2A)16 = ( _____________)10
Solution: 2*161 + 10*160 = 32+10 = (42)10
Manas Ku Mishra, Asst. Prof. of Comp. Sc., FM (A) College, BLS. Page 2 of 14
Decimal-To- Hexadecimal Conversion:
Manas Ku Mishra, Asst. Prof. of Comp. Sc., FM (A) College, BLS. Page 3 of 14
Boolean Laws: There are seven of Boolean Laws.
Sl No. Name of the law Law
i. A.B = B.A
1 Commutative law
ii. A+B=B+A
i. (A.B).C = A.(B.C)
2 Associative law
ii. (A+B)+C = A+(B+C)
i. A.(B+C) = A.B + A.C
3 Distributive law
ii. A+BC = (A+B).(A+C)
4 DeMorgan’s law
5 AND law
6 OR law
7 Inversion law
LOGIC GATES: Logic gates are the basic building blocks of any digital system. It
is an electronic circuit having one or more than one input and only one output. The
relationship between the input and the output is based on certain logic. Based on
this, logic gates are named as AND gate, OR gate, NOT gate etc.
Manas Ku Mishra, Asst. Prof. of Comp. Sc., FM (A) College, BLS. Page 5 of 14
Basic Logic Functions:
The basic logic functions are
AND, OR and NOT. The logic
diagram shown here
implements the logic function
f = (x1 + x2).x3
Canonical & Standard Forms: We will get four Boolean product terms by
combining two variables x and y with logical AND operation. These Boolean
product terms are called as min terms or standard product terms. The min terms
are x’y’, x’y, xy’ and xy.
Similarly, we will get four Boolean sum terms by combining two variables x and y
with logical OR operation. These Boolean sum terms are called as Max
terms or standard sum terms. The Max terms are x + y, x + y’, x’ + y and x’ + y’.
From the above table, we can easily notice that min terms and Max terms are
complement of each other. If there are ‘n’ Boolean variables, then there will be
2n min terms and 2n Max terms.
Canonical SoP and PoS forms: A Boolean function can be expressed by the
following two ways.
Canonical SoP (Sum of Products) form
Canonical PoS (Product of Sums) form
Canonical SoP form: In this form, each product term contains all literals. These
product terms are nothing but the min terms. Hence, canonical SoP form is also
called as sum of Min terms form.
First, identify the min terms for which, the output variable is one and then do the
logical OR of those min terms in order to get the Boolean
expression function corresponding to that output variable. This Boolean function will
be in the form of sum of min terms.
Follow the same procedure for other output variables also, if there is more than one
output variable.
Manas Ku Mishra, Asst. Prof. of Comp. Sc., FM (A) College, BLS. Page 6 of 14
Example: Consider the truth table shown here. Inputs Output
Here, the output f is ‘1’ for four combinations of inputs. The p q r f
corresponding min terms are p’qr, pq’r, pqr’, pqr. By doing
0 0 0 0
logical OR of these four min terms, we will get the Boolean
function of output f. 0 0 1 0
Therefore, the Boolean function of output is, f = p’qr + pq’r 0 1 0 0
+ pqr’ + pqr. This is the canonical SoP form of output f.
We can also represent this function in following two 0 1 1 1
notations. 1 0 0 0
f = m3 + m5 + m6 + m7 or f = ∑m(3,5,6,7) 1 0 1 1
In one equation, we represented the function as sum of
1 1 0 1
respective min terms. In other equation, we used the
symbol for summation of those min terms. 1 1 1 1
Canonical PoS form: In this form, each sum term contains all literals. These sum
terms are nothing but the Max terms. Hence, canonical PoS form is also called
as product of Max terms form.
First, identify the Max terms for which, the output variable is zero and then do the
logical AND of those Max terms in order to get the Boolean
expression function corresponding to that output variable. This Boolean function will
be in the form of product of Max terms. Follow the same procedure for other output
variables also, if there is more than one output variable.
Example: Consider the same truth table of previous Inputs Output
example. Here, the output f is ‘0’ for four combinations of p q r f
inputs. The corresponding Max terms are p+q+r, p+q+r’,
p+q’+r, p’+q+r. By doing logical AND of these four Max 0 0 0 0
terms, we will get the Boolean function of output f.
0 0 1 0
Therefore, the Boolean function of output is,
f = (p+q+r)(p+q+r′)(p+q′+r)(p′+q+r). This is the canonical 0 1 0 0
PoS form of output f. We can also represent this function 0 1 1 1
in following two notations.
f = M0.M1.M2.M4 or f = ∏M(0,1,2,4) 1 0 0 0
In one equation, we represented the function as product of 1 0 1 1
respective Max terms. In other equation, we used the 1 1 0 1
symbol for multiplication of those Max terms.
1 1 1 1
The Boolean function, f = (p′+q+r)(p+q′+r)( p+q+r′)(p+q+r) is the dual of the Boolean
function, f = p’qr + pq’r + pqr’ + pqr. Therefore, both canonical SoP and canonical
PoS forms are Dual to each other. Functionally, these two forms are same. Based
on the requirement, we can use one of these two forms.
Manas Ku Mishra, Asst. Prof. of Comp. Sc., FM (A) College, BLS. Page 7 of 14
Principle of Duality: It states that the dual of the Boolean function is obtained by
interchanging the logical AND operator with logical OR operator and zeros with
ones. For every Boolean function, there will be a corresponding Dual function. E.g
x+0 = x dual of this is x.1 = x
Standard SoP and PoS forms: We discussed two canonical forms of representing
the Boolean outputs. Similarly, there are two standard forms of representing the
Boolean outputs. These are the simplified version of canonical forms.
Standard SoP(Sum of Products) form
Standard PoS(Product of Sums) form
The main advantage of standard forms is that the number of inputs applied to logic
gates can be minimized. Sometimes, there will be reduction in the total number of
logic gates required.
Standard SoP form: In this form, each product term need not contain all literals. So,
the product terms may or may not be the min terms. Therefore, the Standard SoP
form is the simplified form of canonical SoP form. We will get Standard SoP form of
output variable in two steps.
Get the canonical SoP form of output variable
Simplify the above Boolean function, which is in canonical SoP form.
Follow the same procedure for other output variables also, if there is more than one
output variable. Sometimes, it may not possible to simplify the canonical SoP form.
In that case, both canonical and standard SoP forms are same.
Example: Convert the Boolean function f = p’qr + pq’r + pqr’ + pqr which is in
Canonical SoP form. Represent this function in Standard SoP form.
Solution: Given f = p’qr + pq’r + pqr’ + pqr
⇒ f = p’qr + pq’r + pqr’ + pqr + pqr+ pqr ( ∵ x + x = x)
⇒ f = (p’qr + pqr) + (pq’r + pqr) + (pqr’ + pqr)
⇒ f = (p’ + p)qr + (q’ + q)pr + pq(r’ + r)
⇒ f = qr + pr + pq
This is the simplified Boolean function. Therefore, the standard SoP
form corresponding to given canonical SoP form is f = pq + qr + pr
Standard PoS form: In this form, each sum term need not contain all literals. So,
the sum terms may or may not be the Max terms. Therefore, the Standard PoS form
is the simplified form of canonical PoS form.
We will get Standard PoS form of output variable in two steps.
Get the canonical PoS form of output variable
Simplify the above Boolean function, which is in canonical PoS form.
Follow the same procedure for other output variables also, if there is more than one
output variable. Sometimes, it may not possible to simplify the canonical PoS form.
In that case, both canonical and standard PoS forms are same.
Manas Ku Mishra, Asst. Prof. of Comp. Sc., FM (A) College, BLS. Page 8 of 14
Example: Convert the Boolean function f = (p+q+r)(p+q+r′)(p+q′+r)(p′+q+r) which is
in Canonical PoS form. Represent this function in Standard PoS form.
Solution: Given f = (p+q+r)(p+q+r′)(p+q′+r)(p′+q+r)
⇒ f = (p+q+r)(p+q+r)(p+q+r)(p+q+r′)(p+q′+r)(p′+q+r) ( ∵ x.x = x)
⇒ f = [(p+q+r)(p+q+r′)] [(p+q+r) (p+q′+r)] [(p+q+r) (p′+q+r)]
⇒ f = [(p+q)+rr′)] [(p+r)+ qq′] [(q+r)+pp′] [ ∵ x+y.z = (x+y)(x+z) ]
⇒ f = (p+q)(p+r)(q+r) [ ∵ xx′ = 0 and x+0 = x ]
This is the simplified Boolean function. Therefore, the standard PoS
form corresponding to given canonical PoS form is f = (p+q)(q+r)(p+r). This is
the dual of the Boolean function, f = pq + qr + pr. Therefore, both Standard SoP
and Standard PoS forms are Dual to each other.
Minimization of Logic Expressions: Minimization of logic expression is
required to minimize the number of logic gates in a logic circuit which further
minimizes the space, power consumption and cost of the circuit. The minimization
can be achieved by the following ways:
1. By algebraic method
2. By Karnaugh map (K-Map)
Minimization by algebraic method: This can be achieved by using Boolean
postulates and theorems.
Example: Minimize the Boolean function f = x’y + xy’ + xy
Solution: x’y + xy’ + xy = x’y + xy + xy’
= (x’ + x)y + xy’
= y + xy’
= (y + x) (y + y’)
=x+y
Minimization by Karnaugh map (K-Map): In algebraic method, we simplify
a Boolean functions using Boolean postulates and theorems. It is a time consuming
process and we have to re-write the simplified expressions after each step.
To overcome this difficulty, Karnaugh introduced a method for simplification of
Boolean functions in an easy way. This method is known as Karnaugh map
method or K-map method. It is a graphical method, which consists of 2n cells for
‘n’ variables. The adjacent cells are differed only in single bit position.
Manas Ku Mishra, Asst. Prof. of Comp. Sc., FM (A) College, BLS. Page 9 of 14
3 Variable K-Map: The number of cells in 3 variable K-
map is eight, since the number of variables is three. The
following figure shows 3 variable K-Map.
Similarly, if we consider the combination of inputs for which the Boolean function is
‘0’, then we will get the Boolean function, which is in standard product of
sums form after simplifying the K-map.
Rules for simplifying K-maps in order to get standard sum of products form:
Select the respective K-map based on the number of variables present in the
Boolean function.
If the Boolean function is given as sum of min terms form, then place the ones
at respective min term cells in the K-map.
Check for the possibilities of grouping maximum number of adjacent ones. It
should be powers of two. Start from highest power of two and upto least
power of two. Highest power is equal to the number of variables considered in
K-map and least power is zero.
Note 1 − If outputs are not defined for some combination of inputs, then those
output values will be represented with don’t care symbol ‘x’.
Note 2 − If don’t care terms are also present, then place ‘x’ in the respective don’t
cares cells of K-map. Consider only the don’t cares ‘x’ that are helpful for grouping
maximum number of adjacent ones. In those cases, the don’t care value is treated
as ‘1’.
Manas Ku Mishra, Asst. Prof. of Comp. Sc., FM (A) College, BLS. Page 10 of 14
Example: Let us simplify the following Boolean function, f (W,X,Y,Z) = WX’Y’ + WY
+ W’YZ’ using K-map.
Solution: The given Boolean function is in sum of
products form. It is having 4 variables W, X, Y & Z.
So, we require 4-variable K-map. The 4 variable K-
map with ones corresponding to the given product
terms is shown in the fig.
Here, 1s are placed in the following cells of K-map.
The cells, which are common to the intersection of
Row 4 and columns 1 & 2 are corresponding to the
product term, WX’Y’.
The cells, which are common to the intersection of Rows 3 & 4 and columns 3 &
4 are corresponding to the product term, WY.
The cells, which are common to the intersection of Rows 1 & 2 and column 4 are
corresponding to the product term, W’YZ’.
There are no possibilities of grouping
either 16 adjacent ones or 8 adjacent
ones. There are three possibilities of
grouping 4 adjacent ones. After these
three groupings, there is no single
one left as ungrouped. So, we no
need to check for grouping of 2
adjacent ones. The 4 variable K-
map with these three groupings is
shown in the fig.
The simplified Boolean function is f = WX’ + WY + YZ’
Rules for simplifying K-maps in order to get standard product of sums form:
Select the respective K-map based on the number of variables present in the
Boolean function.
If the Boolean function is given as product of Max terms form, then place the
zeroes at respective Max term cells in the K-map.
Check for the possibilities of grouping maximum number of adjacent zeroes. It
should be powers of two. Start from highest power of two and up to least
power of two. Highest power is equal to the number of variables considered in
K-map and least power is zero.
Note − If don’t care terms are also present, then place don’t cares ‘x’ in the
respective cells of K-map. Consider only the don’t cares ‘x’ that are helpful for
grouping maximum number of adjacent zeroes. In those cases, the don’t care value
is treated as ‘0’.
Example: Simplify the Boolean function, f(X,Y,Z) = ∏M(0,1, 2, 4) using K-map.
Manas Ku Mishra, Asst. Prof. of Comp. Sc., FM (A) College, BLS. Page 11 of 14
Solution: The given Boolean function is in product of
Max terms form. It is having 3 variables X, Y & Z. So,
we require 3 variable K-map. The given Max terms
are M0, M1, M2 & M4. The 3 variable K-map with
zeroes corresponding to the given Max terms is
shown in the following figure.
There are no possibilities of grouping either 8
adjacent zeroes or 4 adjacent zeroes. There
are three possibilities of grouping 2 adjacent
zeroes. After these three groupings, there is
no single zero left as ungrouped. The 3
variable K-map with these
three groupings is shown in the fig.
Manas Ku Mishra, Asst. Prof. of Comp. Sc., FM (A) College, BLS. Page 12 of 14
Making any gate using only NOR gate:
When activated into its third state it disables or turns “OFF” its output producing an
open circuit condition that is neither at a logic “HIGH” or “LOW”, but instead gives an
output state of very high impedance, High-Z, or more commonly Hi-Z. Then this
type of device has two logic state inputs, “0” or a “1” but can produce three different
output states, “0”, “1” or ” Hi-Z ” which is why it is called a “Tri” or “3-state” device.
Followings are the types of Tri-state Buffer, one whose output is enabled by an
“Active-HIGH” control signal producing the output, and another whose buffer output
is controlled by an “Active-LOW” control signal producing an the output as shown
below.
Manas Ku Mishra, Asst. Prof. of Comp. Sc., FM (A) College, BLS. Page 13 of 14
Active “HIGH” Tri-state Buffer Active “LOW” Tri-state Buffer
Manas Ku Mishra, Asst. Prof. of Comp. Sc., FM (A) College, BLS. Page 14 of 14