Lecture 030223
Lecture 030223
DIGITAL CIRCUITS
BOOLEAN ALGEBRA
(ANALYSIS OF BINARY LOGIC
FUNCTIONS)
Outline
Rules of Combinational Logic (Laws of Boolean Algebra)
2
RECAP OF
VARIOUS
LOGIC GATES
3
LOGIC NETWORKS
Logic gates can be interconnected to give a wide variety of functions.
A (A⋅C)
B F=(A⋅C)+B
C (A+B)
A
F=(A+B) ⋅ (B+C)
B
C (B+C)
4
BOOLEAN IDENTITIES
A F=1 F=0 A F=1
A+1=1 1 A⋅ 0 = 0A A+A = 1
0 A
5
RULES OF COMBINATIONAL LOGIC
Laws of Boolean Algebra (‘+’ denotes ‘OR’, ‘AB’ denotes ‘A AND B’)
a) Commutative rules: A+B = B+A ; AB = BA
7
Laws of Boolean Algebra used for simplifying logical expressions
(Al = Ā denotes the complement/inverse/NOT of A)
A+0 = A ( Al )l = A
A +1 = 1 A + AB = A
A⋅ 0 = 0 A + Al B = A + B
A⋅1 = A A+ B = B + A
A+ A = A A⋅ B = B ⋅ A
A + Al = 1 A + B = A⋅ B
A⋅ A = A A⋅ B = A + B
A⋅ Al = 0 ( A + B)( A + C) = A + BC 8
HALF ADDER CIRCUIT
Takes two binary digits A and B as inputs. A B
Gives out sum S and carry C bits as outputs.
1-bit
C
Half Adder
C = AB
S = Al B + ABl = A ⊕ B
S
9
HALF ADDER CIRCUIT
A
A
Bl
SS = 𝐴𝐴̅ B + A𝐵𝐵
�
B C
C = AB
Al
B
A
SS = A⊕ B
B
C
C = AB
10
FULL ADDER CIRCUIT
Half Adder accepts only 2 input bits. If two n-bit binary numbers are to be
added, there can be a carry bit in various places also.
Full Adder makes provision for a carry-in bit also i.e. total 3 input bits.
A B
(Carry-out) (Carry-in)
1-bit
Co Ci
Full Adder
S
(Sum)
11
FULL ADDER CIRCUIT (SUM)
A
B S
Ci
S = 𝐴𝐴̅𝐵𝐵𝐶𝐶
� 𝑖𝑖 + 𝐴𝐴̅ B𝐶𝐶�𝑖𝑖 + 𝐴𝐴 𝐵𝐵
� 𝐶𝐶�𝑖𝑖 + 𝐴𝐴𝐴𝐴𝐶𝐶𝑖𝑖 � 𝐵𝐵𝐶𝐶
= 𝐴𝐴( � 𝑖𝑖 + B𝐶𝐶�𝑖𝑖 ) +𝐴𝐴(𝐵𝐵� 𝐶𝐶�𝑖𝑖 + 𝐵𝐵𝐶𝐶𝑖𝑖 )
S = 𝐴𝐴̅ (B ⊕ Ci ) + A B ⊕ Ci = A ⊕ B ⊕ Ci
12
FULL ADDER CIRCUIT (CARRY OUT)
B
Co
Ci
�
Co = 𝐴𝐴BC i + A �
𝐵𝐵 C i + AB 𝐶𝐶 ̅ ̅ � �
i +𝐴𝐴𝐴𝐴𝐶𝐶𝑖𝑖 = BCi ( A + 𝐴𝐴) + A(B 𝐶𝐶𝑖𝑖 +𝐵𝐵 C ) i
Co = BCi + A( B ⊕ Ci )
13
HALF SUBTRACTOR CIRCUIT
Performs subtraction of two bits, one is minuend A and other is subtrahend B
Has two inputs and two outputs. The two output bits, D and Bo represent the
difference and output borrow, respectively. A B
1-bit
Bo
Half Subtractor
�
Bo = 𝐴𝐴B
D = 𝐴𝐴̅ B + A𝐵𝐵
� = A⊕ B D 14
HALF SUBTRACTOR CIRCUIT
A
D � + A𝐵𝐵
D = 𝐴𝐴B � = A⊕ B
B
A
�
Boo = 𝐴𝐴B
B
B
15
FULL SUBTRACTOR CIRCUIT
Performs subtraction of two bits, taking into account borrow of the previous
adjacent lower bit also. Has three inputs A, B and Bi, denoting the minuend,
subtrahend, and previous borrow, respectively. The two outputs, D and Bo
represent the difference and output borrow.
A B
1-bit
Bo Bi
Full Subtractor
D 16
FULL SUBTRACTOR CIRCUIT (DIFFERENCE)
A
B D
Bi
D = 𝐴𝐴� 𝐵𝐵 � 𝐵𝐵
� B + 𝐴𝐴B � + A𝐵𝐵� 𝐵𝐵� + ABB
i i i i
� 𝐵𝐵
D = 𝐴𝐴( � B + B𝐵𝐵
� ) + A( 𝐵𝐵
� 𝐵𝐵
� + BB )
i i i i
� ⊕ B ) + A(𝐵𝐵 ⊕ 𝐵𝐵)
D = 𝐴𝐴(B
i i
D = A ⊕ B ⊕ Bi
17
FULL SUBTRACTOR CIRCUIT (OUTPUT BORROW)
A
B
Bo
Bi
B = 𝐴𝐴̅𝐵𝐵B � 𝐵𝐵
� + 𝐴𝐴B �
� + 𝐴𝐴BB + ABB
o i i i i
� 𝐵𝐵B
B = 𝐴𝐴( � � ) + BB ( A +𝐴𝐴)̅
+ B𝐵𝐵
O i i i
� ⊕ B ) + BB
B = 𝐴𝐴(B
o i i 18
SUM OF PRODUCTS (SOP) FORM
Two or more “product” (AND-gated) terms are “summed” (OR-
gated) to form a Boolean expression.
Each cell in the Karnaugh map corresponds to one line in the truth table.
23
KARNAUGH MAP (K-MAP)
Steps to simplify a logic expression using a Karnaugh map are:
1. Draw the empty Karnaugh map.
2. Fill in 1’s and 0’s into the corresponding cells. (using the original
logic expression or it’s truth table.)
3. Identify and draw loops on the Karnaugh map to group together
adjacent 1’s (for SOP form) or adjacent 0’s (for POS form).
4. Create the expression for each group and combine to give the
simplified logic expression.
24
KARNAUGH MAP (K-MAP)
1. Creating an empty Karnaugh map
The number of inputs N defines the number of cells (2N) in the
Karnaugh map to be drawn.
e.g. for two variables, A and B, there are four possible input states i.e.
00, 01, 11 and 10. Hence, the K-map will have 4 cells, each cell
corresponding to one particular input state.
The small numbers in the top left corner of each cell show the decimal
equivalent of the binary input code for that cell. Notice that the cells are
arranged such that only 1-bit changes when we go to an adjacent cell.
Each cell thus corresponds to one particular minterm mi or maxterm Mi,
where i is the decimal equivalent denoting the cell.
25
Two-variable K-map Three-variable K-map Four-variable K-map
F = f(A,B) F = f(A,B,C) F = f(A,B,C,D)
A
A CB 0 1 BA
DC 00 01 11 10
B 0 1 0 1
00 0 1 3 2
0 1 00
0 2 3
01 4 5 7 6
01
2 3 6 7
1 11 12 13 15 14
11
4 5
10 8 9 11 10
Truth table for two variables 10
BA
C 00 01 11 10
0 1 3 2
0
4 5 7 6
1
KARNAUGH MAP
2. Filling in the Karnaugh map
Each cell of the Karnaugh map is filled with either a 1 or a 0
signifying the output for the input corresponding to that cell.
32
KARNAUGH MAP
3. Creating groups in Karnaugh maps
• Each cell with output 1 (or each cell with output 0; for SOP or POS) must
be included in at least one group.
• The groups may overlap, so one cell may be included in several groups,
but any group that has all its elements included in other groups can be
ignored.
• There may be several correct minimal forms for a given logic function,
dependent upon the particular groupings that are chosen.
• Once the groups have been assigned, a logic expression can be created.
For each group, write down the common inputs (AND/product terms if
using 1s; OR/sum terms if using 0s) that describe that specific group and
combine accordingly (SOP or POS). 44
KARNAUGH MAP
"Don't Care" Conditions
Sometimes a situation arises in which some input variable
combinations are not allowed. For example, in a particular coding
scheme with 4 input bits called “BCD”, there are six invalid
combinations: 1010, 1011, 1100, 1101, 1110, and 1111.
Since these unallowed states will never occur in for that particular
application, they can be treated as "don't care" terms with respect
to their effect on the output. That is, for these "don't care" terms
either a 1 or a 0 may be assigned to the output: it really does not
matter since they will never occur.
34
KARNAUGH MAP
"Don't Care" Conditions
B B+AC
AB+A(B+C)+B(B+C)
B
C A
C
19
SOLVED EXAMPLES
Q. Minimize the following Boolean function using algebraic manipulation:
Dll +ABC
F=ABCllD +ABCl D+AB
l
D+ABlClC
l l
D+ABCD+AB
D+ABCD+AB l l
CD+ABCD
CD+ABCD l l
+AB+AB
l
CDlCD
l l
Soln:
(a) F = A + BC + D(E + F ) (b) F = AB + CD + EF
F = A + BC
D(E + F )
( )
= A + BC D + (E + F )
( )(CD)(EF )
F = AB
(
F = A + BC )(D+ E + F ) F = (A+ B)(C+ D )(E+ F )
( )(
F = A+ B C+ D )(E + F )
40
SOLVED EXAMPLES
Q. Draw the circuit to implement the function F = A⋅ B + A⋅C
Simplify this function and hence redraw the reduced circuit.
A A⋅ B
Soln: F = A⋅ B + A⋅C
( )(A⋅C )
F = A⋅ B
B
A⋅ B + A⋅C
F = A⋅ B ⋅ A⋅C C
A⋅C
F = A⋅ B ⋅C
A
A⋅ B ⋅C
B
C
41
SOLVED EXAMPLES
Q. Convert the following Boolean expression into standard SOP form: ABC + AB + ABCD
(
A + B + C = A + B + C + DD = A + B + C + D )(A + B + C + D ) Note, A + BC = ( A + B )( A + C )
(A + B + C )(B + C + D )(A + B + C + D )=
(A + B + C + D)( A + B + C + D )(A + B + C + D )(A + B + C + D )(A+ B + C + D ) 43
SOLVED EXAMPLES
Q. Express the Boolean function F = A + BC as a sum of minterms (SOP).
F = A + BC
First term missing B and C variables,
(
A = A(B + B)(C + C) = AB + AB )(C + C )= ABC + ABC + ABC + ABC
Second term missing variable A,
BC=BC( A + A) = ABC + ABC
F = ABC + ABC + ABC + ABC + ABC + ABC = ABC + ABC + ABC + ABC + ABC
F = m7 + m6 + m5 + m4 + m1 In short notation
F ( A, B,C) = ∑(1, 4,5,6, 7)
F ( A, B,C) = ∑ (0, 2,3) 30
SOLVED EXAMPLES
Q. Express F = XY + XZ as a product of maxterms (POS form).
F = XY + XZ
(
F = XY + X )(XY + Z ) = (X + X )(Y + X )(X + Z )(Y + Z )
F = (Y + X )( X + Z )(Y + Z ) (∴X + X = 1)
)
F = (X + Y + Z Z )(X + YY + Z )(X X + Y + Z ) (∴ X X = 0)
AB 00
AB 01 1 AB
F = AB + BC
BC 11 1 1
AB
AB 10
SOLVED EXAMPLES
Q. Simplify F = ∑ m(1,2,3,6)
into simpler SOP form using K-map C C C
AB 0 1 Group
1
AB 00
Group 1 ⇒ AC 1
Group 2 ⇒ BC AB 01 1 1
Group 2 11 1
AB
F = AC + BC
AB 10
SOLVED EXAMPLES
Q. Simplify F = ∑ m(2,3, 4,5, 7,8,10,13,15)
Group
into simpler SOP form using K-map CD CD CD CD
CD 3
AB 00 01 11 10
Group
AB 00 1
1 ⇒ BD 1
AB
2 ⇒ ABC 01 1 1 1
Group 2
3 ⇒ BCD Group
AB 11 1 1 1
4 ⇒ ABD Group
AB 10 4
1 1
Group
F = BD + ABC + BCD + ABD Group 4
3
SOLVED EXAMPLES
Q. Simplify F = ∑ m(0,5,7,8,10,12,14,15)
Group
5
into simpler SOP form using K-map CD CD CD CD CD
AB 00 01 11 10
Group Group
AB 00 1
1 ⇒ ABD 1
2 ⇒ ABC AB 01
1 1
Group
3 ⇒ ACD 2
4 ⇒ ACD AB 11 1 1 1
Group 4
4 ⇒ BCD AB 10 1 1
Group Group
F = ABD + ABC + ACD + ACD + BCD 5 3
SOLVED EXAMPLES
Q. Use a Karnaugh map to find the minimum SOP expression of the
function: f ( A, B,C, D) = ∑ m(0, 2,5, 7,8,10,13,15)
Group
CD CD CD CD CD 2
AB 00 01 11 10
AB
00 1 1
Group
Group Group 2 AB 01
1
1 1
1 ⇒ BD
AB 11 1 1 Group
2 ⇒ BD 2
AB 10 1 1
(
2 ⇒ B+C ) A+B 01
0 0
A+B
11 0
Group 2
(
F = A B+C ) A+B 10
SOLVED EXAMPLES
Q. Use K-maps to convert the following standard POS expression into:
a) a minimum POS expression, b) a standard SOP expression, and
c) a minimum SOP expression.
F = ( A + B + C + D)( A + B + C + D)( A + B + C + D)( A + B + C + D)( A + B + C + D)( A + B + C + D)
Group 3
a) CD C+D C+D C+D C+D
AB 00 01 11 10 Group
Group 1
(
1⇒ A+ B + C ) A+B 00 0 0 0
2 ⇒ (B + C + D) A+B 01 0
3 ⇒ (B + C + D) A+B 11 0
Group 2
10
( )(B + C + D )(B + C + D )
0
Minimum POS:
SOP: F = A + B + C A+B
Group
3
b) The remaining cells are filled with 1s. CD CD CD CD CD
AB 00 01 11 10
Sum all the minterms corresponding to
these cells with output 1 to get the AB 00 1 0 0 0
standard SOP expression as:
AB 01 1
0 1 1
F = ∑(0000, 0101, 0111, 0110, 1101,
1111, 1110, 1000, 1011, 1010) AB 11
0 1 1 1
52
c)
Group
4
Group CD CD CD CD CD
AB 00 01 11 10
1 ⇒ BD
AB
2 ⇒ BC 00 1 Group
Group 1 2
3 ⇒ AC
AB 01 1 1 1
4 ⇒ BCD
AB
11 1 1 1
Group
3
Minimum SOP: F = BD + BC + AC + BCD
AB 10 1 1 1
Group
4 53
References
E. Hughes, J. Hiley, K. Brown, and I. M. Smith,
“Electrical and Electronic Technology,” Pearson
Education Limited, England, 2008.
55