Logic Gates & Combinational Logic Design
Logic Gates & Combinational Logic Design
Digital Signals
A digital signal has two discrete levels or values. Two representations
of digital signals are as shown below.
5V 5V
High Low
3.5V 3.5V
1V 1V
Low High
0V 0V
(a) (b)
In each case there are two discrete levels and the levels can be
represented using the terms LOW and HIGH. Fig (a), the lower of the
two levels has been designated as LOW and higher level as HIGH level.
In Fig. (b), the designation has been reversed.
Digital systems using the representation in Fig. (a) are said to employ
positive logic system and those using the other representation of Fig.
(b) are said to employ negative logic system.
Truth Tables
A truth table is means of describing how a logic circuit’s output
depends on the logic levels present at the circuit’s inputs e.g.
Inputs Outputs
A B X
0 0 0
0 1 1
1 0 1
1 1 0
Truth table for three or four inputs can also been drawn depending on
the inputs present at circuit.
Boolean Expression
It’s a simple mathematical tool allows the description of the
relationship between logic circuit output (s) and its inputs as an
algebraic equation e.g.
A B B A B
1
b) AND gate
c) OR gate
d) NAND gate
e) NOR gate
f) Exclusive-OR gate (EXOR)
g) Exclusive-NOR gate
The INVERTER, AND and OR gate are the basic gates. The NAND,
NOR, Exclusive-OR and Exclusive-NOR gates are derived gates.
1
A Y A Y
(a) (b)
The truth table of a NOT gate is
Input Output
A Y
0 1
1 0
Vo
Vi
Inverter electronic circuit
2
Vi is high (+5 V), it will make the transistor to conduct and thus
giving a low Vo
A
Y
B
Inputs outputs
A B Y
0 0 0
0 1 0
1 0 0
1 1 1
Logic operation: An AND gate produces a HIGH (1) output only when
all of the inputs are HIGH (1) else the output is LOW (1).
Example 1 Determine the total number of possible input combinations
of a 3-input AND gate. Sketch a logic symbol and develop a truth table
for this logic gate.
Solution
A 3-input AND gate has eight possible combination i.e. 2 3 8 . The
symbol and truth table of a 3-input AND gate is as shown.
A
B Y
C
Inputs Outputs
A B C Y
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
3
Exercise: Determine the total number of possible input combinations of a
4-input AND gate. Sketch a logic symbol and develop a truth table for this
logic gate.
A
A Y
B
B
t1 t2 t3 t4 t5 t6
Hence, applying the rules of AND gate as shown in the truth
table, the output Y as shown in obtained.
Example 3 The Fig. below shows two input waveforms, A and B applied
to an AND
gate.
1
A 0
A Y
1
B B
0
1
Y
0
t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
Y AB
The AND operation can be extended to more than two variables. For
example, the three and four input AND operation Boolean expressions
are expressed as:-
4
5V
D1
A
D2 Y
B
AND electronic circuit
When inputs A and B are low, both diodes are connected to +5 V and
thus they are forward biased and conduct pulling down the output to
low value. If one input is low, the diode with low input conducts
pulling down the output to low. If both inputs are high, both diodes
being reversed biased get cut-off and supply voltage, high appears at
the output, hence it’s through table.
A
Y
B
Inputs outputs
A B Y
0 0 0
0 1 1
1 0 1
1 1 1
Solution
A 3-input OR gate has eight possible combination i.e. 2 3 8 . The
symbol and truth table of a 3-input OR gate is as shown.
5
A
B Y
C
Inputs Outputs
A B C Y
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
Example 5
A Y
B B
t1 t2 t3 t4 t5
Example 6 The Fig. below shows the two input waveforms A and B
applied to an OR gate. The resulting output is as shown in waveform Y.
A
A Y
B B
t1 t2 t3 t4 t5 t6 t7 t8
Exercise: The Fig. below shows the three input waveforms, A, B, and C
applied to an OR gate. Sketch the resulting output waveform at Y.
6
A
A
B B Y
C
Y A B C and Y A B C D
The electronic implementation this gate is as shown below
D1
A
D2 Y
B
OR electronic circuit
If both inputs are low (0), then both diodes do not conduct, giving
low (0) output at Y.If any input is is high, the diode with that high
input conducts, giving high (1) output. If both inputs are high,
both diodes conduct, giving high (1) output.
A
Y
B
The small circle (or a bubble) on its output denotes the inversion
operation. Thus a NAND gate operates like an AND gate followed by a
NOT as show below.
7
A
Y
B
Inputs outputs
A B Y
0 0 1
0 1 1
1 0 1
1 1 0
NAND gate produces a LOW (0) output only when all the inputs are
HIGH (1). When any of the inputs is LOW (0), the output will be HIGH
(1).
Example 7
A
A Y
B
B
t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
Example 8 The figure below shows the two waveforms applied to the
NAND gate inputs. Determine the resulting output waveform.
8
1
A 0
A Y
1
B
B 0
1
Y 0
t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
Exercise Sketch the output waveform for the 3-input NAND gate shown
in the figure below showing its proper time relationships to the inputs
1
A 0
1 A
B B Y
0
C
1
C
0
A
Y
B
The small circle (or a bubble) on its output denotes the inversion
operation. Thus a NOR gate operates like an OR gate followed by a
NOT as show below.
9
A
Y
B
Inputs outputs
A B Y
0 0 1
0 1 0
1 0 0
1 1 0
The NOR gate produces a LOW (0) output when any of the inputs is
HIGH (1). The output is HIGH (1) only when all of the inputs are LOW
(0).
A
A Y
B B
t0 t1 t2 t3 t4 t5 t6
Exercise Sketch the output waveform for a 3-input NOR gate shown
below, showing the proper time relationships to the inputs.
1
A
0
1 A
B 0 Y
B
C
1
C 0
t0 t1 t2 t3 t4 t5 t6
10
Boolean Expression for a NOR gate
The Boolean expression representing NAND function is
Y AB
This expression means that the two input variables, A and B are first
ORed and then inverted (or complemented) as indicated by the bar
over the OR expression.
For a three and four input OR gates, the Boolean expressions
becomes
Y A B C and Y A B C D
Both these gates are formed by combination of the basic gates i.e.
Inverter, AND and OR gates. But because of their fundamental
importance in many applications, they are treated as basic logic gates
with their unique symbols.
A
Y
B
Inputs output
A B Y
0 0 0
0 1 1
1 0 1
1 1 0
Logic Operation
The output is HIGH (1) only when the two inputs are at opposite logic
levels. The output is LOW (0) when the two inputs are at the same
logic levels.
11
Pulsed Operation of a XOR Gate
1
A
0
1 A Y
B 0 B
1
Y 0
t1 t2 t3 t4 t5
Exercise Sketch the output waveform for an XOR gate with the input
waveforms as shown in the figure below.
1
A
0
A
Y
1 B
B 0
t1 t2 t3 t4 t5 t6 t7 t8
Y A B AB AB
It has only two inputs and one output. Its logic symbol is as shown.
A
Y
B
Inputs output
A B Y
0 0 1
0 1 0
1 0 0
1 1 1
12
Logic Operation
The output of this gate is HIGH (1) only when the two inputs are at
the same logic level. The output is LOW (0) when the two inputs are at
opposite logic levels.
1
A
0
A Y
1
B 0 B
1
Y 0
t1 t2 t3 t4 t5 t6 t7
1
A 0
A
Y
1 B
B
0
Y A B A B AB
13
A
B
Y = (A.B) + C
C
A A+B
B
Y = (A + B).C
C
Example 13 Write the Boolean expression for output Y for logic circuit
shown the figure below.
A A
A B C
B
C Y A B C A D
AD
D AD
Example 14 Write the Boolean expression for output Y for logic circuit
shown the figure below.
A A B (A B) C
B (A B) C
C
(A B) C D
D
Y
E
Y ( A B)C D E
Exercise Determine the Boolean expression for the output X for the logic
circuit shown in the figure below.
14
A
B
C
D
Y
E
Example 15 Suppose we want to know the logic level Y for the circuit
below for the case where A 0, B 1, C 1and D 1 .
A A A B
B A B
B
Y (A B) BC
C
Once the Boolean expression for all the possible combination of the
inputs variables have evaluated as shown above, the result can be
summarized in a truth table.
To illustrate this concept, consider the circuit below.
15
A A B
B
Y (A B)(B C )
C C B C
Inputs output
A B C Y
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 1
Since each OR gate input is an AND product term, then it means that
an AND gate with appropriate inputs can be used to generate each of
these terms i.e.
16
A AC
A BC
Solution
(a) A A B
A
B
B (A B) C
C
(b) A AB
A
B AB C
C C
Exercise Construct the logic circuits that can implement the Boolean
expressions:
a) Y AB AB
b) Y W PQ
c) Y AB(C D)
d) Y (A B CDE) BCD
17
It can be used as an AND gate as
A AB Y AB
B
Y A B A B
B B
A A B Y A B A B
B
B B
ASSINGMENT 2
18
COMBINATIONAL LOGIC DESIGN
Introduction
Boolean algebra theorems are used for the manipulations of logic
expressions. The number of gates and the number of input terminals
for the gates required for the realization of a logical expression, in
general, get reduced considerably if the expression can be simplified.
Basically, digital circuits are divided into two broad categories:
(i) Combinational circuits, and
(ii) Sequential circuits
In combinational circuits, the outputs at any instant of time depend
upon the inputs present at that instant of time. Thus, these circuits
have no memory.
There are other types of circuits in which the outputs at any instant of
time depend upon the present inputs as well as the past
inputs/outputs. This implies that they have memory. Such circuits
are known as sequential circuits.
The design requirements of combinational circuits may be specified in
any of the following ways:
(i) A set of statements
(ii) Boolean expression, and
(iii) Truth table
3) Laws of Complementation
(i) 0 1
(ii) 1 0
(iii)If A 1, then A 0
19
(iv) If A 0, then A 1
(v) A A
4) Commutative laws
These laws allow changes of position of variables in OR and AND
expressions
(i) A B B A
(ii) A . B B. A
5) Associative laws
These laws allow removal of brackets from logic expressions and
regrouping of variables.
(i) A (B C) (A B) C
(ii) (A B) (C D) A B C D
(iii) A.(B.C) (A.B).C
6) Distributive laws
These laws permit factoring or multiplying out of an expression
(i) A(B C) AB AC
(ii) A BC (A B)(A C)
(iii) A AB A B
7) Absorptive laws
These laws are used in reduction of a complex expression to a simpler
form by absorbing some of the terms into existing terms
(i) A AB A
(ii) A(A B) A
(iii) A(A B) AB
20
A AC BC
A(1 C) BC
A BC
A B AB A+AB
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
Hence, from the table, the columns of A and A+AB are the same and
hence A AB A
A B A AB A AB A+B
0 0 1 0 0 0
0 1 1 1 1 1
1 0 0 0 1 1
1 1 0 0 1 1
An inspection of the fifth and sixth columns indicates that they are
the same. This verifies that A AB A B
Example 6 Using the truth table, show that the Boolean expression,
( A B)( A C ) A BC
21
1 0 0 1 1 1 0 1
1 0 1 1 1 1 0 1
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1
The sixth and the eighth columns are the same. This verifies that
( A B)( A C ) A BC
Example 7 Using the Boolean laws and rules simplify the expression and
implement the minimized expression using logic gates: y ABD ABD
Solution
y ABD ABD
AB(D D) (Using distributive law)
AB(1) (Using the rule A A 1 )
AB
B
Y AB
A
Example 8 Using the Boolean laws and rules, simplify the following
expression and implement the minimized expression using logic gates:
x ACD ABCD
Solution
x ACD ABCD
(A AB) CD (Using distributive law)
(A B) CD (Since A AB A B )
A A B
B
Y (A B) CD
C CD
D
22
B z B AC
A
C AC
Example 10 Using laws and rules of Boolean algebra simplify the Boolean
the following expression and implement the simplified expression.
z [AB(C BD) AB] C
Solution
z [AB(C BD) AB] C
(ABC ABBD AB) C (Using distributive laws)
(ABC A .0. D AB) C (Since BB 0 )
(ABC 0 AB) C (Since A .0. D 0 )
ABC C ABC (Using distributive laws)
ABC ABC (Since CC C )
(A A) BC (Factoring out BC )
1. BC (Since A A )
BC
B
z BC
C
Exercise
(i) Simplify the following Boolean expression and draw the logic
circuits for the simplified expressions.
a) y ABC ABC ABC BC (ans: AC B )
b) y B(A C) C(A B) AC (ans: AB C )
c) z ABC ABC ABC ABC ABC (ans: AB BC BC )
De Morgan’s Theorem
23
A A
AB A B
B B
24
( x xy ) yz xz
x y yz xz
( x xz ) ( y yz )
xz yz
x y ( z z)
x y 1
1
Exercise
(i) Simplify the following expression using De Morgan’s theorem and
Boolean algebra laws and rules
a) Y ( B C )( B C ) A B C
b) Z (C D) A CD ABC ABCD ACD
c) ABCD
ASSINGMENT 3
25
Example 14 Determine the Boolean expression for the output of the logic
circuit shown below.
Solution
The Boolean expression for the output of the logic circuit is,
Y BC ( AB C )
Simplifying the expression, have
Y BC ( AB C )
BC ( AB.C )
BC ( AB.C )
BC[ A B ]C
A
B
C
Y
BC[ A C B C ]
A BCC BCB C
A BC 0
A BC
The simplified expression can be implemented as
A
Y ABC
B
C
Example 15 Figure (a) below shows a logic circuit with the inputs A and
B. The waveforms at the inputs are also shown in figure (b). Determine the
minimized circuit and then sketch the waveform at the output.
10 ms
A
A 10 ms
B Y
(a) B
5 ms 5 ms
(b)
Solution
The output of the logic circuit is Y ( A B ).B
Applying the De Morgan’s theorem 1 to the terms on the right, have
26
Y A B B
A B B
A B
B
Y
A
10ms
5ms
Y A B
A Y
B
Solution
The output of the logic circuit is Y A ( A B )
Applying De Morgan’s theorem 2 to the right side, have,
Y A .( A B )
A( A B )
AA AB )
A AB )
A(1 B )
A
Hence, a minimized logic circuit has no logic gate. The output is equal to
the value of A itself. In other words the given logic circuit is redundant.
27
J
I
A Y
Solution
The above circuit is redrawn as shown below.
J
I A I Y A B
1
A 4
3
2 A J
A
Y ( A J )( A I )
A A AI AJ JI
0 AI AJ JI
AI AJ JI
Since the output Y is given to be equal to A B , therefore,
A B AI AJ JI
Comparing the terms on the left and right on the above equation, have
that,
A AJ …………………….……………(i) and
B A I JI ……………………………...(ii)
From equation (i), if J 1 then A A.1 . Hence J 1
From equation (ii), B ( A J ) I ( A 1) I 1.I I ,
Thus, J 1 and B I
28
When two or more product terms are ORed, the resulting expression is
called a Sum-of-Product (SOP) e.g. AB BCD ,
ABC CDE B CD , AB A BE B D .
SOP expression can contain a single variable term but a single overbar
cannot extend over more than one variable, although more than one
variable in a term can have an overbar e.g. A BC can be a term in SOP
expression but not ABC .
A
B
A Y AB ABC AC
B
C
A
C
NB: The no. of AND gates is equal to the number of terms in the sum-
of-products expression.
Solution
a) ( A B)(C B ) AC AB BC BB
AC AB BC 0
29
AC AB BC
b) ( A B C )C AC B CC
AC B C
In the Boolean algebra, a sum term (or max-term) is the sum of literals or
variables e.g. A B , A B C , A D etc.
A sum term is equal to 1 when one or more of the literals in the term are
1 and equal to 0 iff each of the literal is 0 e.g
( A B )( A B D )( A B C D) or ( A B C )( A )( A B )
30
The Standard form of POS
31
Solution
On evaluating each term have
A B C A B C A BC AB C ABC
000 001 011 101 111
Since the possible combination is 2 3 8 , then the remaining terms are
those for POS i.e. 010, 100 and 110. Since these are binary values that
make the sum term 0, therefore the equivalent POS expression is,
( A B C )( A B C )( A B C )
INPUTS OUTPUTS
A B C Y
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
32
A B ABC A C AB C A B(C C ) ABC A ( B B )(C C )
C ( A A )( B B ) AB C
A BC A BC ABC A BC A BC A B C A B C ABC AB C
A BC A B C AB C
(Some product terms are repeated and one of the repeated terms is
retained while the rest are discarded). Thus, the required expression is,
A BC A BC ABC A B C A B C AB C AB C
Its truth table is
INPUTS OUTPUTS
A B C Y
0 0 0 1
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0
INPUTS OUTPUTS
A B C Y
0 0 0 0
0 0 1 1
33
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1
Example 27 Develop the truth table for the following standard POS
expression
( A B )( A B C )( A B D )( A B C D)
Exercise
(i) Find the canonical Sum-of-Products form for the expression
given below
f ( A, B, C ) AB A B ABC AC A C
(ii) Also find POS expression for the expression in (i).
(iii) Determine the canonical POS form and canonical SOP form of
the Boolean expression f ( A, B, C ) B C
(iv) Find the min terms or canonical SOP form and max terms or
canonical POS form for the function f ( A, B, C ) A C AC .
(v) Find the max terms or canonical POS form of the function
f ( A, B, C ) , which is represented by the truth table
34
K-map is similar to a truth table in that it presents all the possible
values of input variables and the resulting output of each value.
But instead of being organized into columns and rows like a truth
table, the K-map is an array of squares or cells in which each
square represents a binary value of the input variables.
Each square is denoted by a binary number or its decimal
equivalent e.g. if the function consists of three-variables, then the
K-map has 8(23) squares and for four is 16 (24) squares. These
maps are as shown below:-
a) 2-variable K-map
A
0 1
B
0 AB AB
1 AB AB
b) 3-variable K-map
AB
C 00 01 11 10
0 ABC ABC ABC ABC
1 A BC A BC A BC A BC
c) 4-variable K-map
AB D
C
00 01 11 10
00 A B C D A B C D A BC D A B C D
01 A B C D A B C D A B C D A B C D
11 A BC D A BC D A BC D ABC D
10 A BC D A BC D ABC D ABC D
35
the map. This is referred to as mapping a SOP expression on the K-
map.
AB
C 00 01 11 10
0 1
1 1 1 1
A B C A BC A BC A BC
Example 29 Map the following standard sum-of-products (SOP)
expression on a K-
map:
A BCD ABCD ABC D A B C D ABC D A B C D AB CD ABCD
Solution
AB D
C
ABCD 00 01 11 10
00 1 1 A BC D
01 1 1 A BC D
A BC D 11 1 A BC D
10 1 1 1
A BC D ABC D ABC D
Example 30 Map the following non-standard sum-of-products (SOP)
expression on a
K-map: A A B ABC
Solution
First the given expression is standardized as follows:-
A ( B B )(C C ) A B (C C ) ABC
A BC A BC A B C A B C A B C A B C ABC or
011 010 001 000 001 000 110 or
011 010 001 000 110
36
ABC ABC
AB
C 00 01 11 10
0 1 1 1
1 1 1
A BC A BC ABC
After the Boolean expression has been mapped on the K-map,
there are three steps in the process of obtaining a minimum SOP
expression.
(i) Grouping the 1s – the adjacent 1s are grouped with the objective
of maximizing the size of the groups and to minimize the number
of groups using the following rules:-
a) A group must contain either 1,2,4,8 or 16 squares
b) Each square in the group must be adjacent to one or more
squares in that same group but all squares in the same group
do not have to be adjacent to each other.
c) Always include the largest possible number of 1s in
accordance to rule (a).
d) Each 1 on the K-map must be included in at least one group.
The 1s already in a group can be included in another group as
long as the overlapping groups included non-common 1s.
(ii) Determining the Product term for each group – the minimum
product term and hence the minimum sum-of-products expression
is obtained using the following rule:
a) Each group of squares containing 1s creates one product term
composed of all variables that occur in only one form within the
group are eliminated. These are called contradictory variables.
(iii)
Summing the resulting product terms – all the derived minimum
product terms
are summed together to form the minimum sum-of-product
expression.
37
AB
C 00 01 11 10
0 1 1 1 AC
1 1 1
AC AB
Hence the simplified expression is,
Y A C A B AC
00 01 11 10
00 1 AB C
01 1 1 1 1 CD
11 1
10
ABD
Hence the simplified expression is,
Y ABD ABC C D
38
A
CD B
00 01 11 10
00 1 1
BC
01 1 1
BD
11 1 1
10
INPUTS OUTPUTS
A B C Y
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
On mapping it becomes,
AB
00 01 11 10
C
0 1
1 1 1 1 1
39
The expression above can be represented in form a truth table as,
A
CD B
00 01 11 10
00 1 1 BC D
BCD
01 1 1
11 1 1
BCD
ACD
10 1 1
f ( A, B, C, D) B C D B C D A C D B C D
This can be implemented using 3-input NAND gates as shown below.
40
A B C D
BC D
BCD
ACD f
BCD
IMPLICANTS
When a Boolean expression of four or less variables is represented on
a K-map, then the set of adjacent minterms or the simplified SOP
term are called the implicants of the expression.
(i) Prime-implicant – An implicant is called prime-implicant of the
expression if it is not a subset of any other implicant of the
expression. Each product term individually is a prime-implicant.
(ii) Essential prime-implicant – a prime-implicant which includes a ‘1’
cell, which is not included in any other prime-implicant, on the K-
map, is known as an essential prime-implicant of the function.
AB D
C
00 01 11 10
00 I VI
01 II V
11 III 1 IV
10
From the above K-map, there are six prime-implicants I, II, III, IV, V
and VI each formed by a pair of two adjacent minterms. Prime-
implicant I and VI are essential prime-implicants because one of their
minterms is not included in any other prime-implicant.
41
AB
C 00 01 11 10
0 1 1 1
1 1 1 1
00 01 11 10
00 1 1 1
01 1 1
11 1 1
10 1 1 1
42
which produces a 1 output corresponding to a BCD input equal and
greater than six. The output is 0 if the input is less than six. In form a
truth table, it is as shown.
INPUTS OUTPUTS
A B C D Y
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 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1
1 0 1 0 x
1 0 1 1 x
1 1 0 0 x
1 1 0 1 x
1 1 1 0 x
1 1 1 1 x
01 1 x 1
11 x x x
10 1 x x
BC
Hence the simplified expression is,
Y A BC
Example 35 Consider the K-map shown below. Determine the logic
function represented by the map and simplify it in the minimal form.
43
A
CD B
00 01 11 10
00 1 x x
01 1 x 1
11 x 1
10 1 x x
Solution
A
CD B
00 01 11 10
00 1 x x
AC
01 1 x 1
BD
11 x 1
10 1 x x BD
44
A
CD B (A B)
00 01 11 10
00 0 0
01 0 0 0 0
(C D)
11 0 0 (A B)
10 0 0 0 0
(C D)
Hence
f ( A, B, C, D) ( A B)( A B )(C D )(C D)
Example 37 Obtain the minimal POS expression for the Boolean function
given below using a four variable K-map.
f ( A, B, C, D) (3, 4, 6, 7,11,12,13,14,15)
Solution
A
CD B (B D)
00 01 11 10
00 0 0
(A B)
01 0
11 0 0 0 0 ( C D)
10 0 0
Hence
f ( A, B, C, D) ( A B )( B D)(C D )
45
A
CD B
00 01 11 10
00 x 1 ACD
AB
01 1 x 1
AD
11 x 1 1
10 1 1 1
AC
Hence
f ( A, B, C, D) AB A C AC D A D
ASSIGNMENT 5
(i) Obtain the minimal SOP expression for the Boolean function
given below using the K-map.
f ( A, B, C, D) (0, 3, 4, 7, 8) (10,11,12,13,14,15)
x
46
PRACTICAL DESIGNS OF COMBINATIONAL CIRCUIT
All arithmetic operations can be implemented using adders from basic logic gates.
Some of these logic circuits are discussed below.
The Half-Adder
The logic symbol of a half adder is as shown
A S
Half - adder
B Cout
Thus it accepts two inputs and produces two digits on the output: a sum bit (S) and a
carry bit (Cout).
The truth table of a half-adder is
Inputs outputs
A B S Cout
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
The Boolean expression for the sum output (S) can be expressed as
S AB A B
A B ……………………………………………………….…………(1)
And the Boolean expression for the carry output is
C AB …………………………………………………………………..(2)
The two equations can be implemented using logic circuits as
A
S
B
Cout
The Full-Adder
The logic symbol of a full-adder is as shown
A S
B Full - adder
Cin Cout
47
A full-adder accepts three inputs (two-input A and B, and a carry input (Cin)) and two
outputs: a sum output (S) and a carry-output (Cout).
The truth table of a full-adder is
Inputs Outputs
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
0` 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
The Boolean expression for the sum output as obtained from the truth table is
S A B Cin A BCin AB Cin ABC in ………………………………….…………(3)
A ( B Cin BCin ) A( B Cin BCin )
A ( B Cin ) A( B Cin ) ……………………………..………………………..(4)
Let Y B Cin , then equation (4) can be written as,
S A.Y A.Y
A Y ……………………………………..……………………………………(5)
Replacing Y with B Cin , equation (5) can be written as
S A ( B Cin )
A B Cin ……………………………………………..……………………..(6)
The Boolean expression for the carry-output is as shown with three ABC in terms
added since it has common factors with each of the other terms.
Cout A BCin AB Cin ABCin ABC in
BCin ( A A) AB Cin ABCin
BCin AB Cin ABCin
Cin ( B AB ) ABCin
BCin ACin ABCin
BCin A(Cin BCin )
BCin AC in AB ……………………………….…………………………..(7)
Equation (6) and (7) can be implemented by using logic gates as
48
A
B
S
Cin
Cout
Full-adder
A B Sum
A A S A S
A B C
Half- Half-
adder adder
B B Cout B Cout
(A B) C in
Cin
Carry output
(A B) C in AB
Parallel Adders
As shown above, a single full-adder can add two 1-bit numbers and an input carry.
Thus, to add binary numbers with more than one bit, parallel adders are used. To add
two binary numbers, a full adder is required for each bit in the number. Thus, for two-
bit numbers, two full-adders are used. Similarly, four full adders are required to add
four-bit numbers.
A block diagram of a basic 2-bit parallel adder using two full-adders is as shown.
49
A1 B1 A0 B0
Cin Cin
A B A B
Full- Full-
adder adder
Cout S Cout S
S2 S1 S0
(MSB) (LSB)
Similarly, a 4-bit parallel adder can be constructed using four full adders in parallel as
shown.
A3 B3 A2 B2 A1 B1 A0 B0
S2 S3 S2 S1 S0
(MSB) (LSB)
DECODERS
A decoder is used to decode the binary information in a digital system by changing it
into some other type of number system, preferably decimal or hexadecimal number
system. It converts an n-bit binary input code into a maximum of 2n unique output
lines.
A 3 to 8 line decoder is as shown.
A practical application of this decoder is binary to octal conversion. The input
variables will represent three binary digit number and output will represent the eight
digits in the octal number systems.
ENCODERS
This is just the reverse of decoding. It has 2n or less input lines and n output lines. For
example an octal to binary encoder is as shown below.
50
D0 CBA
A LSB D1 CBA
D 2 CBA
D3 CBA
D 4 CBA
C MSB
D5 CBA
D6 CBA
D7 CBA
A 3 to 8 line decoder
A
D0
D1
D2
D3 B
D4
D5
D6 C
D7
Octal to binary encoder
51
MULTIPLEXERS (MUX)
It is also known as data selector. It accepts several data inputs and selects only one of
them at a time and directs it to a single output line. A 4 line to 1 multiplexer is as
shown below.
S1 S0
I0
I1
Y
I2
I3
4 to 1 line multiplexer
The logic symbol and truth table of this MUX are
4 1MUX Y Output
S1 S0
S1 S0 Y
0 0 I0
0 1 I1
1 0 I2
1 1 I3
Exercise:
With the aid of truth tables, draw the logic circuits of the following Multiplexers
a) 2 to 1 MUX
b) 8 to 1 MUX
52
DEMULTIPLEXER [DEMUX]
It is also known as data distributor. It does the reverse of the multiplexer i.e. it takes in
a single input and distributes over several outputs. The select inputs will determine or
decide, to which output the data input will be transmitted.
For example, a 1 to 4 line demultiplexer with it truth table is as shown below.
Inputs Outputs
Data S1 S0 Y3 Y2 Y1 Y0
inputs
I 0 0 0 0 0 1
I 0 1 0 0 1 0
I 1 0 0 1 0 0
I 1 1 1 0 0 0
Exercise:
With the aid of truth tables, draw the logic circuits of the following Multiplexers
c) 1 to 2 DEMUX
d) 1 to 8 DEMUX
I S1 S0
Y0 S2 ,S1 I
Y1 S2 ,S1 I
Y2 S2 ,S1 I
Y3 S2 ,S1 I
1 to 4 line demultiplexer
53
ELEMENTS OF SEQUENTIAL LOGIC CIRCUITS
Introduction
Unlike combinational logic circuits, sequential logic circuits have memory elements
which store the previous output information of the circuit to be used as feedback.
A block diagram of a sequential logic circuit is as shown.
Inputs Output
Combinational
circuit Memory
elements
The storage elements are devices capable of storing binary information. The binary
information stored in these elements at any given time defines the state of the
sequential circuit at that time.
The sequential circuits receive binary information from external inputs. These inputs,
together with the present state of the storage elements, determine the binary of value
of outputs. They also determine the condition for changing the state in the storage
elements. Thus a sequential circuit is specified by a time sequence of inputs, outputs,
and internal states.
The differences between combinational and sequential circuits are as shown in the
table.
54
FLIP-FLOP (FF)
A general symbol for a flip-flop is as shown.
Q Normal
Flip-flop output
Inputs
Q Inverted
output
Flip-flop Symbol
It has two outputs labeled as Q and Q that are inverse (or complement) of each
other. When a reference of the state of the flip-flop is made, its usually referring
to the state of its normal (Q) output. There are two operating states of the flip-
flop. One is when Q 1, Q 0 which is called HIGH state or 1 state or SET state.
The other is when Q 0, Q 1 which is called LOW state or 0 state or RESET
state.
The flip-flop can have one or more inputs as shown in the block diagram. A flip-
flop is also called a latch or bistable multivibrator.
Latch
It’s the most basic type of flip-flop circuit. When a flip-flop operated without the
clock, it’s referred to as a latch.
There are two types of latches depending on whether a NAND or a NOR gate is
used to construct it.
SET
1 Q
2 Q
CLEAR
55
second case is when Q 1 and Q 0 . This shows that the HIGH from NAND-1
produces a LOW at the NAND-2 output, which in turn keeps the NAND-1 output
HIGH.
Thus, as long as SET = CLEAR = 1, the output Q 1 and Q 0 .
If CLEAR=0 AND SET= 1 and the outputs are Q 0 and Q 1 , then Q 0
keeps NAND-2 output HIGH with the LOW at CLEAR having no effect. If
CLEAR = 1, the latch outputs still remains Q 0 and Q 1 .
This can be summarized in a truth table below:
Inputs Outputs
SET CLEAR
1 1 No change
0 1 Q 1
1 0 Q0
0 0 Q Q 1 (invalid)
SET
1 Q
2 Q
CLEAR
Inputs Outputs
SET CLEAR
0 0 No change
1 0 Q 1
0 1 Q0
1 1 invalid
56
(i) SET = CLEAR = 0: This condition is the normal resting state for the
NOR latch. It has no effect on the output state. In other words, Q
and Q will remain in the same state in which they were prior to this input
condition.
(ii) SET = 1, CLEAR = 0: This condition always causes the output to go to
Q 1 state where it will remain even after SET returns to 0.
(iii) SET = 0, CLEAR = 1: This condition will always causes the output to go
to Q 0 state where it will remain even after CLEAR returns to 0.
(iv) SET = 1, CLEAR = 1: This condition tries to set and clear the latch
simultaneously. It produces invalid results and should not be used.
CLOCKED SIGNALS
Digital systems are of two types:
(i) Asynchronous systems: in these systems, the outputs of logic circuits can
change state any time one or more of the inputs change. They are
generally more difficult to design and troubleshoot than a synchronous.
(ii) Synchronous systems: In these systems, the exact time at which the
output can change states are determined by a signal commonly called a
clock.
Clocked signal is generally a rectangular pulse train as shown in the figure below.
0
Time
(a) Rectangular pulse train
A square wave can also be used as clock signal as shown.
0
(b) Square Wave
The synchronization in a digital system is accomplished through the use of
clocked flip-flops that are designed to change states on one or the other of the
clock’s transitions
Clocked flip-flops have a clock input that is labeled as CLK, CK or CP. But CLK
is commonly used. The CLK can either be edge triggered or level-triggered. Edge
triggered means the CLK is activated by a signal transition and is indicated by the
presence of a small triangle on the CLK input. The triggering transition can either
57
be the rising or the falling edge. The two cases are represented in a block diagram
form as shown.
SET SET
S Q S Q
CLK CLK
R CLR Q R CLR Q
SET
S Q
CLK
R CLR Q
(a) Symbol
INPUTS OUTPUT
S R Q
0 0 Q0 (no change)
1 0 1
0 1 0
1 1 Invalid
58
1
S
0
1
R
0
CLK
0
1
Q
0
No Set Reset Set Set
change
S
1
3 Q
Edge
detector
CLK
4 Q
R 2
59
SET
J Q
CLK
K CLR Q
(a) Symbol
INPUTS OUTPUT
J K Q
0 0 Q0 (no change)
1 0 1
0 1 0
1 1 Q0 (toggles)
J 1
0
1
K
0
CLK
0
1
Q
0
No Toggle Reset Set No Toggle Reset
change change
Initially all the inputs are 0, and the Q output is also assumed to be 0, i.e. Q0 0
When the rising edge of the first clock pulse occurs, J K 0 condition exists.
Thus the flip-flop does not change its output state, i.e. Q Q0 0 .
When the rising edge of the second clock pulse occurs, J K 1 condition exists.
Thus the flip-flop toggles to its opposite state i.e. Q Q0 0 1 .
60
When the rising edge of the third clock pulse occurs, J 0 and K 1 condition
exists. Thus the flip-flop is cleared to the Q 0 state.
When the rising edge of the fourth clock pulse occurs, J 1 and K 0 condition
exists. This condition sets the output Q to 1 state.
When the rising edge of fifth pulse occurs, J 1 and K 0 condition exists. This
is the condition that sets the output Q to 1. However since Q is already 1, so it
will remain there. Hence no change in the output state.
When the rising edge of sixth pulse occurs, J K 1 condition exists. This is the
condition causes the flip-flop to toggle to its opposite state.
When the rising edge of seventh pulse occurs, J 0 and K 1 condition exists.
This is the condition causes the clear to Q 0 state.
J
1 Q
Edge
CLK detector
2 Q
K
(iv) The only difference between the internal circuitry of edge-triggered J-K flip-
flop and S-R flip-flop is that in J-K, Q and Q outputs are fed back to the pulse
–steering NOR gates.
(v) It is because of this feedback connection that J-K flip-flop gives the toggle
operation for J K 1 condition.
All the sequential circuits that we have been covered so far have problem (All the
level sensitive sequential circuits have this problem). Before the enable input
changes state from HIGH to LOW, if inputs changes, then another state transition
61
occurs for the same enable pulse. This sort of multiple transition problem is called
racing. We can overcome this problem using a two stage J-K flip-flop as shown in
the block diagram below.
SET SET
J J Q J Q Q
K K CLR Q K CLR Q Q
CLK
In the figure above there are two latches, the first latch on RHS is called master
latch and the one on LHS is called slave latch. Master latch is positively clocked
and slave latch is negatively clock.
The internal logic circuit of the master-slave J-K flip-flop is as shown below.
During the posive edge of the clock signal, the inputs are first passed on to the
master flip-flop while the the slave flip-flop is disabled. During the the negative
edge of the clock siganal, the master flip-flop is disabled while the slave is
enabled. Hence the output of the master flip-flop becomes the inputs of the slave
flip-flop and are passed as the output Q and Q .
K
Q
CLK
Q
J
CLOCKED D FLIP-FLOP
The logic symbol and truth table of J-K flip-flop are as shown below:
SET
D Q
CLK
CLR Q
(a) Symbol
62
Inputs output
D Q
0 Q
1 1
1
D
0
1
CLK
0
1
Q
0
D J
Q
CLK
Q
K
D-LATCH
63
D Q
D-Latch Symbol
Its logic gate implementation is also as shown below. It consists of two NOR gates
connected as shown with complement inputs. Its truth table is similar to that of a D
flip-flop with the exception that in the later, the inputs are controlled by a clock signal
while in this case the input are not controlled. As the inputs are fed to the gates, they
are manipulated by the gates based on the present levels of the outputs and a next
output is produced. For such a logic circuit, its sometimes difficult to predict the
output of latch.
D Q
T FLIP-FLOP
This flip-flop is also called a Toggle flip-flop since its outputs toggles
continuously based on the clocked changes its value. It based on the characteristic
of a J-K flip-flop when both its inputs are at logic level 1.
It logic symbol is as shown:
SET
T=1 J Q
CLK
K CLR Q
64
T=1
Q
The output of the circuit toggles or changes its state from low to high or from high
to low depending on the previous state of the output at very instant of positive
going edge of the clock signal. Hence it truth table is as shown below
Inputs output
T Q
0 Q
1 1
1
T
0
1
CLK
0
1
Q
0
65