Utffdrnit fcfx2 xfdffgftDccfxfcgcdffcE notgfgcrdfcfcesvyvhgyjhtdhde
Utffdrnit fcfx2 xfdffgftDccfxfcgcdffcE notgfgcrdfcfcesvyvhgyjhtdhde
Utffdrnit fcfx2 xfdffgftDccfxfcgcdffcE notgfgcrdfcfcesvyvhgyjhtdhde
COMBINATIONAL LOGIC
1.1 INTRODUCTION:
The digital system consists of two types of circuits, namely
Combinational circuits
Sequential circuits
Combinational circuit consists of logic gates whose output at any time is
determined from the present combination of inputs. The logic gate is the most basic
building block of combinational logic. The logical function performed by a
combinational circuit is fully defined by a set of Boolean expressions.
Sequential logic circuit comprises both logic gates and the state of storage
elements such as flip-flops. As a consequence, the output of a sequential circuit
depends not only on present value of inputs but also on the past state of inputs.
A combinational circuit consists of input variables, logic gates, and output
variables. The logic gates accept signals from inputs and output signals are generated
according to the logic circuits employed in it. Binary information from the given data
transforms to desired output data in this process. Both input and output are obviously
the binary signals, i.e., both the input and output signals are of two possible states,
logic1 and logic 0.
For n number of input variables to a combinational circuit, 2n possible
combinations of binary input states are possible. For each possible combination, there
is one and only one possible output combination. A combinational logic circuit can
1.2 Combinational Logic
X Y Z
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 1
1 1 1 0
Any combinational logic can be represented by truth tables but, in some cases the
table became too large.
The OR gate
The OR gate has two or more inputs. The output from the OR gate is 1 if any of
the inputs is 1. The gate output is 0 if and only if all inputs are 0. The OR gate is drawn
as shown in Figure 2.4.
For a 3-input XOR gate with inputs A, B and C the truth table is given by
The output from the XNOR gate is written as which reads XNOR
For a 3-input XNOR gate with inputs A, B and C the truth table is given by
A B C
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 0
UNIVERSAL GATES
NAND Gate as a Universal Gate
The NAND gate is said to be a universal gate because any digital system can be
implemented with it. The implementation of AND, OR and NOT operations with NAND
gates is shown in Figure 1.9 and EX-OR operations with NAND gates is shown in Figure
1.10.
Digital Principles and Computer Organization 1.11
Example 1.1: Draw the logic circuit using basic gates for the function
Example 1.2: Reduce the given combinational logic circuit to a minimum form.
Solution:
Example 1.3:
W = ABC + CAB + BAC
= ABC + ABC + ABC (Theorem 1a)
= ABC + ABC (Theorem 3b)
= ABC
1.14 Combinational Logic
Example 1.4:
Example 1.5:
Example 1.6:
Y = AB + A(B + C) + B(B + C)
= AB + AB + AC + BB + BC
= AB + AB + AC + B + BC (BB = B)
= AB + AC + B + BC (AB + AB = AB)
= AB + AC + B (B + BC = B)
= AC + B (B + BA = B)
Example 1.7:
Simplify the following Boolean expression to a minimum number of literals: (Dec
2011)
Digital Principles and Computer Organization 1.15
operations, the simplified equation may betranslated back into circuit form a logic circuit
performing the same function with fewer components. If equivalent function may be
achieved with fewer component, the result will be increased reliability and decreased cost
of manufacture.
To this end, there are several rules of Boolean algebra presented in this section for
use in reducing expressions to their simplest forms. The identities and properties already
reviewed in this chapter are very useful in Boolean simplification, and for the most part
bear similarity to many identities and
shown in this section are all unique to Boolean mathematics.
Rule 1:
A + AB
Applying identity B + 1 = 1
A(1)
Applying identity 1A = A
A
Digital Principles and Computer Organization 1.17
Rule 3:
The final expression, B(A + C), is much simpler than the original, yet performs the
same function. The truth tables for these two expressions should be identical.
Digital Principles and Computer Organization 1.19
Figure 1.17 shows the AND-OR logic circuit and Figure 1.18 shows the NAND-
NAND circuit for the expression.
Example 1.9:
Suppose a truth table has a low output for the first three input conditions: 000, 001
and 010. If all other outputs are high, what is the product-of-sum (POS) form?
Solution:
Example 1.10:
Suppose a 3 variable truth table has a high output for these input conditions:
000,010, 100 and 110. What is the sum-of-product (SOP) form?
Solution:
Example 1.11:
Convert the Boolean expressions to SOP form.
(a) AB + B(CD + EF) = AB + BCD + BEF
(b) (A + B) (B + C + D) = AB + AC + AD + BB + BC + BD
(c)
1.22 Combinational Logic
Figure 1.19 Shows the OR-AND logic circuit and Figure 1.20 shows the NOR-NOR
logic circuit for this expression.
=
he second theorem states that the complement of a sum is equal to the product of the
complements.
(A+ =
Consensus Theorem:
In simplification of Boolean expression, an expression of the form
BC, the term BC is redundant and can be eliminated to form the equivalent expression
AB+
is stated as,
AB+ BC = AB+
The dual form of consensus theorem is stated as,
(A+B) (B+C) = (A+B)
1.24 Combinational Logic
BOOLEAN FUNCTIONS:
Minimization of Boolean Expressions:
The Boolean expressions can be simplified by applying properties, laws and
theorems of Boolean algebra.
Simplify the following Boolean functions to a minimum number of literals:
1. x
= xy [ ]
= 0 + xy [ x+ 0 = x ]
= xy.
2.
= x + xy + [ x+ xy= x]
=
= x+ y (1) [ x+ = 1]
= x+ y.
3. (x+ y)
= x.x+ xy+
= xy+ 0 [ x. x= 0]; [ y.
= x (1+
= x (1) [ 1+y= 1 ]
= x.
4. xy + yz.
+ yz( x+ [ 1]
= xy + + xyz +
Re-arranging,
= xy + xyz +
= xy (1+ z) + (1+y) [1+y= 1]
= xy+
Digital Principles and Computer Organization 1.25
5. xy+ yz+
= xy+ z ( y+
= xy+ z ( 1 ) [ = 1]
= xy+ z.
6. (x+ y) z) (y+ z)
= (x+ y) z) [ dual form of consensus theorem,
(A+ B) (B+ C) = (A+ B) C) ]
7.
=y( x) + [ x (y+ z) = xy+ xz ]
=y(1)+ = 1]
= y+ [ x+ ]
=
8. x+
= x (1+
= x (1) + [ 1+ x = 1 ]
= x+ [ x+ ]
= x+ y.
9. AB + (AC)' + (AB + C)
= AB + (AC)' + AAB'BC + AB'CC
= AB + (AC)' + 0+ AB'CC [B.B' = 0]
= AB + (AC)' + AB'C [C.C = 1]
= AB + A' + C' +AB'C [(AC)' = A' + C']
= AB + C' + AB' + = +
= A' + B+ + AB = + B]
Re- arranging,
= A' B+ C' + AB = + B]
1.26 Combinational Logic
= A' B+ C'
= A' +1+ [ A+ 1= 1]
=1
10. (x+ y)
= yx+ y.y
= xy+ y [ x. x= x]
=y( x+ 1)
= y( 1 ) [ 1+ x = 1 ]
= y.
11. xy+ xyz+ xy (w+ z)
= xy ( 1+ z+ w+ z)
= xy ( 1 ) [ 1+ x = 1 ]
= xy.
12. xy+ xyz+
= xy ( 1+
= xy ( 1 ) + [ 1+ x = 1 ]
= xy+
= y ( x+ ) [ x+ = x+ y]
= y ( x+ z ).
13. xyz+
= xy (z+ +
= xy+ [ 1]
= x(y+ [ x+ = x+ y]
= x(y+ z)
14.
= y)+ y)
Digital Principles and Computer Organization 1.27
= [ x+
= x)
= [ x+
15.
= 1) +
= [ 1+ x = 1 ]
= (y+
= [ x+
=x
=x [
16. wxz
= y)+ wxz
= (1)+ wxz [ 1]
= wxz
= w)
= xz. [ x+
17.
= +
= (1) (1)+ [ 1]
=
= +
= + [ x+
= +
= [
18. + +
= +
1.28 Combinational Logic
= + + = x]
= + +
=0+ + + [x. 0]
Re-arranging,
= + +
= (y+
= (y+ [ x+
= (y+x) [ x+ = x+ y]
19. xy+ x (y+ z) + y (y+ z)
= xy+ xy+ xz+ yy+ yz
= xy+ xz+ y+ yz [x+ x= x]; [x. x= x]
= xy+ xz+ y [x+ xy= x]
= y+ xz [x+ xy= x]
20. [ (z+ wy) + z
=[ z
=[ z [x. 0]
= z+
= [x. x= x]
=
= (1) [ x+
21. xyz
= yz
= yz (1) + (x+ + [ x+
= yz+ (1) + [ x+
= yz+
Digital Principles and Computer Organization 1.29
= yz+ xz)
= x) [ y]
=
22.
=[
=[ [x+ x= x]
= [ y]
= [ x+
=[ [ 1+ x = 1 ]
= 0.
23. [
=
=
=
= [x+ x= x]
=
= y]
= [x+ xy = x]
=
= [x+ xy = x]
= [x+ xy = x]
24. xy+
= xy+
= xy+ (x+ z) = x]
= xy+
= xy+ [x. x= x]
1.30 Combinational Logic
= xy+ [1+ z]
= xy+ [1] [ 1+ x = 1 ]
= xy+
= x( y+
= x [1] [ 1]
= x.
25. [(
= [ x( (y+
=[ (y+ y]
= [ x(
=[ xy+ [x. x= x]
=[( [x+ xy = x]
=[ (xz
=[
=[ = x]
=[ [ (x+ y) (x+ z)= x+ yz]
=[
= [ 1+ [ 1]
= [ 1+ x = 1 ]
= 0.
26. [
=[
= [ xy. xy. z+
= [ 0+ xyz+ 0]
= [ xyz+
= (
Digital Principles and Computer Organization 1.31
=(
=( y+ z). = x]
27. (x+ y) z)
= (x+ y) z)
= (x+ y) z)
=(
= ( 0+ xz+ yz)
= (xz+ yz)
= xz. yz.
= 0 [x. [x. x= x]
= z)
(1) [ 1+ x = 1 ]
28. Y= (1, 3, 5, 7)
= xyz
= + xz(
= (1)+ xz (1) [ x+
xz
= z( x)
= z (1) [ 1]
= z.
1.32 Combinational Logic
The terms withing a Karnaugh Map are obtained by combining the row and
column boolean expression that are shown at the top and left margins of the Karnaugh
Map. Each combined term within the Karnaugh Map corresponds to a single line of inputs
in a truth table. Terms that have a line over them corresponds to a low or zero input. Terms
without any marking corresponds to a high or 1input.
It is valid to encircle the as shown below. But the isolated 1 results in a more
complicated equation.
Visualize the picking up the karnaugh map and rolling it so that the left side
touches the rightside. By doing so, the two pairs can be realised as Quad.
The quad has the equation,
Rolling and Overlapping: It is possible to overlap and roll the map to get large groups.
1.36 Combinational Logic
Solution:
1. Given the truth table, draw a Karnaugh map with other cares.
2. Enclose the actual on the Karnaugh map in the largest groups you can find by
treating the cares
3. After the actual have been included in groups, disregard the remaining
cares byvisualizing them
Example:
Here cares are of no help. The best way is, encircle the isolated 1, while
treating caresas
Minterms that are next to each other horizontally or vertically, can be grouped
together.
Minterms that have been grouped in a Karnaugh Map, can be reduced to the
boolean terms that are common with all the terms in the group.
Minterms that cannot be grouped together, cannot be reduced.
Use a minterm for grouping more than once.
All must be accounted for.
Example 1.12:
Determine the Karnaugh Map and reduced boolean equation for the truth table
shown in Table 1.12.
TABLE 1.12: Truth Table
Without reduction the Boolean Equation for the above truth table is:
Each minterm corresponds to an instance in the truth table when the output is high.
The KarnaughMap for the above truth table, with the allowed groupings are shown below:
The map shows two groupings that cover each minterm. Each of these groupings
will reduce toone term.
The two terms that are grouped together reduces to . This is because
and arecommon to both terms.
The four terms and and and that are grouped together
reduces to C. This is because is the only input common to all four terms.
Digital Principles and Computer Organization 1.39
Example 1.13:
Simplify the following SOP expression on a Karnaugh Map.
Solution:
The expression is evaluated as follows:
Example 1.14:
Simplify the SOP by using K-map
Y = m(0,1,3,7)
Example 1.15:
Simplify the expression
Solution:
Digital Principles and Computer Organization 1.41
Example 1.16:
Simplify the Boolean expression using K map
Solution:
The given expression is not a standard SOP form. First convert this non-standard
SOP to standard SOP and then simplify the expression using K-map.
Example 1.17:
Use a K map to minimize the following SOP expression:
Solution:
1.42 Combinational Logic
Example 1.18:
Simplify the expression
F= m(0,2,4,5,6,7,8,10,11,12,14,15)
Solution:
Example 1.19:
Simplify the expression using K-map
Example 1.20:
Simplify the following SOP expression on a K-map
Solution:
Digital Principles and Computer Organization 1.43
The SOP expression is obviously not in standard form because each product term
does nothave 4 variables. The first and second term are both missing 2 variables, the third
term is missing one variable and the rest of the terms are standard. First expand the terms
by including all combinations of the missing variables numerically as follows:
Example 1.21:
Simplify using K-map
F(A, B, C, D) m (7,8,9) + d (10,11,12,13,14,15)
Solution:
1.44 Combinational Logic
(or)
Digital Principles and Computer Organization 1.45
Example 1.23:
Using the K-Map method, simplify the following Boolean function
F m (0,2,3,6,7) + d (8, 10, 11, 15) (April 2005)
Solution:
Example 1.24:
Simplify the following Boolean function F using Karnaugh map method.
F C, D 1, 4,5,6,12,14,15
1.46 Combinational Logic
Example 1.25:
Example 1.26:
Example 1.27:
Digital Principles and Computer Organization 1.47
Example 1.28:
Implement the switching function. (May 2012)
1.48 Combinational Logic
Example 1.29:
Example 1.30:
F(w, x, y, z) = m(0, 7, 8, 9, 10, 12) + d(2, 5, 13) (May 2013)
group can be obtained by the OR operation of the variables that are same for all cells of
that group. Here, a variable corresponding to to be represented in an
uncomplemented form.
Example 1.31:
Simplify, the POS expression using K map method.
F (0, 1, 4, 5, 6, 8, 9, 12, 13, 14)
Solution:
Example 1.32:
Simplify the POS expression
F = (0,6,7,8,12,13,14,15)
1.50 Combinational Logic
Example 1.33:
Simplify the expression
F(A, B, C, D) = M (4,5,6,7,8,12) . d(1,2,3,9,11,14)
Solution:
Example 1.34:
Simplify the POS expression,
F = M (0,3,4,7,8,10,12,14).d(2,6)
Example 1.35:
Determine the minterm sum of product form of the switching function.
F= (0,1,4,5,6,11,14,15,16,17,20,22,30,32,33,36,37,48,49,52,53,59,63)
(Dec. 2010)
Digital Principles and Computer Organization 1.51
Solution:
Fill up the K-map with the variable given
Four in each box form a group of 16 bits and their reduced function is .
Therefore
F= (0,1,4,5,6,11,14,15,16,17,20,22,30,32,33,36,37,48,49,52,53,59,63)
Example 1.36:
Minimize the following expression using Karnaugh map.
1.52 Combinational Logic
Example 1.37:
Simplify the following Boolean function F using Karnaugh map method.
Digital Principles and Computer Organization 1.53
Example 1.38:
Simplify F(A, B, C, D) = (0, 1, 2, 5, 8, 9, 10) in sum of products and product
ofsums using K-map. (Dec 2012)
Solution:
1.54 Combinational Logic
SOP:
POS:
Example 1.39:
Simplify the Boolean expression:
F ( A, B, C, D, E) = (0, 2, 3, 4, 5, 6, 7, 11, 15, 16, 18, 19, 23, 27, 31)
Digital Principles and Computer Organization 1.55
Example 1.40:
Simplify the Boolean function
F ( A, B, C, D, E) = ( 0, 1, 4, 5, 16, 17, 21, 25, 29)
1.56 Combinational Logic
Example 1.41:
Find the minimal sum of product form for the following switching function:
Example 1.42:
Find the minimal sum of product expression for the following switching function:
Digital Principles and Computer Organization 1.57
0 0 0 0
1.58 Combinational Logic
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
Y = AB + AC + BC
Draw the logic diagram for Y = AB + AC + BC.
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 1
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
Using K map obtain the Boolean expression for output variable Y
Y=AB+CD
1.60 Combinational Logic
The first one representing the SUM output is that of an EX-OR gate, the second
one representing the CARRY output is that of an AND gate.
The logic diagram of the half adder is,
To derive the simplified Boolean expression from the truth table, the Karnaugh
map method is adopted as,
Digital Principles and Computer Organization 1.63
The Boolean expressions for the SUM and CARRY outputs are given by the
equations,
Sum, S = in + in + in + ABCin
Carry, Cout = AB+ ACin + BCin .
The logic diagram for the above functions is shown as,
= AB+ ACin+ in
= AB (Cin+1) + ACin+ in [Cin+1= 1]
= ABCin+ AB+ ACin+ in
= AB+ ACin+ BCin (A
= AB+ ACin+ BCin.
Fig. 1.29 Implementation of full adder with two half-adders and an OR gate
Half -Subtractor:
A half-subtractor is a combinational circuit that can be used to subtract one
binary digit from another to produce a DIFFERENCE output and a BORROW output.
The BORROW output here specifies whether a has been borrowed to perform the
subtraction.
The Boolean expressions for the DIFFERENCE and BORROW outputs are
given by the equations,
Difference, D = in+ in + in + ABB in Borrow,
Bout = in + BBin .
The logic diagram for the above functions is shown as,
Digital Principles and Computer Organization 1.67
The bits are added with full adders, starting from the least significant position,
to form the sum it and carry bit. The input carry C0 in the least significant position
must be 0. The carry output of the lower order stage is connected to the carry input of the
next higher order stage. Hence this type of adder is called ripple-carry adder.
In the least significant stage, A0, B0 and C0 (which is 0) are added resulting
in sum S0 and carry C1. This carry C1 becomes the carry input to the second stage.
Similarly in the second stage, A1, B 1 and C1 are added resulting in sum S1 and
carry C2, in the third stage, A2, B2 and C2 are added resulting in sum S2 and carry
C3, in the third stage, A3, B3 and C3 are added resulting in sum S3 and C4, which
is the output carry. Thus the circuit results in a sum (S3S2S1S0) and a carry output
(Cout).
Binary Subtractor (Parallel Subtractor):
The subtraction of unsigned binary numbers can be done most conveniently
by means of complements. The subtraction A-
complement of B and adding it to A. The complement can be obtained by taking
the complement and adding 1 to the least significant pair of bits. The
complement can be implemented with inverters and a 1 can be added to the sum
through the input carry.
The circuit for subtracting A-B consists of an adder with inverters placed
between each data input B and the corresponding input of the full adder. The input
carry C0 must be equal to 1 when performing subtraction. The operation thus
the complement of B.
Parallel Adder/ Subtractor:
The addition and subtraction operation can be combined into one circuit with
one common binary adder. This is done by including an exclusive-OR gate with each
full adder. A 4-bit adder Subtractor circuit is shown below.
Consider the arithmetic addition of two decimal digits in BCD, together with an
input carry from a previous stage. Since each input digit does not exceed 9, the output
sum cannot be greater than 9+ 9+1 = 19; the 1 is the sum being an input carry.
The adder will form the sum in binary and produce a result that ranges from 0 through
19.
These binary numbers are labeled by symbols K, Z8, Z4, Z2, Z1, K is the carry.
The columns under the binary sum list the binary values that appear in the outputs of
the 4-bit binary adder. The output sum of the two decimal digits must be represented
in BCD.
Binary Sum BCD Sum
K Z8 Z4 Z2 Z1 C S8 S4 S2 S1 Decimal
0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 2
0 0 0 1 1 0 0 0 1 1 3
0 0 1 0 0 0 0 1 0 0 4
0 0 1 0 1 0 0 1 0 1 5
0 0 1 1 0 0 0 1 1 0 6
0 0 1 1 1 0 0 1 1 1 7
0 1 0 0 0 0 1 0 0 0 8
0 1 0 0 1 0 1 0 0 1 9
0 1 0 1 0 1 0 0 0 0 10
0 1 0 1 1 1 0 0 0 1 11
0 1 1 0 0 1 0 0 1 0 12
0 1 1 0 1 1 0 0 1 1 13
0 1 1 1 1 1 0 1 0 0 14
0 1 1 1 1 1 0 1 0 1 15
1 0 0 0 0 1 0 1 1 0 16
1 0 0 0 1 1 0 1 1 1 17
1 0 0 1 0 1 1 0 0 0 18
1 0 0 1 1 1 1 0 0 1 19
1.72 Combinational Logic
In examining the contents of the table, it is apparent that when the binary sum is
equal to or less than 1001, the corresponding BCD number is identical, and therefore no
conversion is needed. When the binary sum is greater than 9 (1001), we obtain a non-
valid BCD representation. The addition of binary 6 (0110) to the binary sum converts
it to the correct BCD representation and also produces an output carry as required.
The logic circuit to detect sum greater than 9 can be determined by
simplifying the boolean expression of the given truth table.
sum through the bottom 4-bit adder. The output carry generated from the bottom adder
can be ignored, since it supplies information already available at the output carry terminal.
The output carry from one stage must be connected to the input carry of the next
higher-order stage.
Boolean expressions requires a truth table of 22n entries and becomes too lengthy and
cumbersome.
2-bit Magnitude Comparator:
The truth table of 2-bit comparator is given in table below
Table 1.17 Truth table
Inputs Outputs
A3 A2 A1 A0 A>B A=B A<B
0 0 0 0 0 1 0
0 0 0 1 0 0 1
0 0 1 0 0 0 1
0 0 1 1 0 0 1
0 1 0 0 1 0 0
0 1 0 1 0 1 0
0 1 1 0 0 0 1
0 1 1 1 0 0 1
1 0 0 0 1 0 0
1 0 0 1 1 0 0
1 0 1 0 0 1 0
1 0 1 1 0 0 1
1 1 0 0 1 0 0
1 1 0 1 1 0 0
1 1 1 0 1 0 0
1 1 1 1 0 1 0
K-map Simplification:
Digital Principles and Computer Organization 1.75
Logic Diagram:
1 or 0, the equality relation of each pair can be expressed logically by the equivalence
function as
Xi = AiBi + Ai i for i = 1, 2, 3, 4.
Or, Xi = (A or, Xi A B
Or, Xi = (AiBi + Ai i
where,
Xi =1 only if the pair of bits in position i are equal (ie., if both are 1 or both
are 0).
To satisfy the equality condition of two numbers A and B, it is necessary that
all Xi must be equal to logic 1. This indicates the AND operation of all Xi variables. In
other words, we can write the Boolean expression for two equal 4-bit numbers.
(A = B) = X3X2X1 X0.
The binary variable (A=B) is equal to 1 only if all pairs of digits of the two
numbers are equal.
To determine if A is greater than or less than B, we inspect the relative
magnitudes of pairs of significant bits starting from the most significant bit. If the
two digits of the most significant position are equal, the next significant pair of digits
is compared. The comparison process is continued until a pair of unequal digits is
found. It may be concluded that A>B, if the corresponding digit of A is 1 and B is 0.
If the corresponding digit of A is 0 and B is 1, we conclude that A<B. Therefore, we
can derive the logical expression of such sequential comparison by the following two
Boolean functions,
(A>B) = A3B3 3A2B2 3X2A1B1 3X2X1A0B0 (A<B)
= A3 3 +X3A2 2 +X3X2A1 1 +X3X2X1A0 0
The symbols (A>B) and (A<B) are binary output variables that are equal to 1
when A>B or A<B, respectively.
The gate implementation of the three output variables just derived is simpler
than it seems because it involves a certain amount of repetition. The unequal outputs
can use the same gates that are needed to generate the equal output. The logic diagram
of the 4-bit magnitude comparator is shown below,
The four x outputs are generated with exclusive-NOR circuits and applied to
anAND gate to give the binary output variable (A=B). The other two outputs use the
Digital Principles and Computer Organization 1.77
Inputs Outputs
Enable A B Y3 Y2 Y1 Y0
0 x x 0 0 0 0
1 0 0 0 0 0 1
1 0 1 0 0 1 0
1 1 0 0 1 0 0
1 1 1 1 0 0 0
As shown in the truth table, if enable input is 1 (EN= 1) only one of the
outputs (Y0 Y3), is active for a given input.
The output Y0 is active, ie.,
Y0= 1 when inputs A= B= 0,
Y1 is active when inputs, A= 0 and B= 1,
Y2 is active, when input A= 1 and B= 0,
Y3 is active, when inputs A= B= 1.
3 to-8 Line Decoder:
A 3-to-8 line decoder has three inputs (A, B, C) and eight outputs (Y0- Y7).
Based on the 3 inputs one of the eight outputs is selected.
The three inputs are decoded into eight outputs, each output representing one
of the minterms of the 3-input variables. This decoder is used for binary-to-octal
conversion. The input variables may represent a binary number and the outputs will
represent the eight digits in the octal number system. The output variables are mutually
exclusive because only one output can be equal to 1 at any one time. The output line
whose value is equal to 1 represents the minterm equivalent of the binary number
presently available in the input lines.
Inputs Outputs
A B C Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
1.80 Combinational Logic
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
Each segment is made up of a material that emits light when current is passed
through it. The segments activated during each digit display are tabulated as
1.82 Combinational Logic
K-map Simplification:
1.84 Combinational Logic
Logic Diagram:
Applications of decoders:
Decoders are used in counter system.
They are used in analog to digital converter.
Decoder outputs can be used to drive a display system.
1.11 ENCODERS:
An encoder is a digital circuit that performs the inverse operation of a decoder.
Hence, the opposite of the decoding process is called encoding. An encoder is a
combinational circuit that converts binary information from 2n input lines to a
maximum of unique output lines.
The general structure of encoder circuit is
0 0 0 1 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 0 1 1 1 1
The encoder can be implemented with OR gates whose inputs are determined
directly from the truth table. Output z is equal to 1, when the input octal digit is 1 or
3 or 5 or 7. Output y is 1 for octal digits 2, 3, 6, or 7 and the output is 1 for digits 4,
5, 6 or 7. These conditions can be expressed by the following output Boolean functions:
z = D1+ D3+ D5+ D7
y = D2+ D3+ D6+ D7 x= D4+ D5+ D6+ D7
The encoder can be implemented with three OR gates. The encoder defined in
the below table, has the limitation that only one input can be active at any given time.
If two inputs are active simultaneously, the output produces an undefined combination.
For eg., if D3 and D6 are 1 simultaneously, the output of the encoder may be
111. This does not represent either D6 or D3. To resolve this problem, encoder
circuits must establish an input priority to ensure that only one input is encoded. If
we establish a higher priority for inputs with higher subscript numbers and if D3 and
D6 are 1 at the same time, the output will be 110 because D6 has higher priority than
D3.
is replaced first by 0 and then by 1, we obtain all 16 possible input combinations. For
example, the third row in the table with X100 represents minterms 0100 and 1100.
The care condition is replaced by 0 and 1 as shown in the table below.
1.88 Combinational Logic
K-map Simplification:
Digital Principles and Computer Organization 1.89
1.12 MULTIPLEXERS
Multiplex means into A multiplexer is a combinational circuit with
many inputs but only one output. By applying control signals, we can steer any input to
n m signals and 1 output signal. Multiplexer is
called as data selector or because the output bit depends on the input data bit that is
selected. The block diagram of multiplexer is shown in Figure 1.48.
1.90 Combinational Logic
Fig 1.48
1.12.1 4-to-1 Line Multiplexer
A 4-to-1 line multiplexer has four (n) input lines, two (m) select lines and one
output line. The selection (control) lines decide the number of input lines. If the number
n 2m, then m select lines are required to select one of the n
input lines.
The logic symbol of a 4-to-1 multiplexer is shown in Figure 1.49. If has 4 input
lines (I0 to I3), two select lines (S0, S1) and a single output line. The function table of 4-
to-1 multiplexer is shown in Table 1.19.
1. Y = I0 iff S1 = 0 , S0 = 0
2. Y = I1 iff S1 = 0, S0 = 1
3. Y = I2 iff S1 = 1 , S0 = 0
4. Y = I3 iff S1 = S0 = 1
Using this expression, the 4-to-1 multiplexer can be implemented using gates
as shown in Figure 1.50.
Y = D0
If D0 = 0, Y = 0
D0 = 1, Y = 1 i.e., Y depends only on the value of D0
When ABCD = 1111, Y = D15.
Thus the control bits (A, B, C, D) determines which of the input data bits is transmitted
to the output.
Figure 1.51 shows the logic diagram of 16-to-1 multiplexer.
TABLE 1.20: Truth Table of 16-to-1 MUX
Enable Select Inputs Output
E S3 S2 S1 S0 Y
0 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
0 0 1 1 1
0 1 0 0 0
0 1 0 0 1
0 1 0 1 0
0 1 0 1 1
0 1 1 0 0
0 1 1 0 1
0 1 1 1 0
0 1 1 1 1
1 X X X X 1
Digital Principles and Computer Organization 1.93
gate to E input of MUX2. Therefore, when S3 = 0, MUX1 is selected and the inputs (D0
to D7) are multiplexed to the output and MUX2 is disabled. When S3 = 1, the MUX 1 is
disabled while MUX 2 is enabled and the inputs (D8 to D15) aremultiplexed to the output.
1.13 DEMULTIPLEXERS
Demultiplex means
circuit with one input and many outputs. By applying control signal, we can steer the input
signal to one of the output lines. Figure 1.53 shows the block diagram of demultiplexer. It
has 1 input signal, control signals and output signals.
The select inputs (Control Signals) determine to which output the data input will
be connected. As the serial data is changed to parallel data, i.e., the input caused to appear
on one of n output lines, the demultiplexer is called data distributor or serial-to-
parallel converter.