1. DLD
1. DLD
1. DLD
Number Systems
LEARNING OBJECTIVES
1 1 \ (347)10= (533)8
Ans: (533.7341)8
= (1110100000)2
Chapter 1 • Number Systems | 1.5
Hexa Decimal Binary
Example 21: (18.675)10
A 10 1010
(18)10
F 15 1111
16 18 B 11 1011
1 2 C 12 1100
Decimal Hexa B 11 1011
1 – 1 E 14 1110
2 – 2 (18)10= (12)16 D 13 1101
(0.675)10 = (1010111110111100.101111101101)2
1.6 | Unit 1 • Digital Logic
Binary to hexadecimal number system Example 32: 10’s complement of (2657)10 is (10)4 – 2657
To convert binary number to a hexadecimal number, start- 10000
ing from the binary point, make groups of 4-bits each on 2657
either side of the binary point and replace each 4-bit group 7343
by the equivalent hexadecimal digit. Example 33: 9’s complement of (2657)10 is (104 -1) - 2657
Example 26: (11001001)2 10000
1100 1001 – 1
→ 9999
12 9
2657
→ (C9)16
7342
Example 27: (1011011011.01111)2
•• r’s complement can be obtained by adding 1 to (r – 1)’s
0010 1101 1011 0111 1000 complement.
⋅ = (2 DB.78)16
2 D B 7 8 r m – N = {(r m - 1) – N} + 1
Example 34: 2’s complement of (101101)2 is
Hexadecimal to octal number system = (2)6 – 101101
The simplest way to convert hexadecimal to octal is, first (26)10 = (100000)2
convert the given hexadecimal number to binary and the 2’s complement is 100000
Binary number to Octal. –101101
Example 28: (C3AF)16 010011
→ 001100001110101111 Example 35: 1’s complement of (101101)2 is
→ (141657)8 26 – 1 = 1000000
Example 29: (C6.AE)16 – 1
→ 0011000110.10101110 111111
→ (306.534)8 101101
1’s complement –010010
Octal to hexadecimal number system The one’s complement of a binary number is formed by
The simplest way to convert octal to hexadecimal is first changing 1’s to 0’s and 0’s to 1’s, The 2’s complement can
convert the given octal number to binary and then the binary be formed by leaving all least significant 0’s and the first 1
number to hexadecimal. unchanged, and replacing 1’s with zeros and zeros with 1’s
in all other bits.
Example 30: (775)8
If the number M contains radix point, the point should be
→ (000111111101)2
removed temporarily in order to form r’s/ (r - 1)’s complement.
→ (1FD)16
The radix point is then restored to the complemented
Example 31: (34.7)8 number in the same relative position.
→ (00011100.1110)2
Example 36: What is 1’s complement of (1001.011)2?
→ (1C.E)16
→ Consider without radix point 1001011
Take 1’s complement 0110100
Complements Place radix point again (0110.100)2
Complements are used in digital computers to simplify the Example 37: What is 2’s complement of (1001.011)2?
subtraction operation and for logical manipulation. Consider without radix point 1001011
There are two types of complements for each base - Take 2’s complement 0110101
r-system. Place radix point again (0110.101)2
1. Radix complement (or) r’s complement: the r’s com- Complement of a complement is equal to the original
plement of an m digit number N in base r is r m – N for number r m – (r m – M) = M
N ≠ 0.
For example, N = 0, r’s complement is 0. Subtraction with Complements
2. Diminished radix complement: (or) (r -1)’s comple- Subtraction of two n digit unsigned numbers A - B in base r
ment: Given a number N in base r having m digits, then can be done as follows by r’s complement method.
(r -1)’s complement is (r m - 1) - N. Add A to the r’s complement of B. Mathematically
For example, decimal number system will have 10’s A + (r n - B) = A - B + r n
complement and 9’s complement. If A ≥ B the sum will produce an end carry r n; which can
Similarly, binary number system will have 2’s com- be discarded. (Discarding carry is equivalent to subtracting
plement and 1’s complement. r n from result). What is left is the result A – B?
Chapter 1 • Number Systems | 1.7
Codes
Numeric Alphanumeric
Gray Gray
8421 2421 3321 4221 5221 5311 5421 631-1 7421 74-2-1 84-2-1
Exercises
Practice Problems 1 2. If (84)x (in base x number system) is equal to (64)y (in
base y number system), then possible values of x and y
Directions for questions 1 to 15: Select the correct alterna-
are
tive from the given choices.
(A) 12, 9 (B) 6, 8
1. Assuming all the numbers are in 2’s complement rep- (C) 9, 12 (D) 12, 18
resentation, which of the following is divisible by
11110110? 3. Let A = 1111 1011 and B = 0000 1011 be two 8-bit
(A) 11101010 (B) 11100010 signed 2’s complement numbers. Their product in 2’s
(C) 11111010 (D) 11100111 complement representation is
Chapter 1 • Number Systems | 1.11
(A) 11001001 (B) 10011100 code. For example, the base -6 number 35 will be rep-
(C) 11010101 (D) 10101101 resented by its BCH code 011101.
In this numbering system, the BCH code
4. Let r denotes number system’s radix. The only value(s)
001001101011 corresponds to the following number
of r that satisfy the equation 3 (1331) r = (11) r is/are in base -6 system.
(A) 10 (B) 11 (A) 4651 (B) 4562
(C) 10 and 11 (D) any r > 3 (C) 1153 (D) 1353
5. X is 16-bit signed number. The 2’s complement repre- 11. The signed 2’s complement representation of (-589)10
sentation of X is (F76A)16. The 2’s complement repre- in Hexadecimal number system is
sentation of 8 × X is (A) (F24D)16 (B) (FDB3)16
(A) (1460)16 (B) (D643)16 (C) (F42D)16 (D) (F3BD)16
(C) (4460)16 (D) (BB50)16
12. The base of the number system for which the following
6. The HEX number (CD.EF)16 in octal number system is 66
(A) (315.736)8 (B) (513.637)8 operation is to be correct = 13
5
(C) (135.673)8 (D) (531.367)8 (A) 6 (B) 7
7. 8-bit 2’s complement representation a decimal number (C) 8 (D) 9
is 10000000. The number in decimal is 13. The solution to the quadratic equation x2 - 11x + 13 = 0
(A) +256 (B) 0 (in number system with radix r) are x = 2 and x = 4.
(C) -128 (D) -256 Then base of the number system is (r) =
8. The range of signed decimal numbers that can be rep- (A) 7 (B) 6
resented by 7-bit 1’s complement representation is (C) 5 (D) 4
(A) -64 to + 63 (B) -63 to + 63 14. The 16’s complement of BADA is
(C) -127 to + 128 (D) -128 to +127 (A) 4525 (B) 4526
9. Decimal 54 in hexadecimal and BCD number system is (C) ADAB (D) 2141
respectively 15. (11A1B)8 = (12CD)16, in the above expression A and B
(A) 63, 10000111 (B) 36,01010100 represent positive digits in octal number system and C
(C) 66, 01010100 (D) 36, 00110110 and D have their original meaning in Hexadecimal, the
10. A new binary-coded hextary (BCH) number system values of A and B are?
is proposed in which every digit of a base -6 number (A) 2, 5 (B) 2, 3
system is represented by its corresponding 3-bit binary (C) 3, 2 (D) 3, 5
11. If x is radix of number system, (211)x = (152)8, then x is 17. Match the items correctly
(A) 6 (B) 7 Column 1 Column 2
(C) 9 (D) 5 (P) 8421 (1) Cyclic code
12. The value of r for which ( 224) r = (13) r is valid (Q) 2421 (2) self-complementing
expression, in number system with radix r is? (R) 5212 (3) sequential code
(A) 5 (B) 6 (S) Gray code (4) non-sequential code
(C) 7 (D) 8
(A) P–2, Q–4, R–3, S–1
13. Which of the representation in binary arithmetic has a (B) P–1, Q–4, R–3, S–2
unique zero? (C) P–3, Q–2, R–4, S–1
(A) sign-magnitude (B) 1’s compliment (D) P–2, Q–4, R–1, S–2
(C) 2’s complement (D) All of these
18. Perform the subtraction in XS-3 code 57.6 - 27.8
14. For the binary number 101101111 the equivalent hexa-
(A) 0101 1100.1011 (B) 0010 1001.1100
decimal number is
(C) 00011101.1100 (D) 1010 1110.1011
(A) 14E (B) 9E
(C) B78 (D) 16F 19. The 2’s complement representation of -17 is
15. Subtract 1001 from 1110 (A) 101110 (B) 111110
(A) 0010 (B) 0101 (C) 101111 (D) 110001
(C) 1011 (D) 1010
20. The decimal 398 is represented in 2421 code by
16. Which of the following is a positively weighted code? (A) 110000001000 (B) 001110011000
(A) 8421 (B) 84-2-1 (C) 001111111110 (D) 010110110010
(C) EXS-3 (D) 74-2-1
Answer Keys
Exercises
Practice Problems 1
1. B 2. C 3. A 4. D 5. D 6. A 7. C 8. B 9. B 10. C
11. B 12. D 13. C 14. B 15. D
Practice Problems 2
1. C 2. B 3. A 4. D 5. D 6. B 7. A 8. B 9. B 10. B
11. B 12. A 13. C 14. D 15. B 16. A 17. C 18. A 19. C 20. C
LEARNING OBJECTIVES
Symbol
Y=A 3. OR gate (logical adder 7432 IC): The OR gate performs
logical, addition commonly known as OR function.
Table 1 Truth Table
A
Input Output Y
B
A Y Symbol
0 1 Y=A+B
1 0 Figure 2 2 input OR gate
2. AND gate (logical multiplier 7408 IC): The AND gate per-
forms logical multiplication more commonly know as AND Table 3 Truth Table
function. The AND gate is composed of 2 or more inputs and Input Output
a single output A B Y
2 i/p AND Gate 0 0 0
A A·B 0 1 1
B
1 0 1
Y = A·B
1 1 1
Figure 1 2 input AND gate
Chapter 2 • Boolean Algebra and Minimization of Functions | 1.15
4. NAND gate (7400 IC): The NAND gate’s function is if both inputs are unequal, then the output will be low.
basically AND + NOT function. Other name for X-NOR gate is equivalent gate.
A Y A
Y
B B
Y = A·B Symbol
Y = A B = AB + A B
Figure 3 2 input NAND gate
Figure 6 2 input X-NOR Gate
Table 4 Truth Table
Input Output Table 7 Truth Table
A B A B Y
A⋅B A + B (Y)
0 0 1
0 0 0 1
0 1 0
0 1 0 1 1 0 0
1 0 0 1 1 1 1
1 1 1 0
X-NOR Gate is complement of X-OR Gate.
5. NOR gate (7402 IC): The NOR gate is basically OR
+ NOT function. Boolean Algebra
A Boolean algebra is a system of mathematical logic. It
Y
B is an algebraic system consisting of the set of elements
Y=A+B (0, 1), two binary operators OR and AND and one
Figure 4 2 input NOR gate unary operator NOT. The Boolean algebra is governed
by certain well-developed rules and laws.
Table 5 Truth Table
Input Output AXIOMS and Laws of Boolean Algebra
A B A+B A + B (Y) 1. AXIOMS
0 0 0 1
(a) AND operation
(1) 0 ⋅ 0 = 0
0 1 1 0
(2) 0 ⋅ 1 = 0
1 0 1 0 (3) 1 ⋅ 0 = 0
1 1 1 0 (4) 1 ⋅ 1 = 1
(b) OR operation
6. Exclusive OR gate X-OR (7486 IC): X-OR is a gate
(5) 0 + 0 = 0
in which unequal inputs create a high logic level out-
(6) 0 + 1 = 1
put and if both inputs are equal, the output will be low.
(7) 1 + 0 = 1
Other name for EX-OR gate is unequivalent gate.
(8) 1 + 1 = 1
2 input X-OR Gate
(c) NOT operation
A (9) 1 = 0
Y
B
Symbol
(10) 0 = 1
Y = A ⊕ B = AB AB 2. Laws
Figure 5 2 input X-OR Gate (a) Complementation law
(1) 0 = 1
Table 6 Truth Table (2) 1= 0
A B Y (3) If A = 0, then A = 1
0 0 0 (4) If A = 1, then A = 0
0 1 1 (5)
A= A
1 0 1
(b) AND laws
1 1 0 (1) A ⋅ 0 = 0 (NULL Law)
(4) A ⋅ 1 = A (Identity Law)
7. Exclusive NOR gate (X-NOR): X-NOR is a gate in (3) A ⋅ A = A
which equal inputs create a high logic level output; and (4) A ⋅ A = 0
1.16 | Unit 1 • Digital Logic
(c) OR laws = 0 + AC + AB + BC
(1) A + 0 = A (NULL Law)
(2) A + 1 = 1 (Identity Law) = AC + AB + BC ( A + A)
(3) A + A = A = AB + ABC + AC + ABC
(4) A + A = 1 = AB + AC
(d) Commutative laws = LHS
(1) A + B = B + A
(2) A ⋅ B = B ⋅ A (c) De Morgan’s theorem
(e) Associative laws Law 1: A + B = A ⋅ B
(1) (A + B) + C = A + (B + C)
This law states that the complement of a sum of
(2) (A ⋅ B)C = A( B ⋅ C)
variable is equal to the product of their individual
(f) Distributive laws
complements.
(1) A(B + C) = AB + AC
(2) A + BC = (A + B) (A + C) Law 2: AB = A + B
(g) Redundant literal rule (RLR) This law states that the complement of the product
(1) A + AB = A + B of variables is equal to the sum of their individual
(2) A( A + B ) = AB complements.
(h) Idempotence laws Example 1: Simplify the Boolean function Y = A( A + B )
(1) A ⋅ A = A
(2) A + A = A Y = A ⋅ A + A⋅ B
(i) Absorption laws Solution: Y = A + AB
(1) A + A ⋅ B = A = A(1 + B )
(2) A (A + B) = A =A
3. Theorems Example 2: Simplify the Boolean function Y = A + AB
(a) Consensus theorem
Theorem 1: Solution: Y = A ⋅ ( B + 1) + A ⋅ B
AB + AC + BC = AB + AC = A ⋅ B + A + AB
Proof:
= B ( A + A) + A
LHS = AB + AC + BC
= AB + AC + BC ( A + A) = A+ B
Example 3: Simplify the Boolean function
= AB + AC + BCA + BCA
= AB(1 + C ) + AC (1 + B ) Y = A( A + B) + B( A + B)
= AB(1) + AC (1) Solution: Y = A ⋅ A + A ⋅ B + B ⋅ A + B ⋅ B
= AB + AC = A + B ( A + A) + B
= RHS. = A + B ⋅1 + B
Theorem 2:
( A + B) ( A + C ) ( B + C ) = ( A + B) ( A + C ) = A+ B + B
Proof: = A+ B
LHS = ( A + B) ( A + C ) ( B + C ) Example 4: Simplify the Boolean function
= ( AA + AC + BA + BC ) ( B + C ) Y = ABC + ABC + ABC + ABC
= ( AC + BC + AB ) ( B + C ) Solution: Y = AC ( B + B) + AC ( B + B )
= ABC + BC + AB + AC + BC + ABC = AC + AC
= AC + BC + AB = C ( A + A)
RHS = ( A + B) ( A + C ) =C
= AA + AC + BC + AB Example 5: Simplify the Boolean function
Y = ABC + ABC + ABC
= AC + BC + AB
= LHS. Solution: = AC ( B + B ) + ABC
(b) Transposition theorem = AC + ABC
AB + AC = ( A + C ) ( A + B)
= A(C + BC )
Proof:
RHS = ( A + C ) ( A + B) = A(C + B)
= AA + CA + AB + CB = A+C B
Chapter 2 • Boolean Algebra and Minimization of Functions | 1.17
Example 6: Simplify the Boolean function So the expression inside the parentheses must be evalu-
Y = AB + C B + CA + ABD ated before all the operations. The next operation to be
performed is the complement and then follows AND and
Solution: Y = AB(1 + D ) + C B + CA finally the OR.
= AB + CB + CA Complement of function The complement of a function F
= AB + CB is F′ is obtained from an interchange of 0s for 1s and 1s for
0s in the value of F. The complements of a function may be
derived algebraically through De Morgan’s theorems.
Properties of Boolean Algebra (x1 . x2 . x3… xn)′ = x1′ + x′2 + x3′ + … + xn′
n
With n variables, maximum possible distinct functions = 22 . (x1 + x2 + x3+ … +xn)′ = x′1 . x2′ . x′3 . x′4 … x′n
Duality consider the distributive law
Example 10: The complement of function F = a(b′c + bc′)
1. x (y + z) = xy + xz is?
2. x + yz = (x + y) (x + z)
Solution: (F)′ = [a(b′c + bc′)]′
Second one can be obtained from the first law if the binary = a′ + (b′c + bc′)′
operators and the identity elements are interchanged. This = a′ + (b′c)′ ⋅ (bc′)′
important property of Boolean algebra is called the duality = a′ + (b + c)′ (b′ + c)
principle. F′ = a′ + bc + b′c′
The dual of an algebraic expression can be written by
interchanging OR and AND operators, 1s by 0, and 0s x x
xy x·y
by 1s. y y
x x
x·y = x + y x+y
Example 7: x + x ′ = 1 ←
Dual
→ x ⋅ x′ = 0 y y
x x
Solution: xy + xy ′ = x ←
Dual
→ ( x + y ) ( x + y ′) = x x+y x+y
y y
x x
x + y = xy xy
x + x ′y = x + y ←
Dual
→ x( x ′ + y ) = xy y y
x x
Example 8: The dual of F = xy + xz + yz is? y
x + y = xy
y
xy
x x
Solution: Dual of F = (x + y) (x +z) (y + z) x+y=x+y x+y
y y
= (x + xz + xy + yz) (y + z) = xy + yz + xz
So dual of xy + xz + yz is same as the function itself; Figure 7 Gates with inverted inputs
For N variables maximum possible self-dual functions
n−1 n
= 2 2 = 2( 2 / 2 )
Boolean Functions, Min Terms
Example 9: Which of the following statement/s is/are true
S1: The dual of NAND function is NOR and Max Terms
S2: The dual of X-OR function is X-NOR The starting point for designing most logic circuits is the truth
(A) S1 and S2 are true table, which can be derived from the statement of problem.
(B) S1 is true The truth table is then converted into a Boolean expression
(C) S2 is true and finally create the assembly of logic gates accordingly.
(D) None of these Let us consider the example of majority circuit. This cir-
cuit takes three inputs (A, B, C) and have one output (Y)
Solution: (A)
which will give the majority of the inputs, i.e., if A, B, C are
NAND = (xy)′ = x′ + y′ having more number of zeros. Y = 0 else if A, B, C are hav-
Dual of NAND = (x + y)′ = x′ y′ ing more number of 1s, Y = 1.
X-OR = xy′ + x′y So from the statements we can derive the truth table as
Dual of X-OR = (x + y′) (x′ + y) = xy + x′y′ = X-NOR follows:
Both S1 and S2 are true
A
Operator precedence The operator precedence for evaluat- Majority
B Y
circuit
ing Boolean expression is C
1. Parentheses
2. NOT As we are using three Boolean variables A, B, C,
3. AND total number of combinations in truth table are
4. OR 23 = 8.
1.18 | Unit 1 • Digital Logic
Similarly for n variables, the truth table will have total of Min Term and Max Term
2n combinations, for a Boolean function. All the Boolean expressions can be expressed in a standard
Input Output sum of product (SOP) form or in a standard product of sum
(POS) form.
Sl. no. A B C Y
1 0 0 0 0 → Y = 0, If inputs •• A standard SOP form is one in which a number of prod-
2 0 0 1 0 are having more uct terms, each contains all the variables of the func-
3 0 1 0 0
zeros. tion either in complement or non-complement form are
summed together.
4 0 1 1 1 → Y = 1, If inputs
•• A standard POS form is one in which a number of sum
5 1 0 0 0 are having
more 1’s terms, each one of which contain all the variable of he
6 1 0 1 1 function either in complemented or non-complemented
7 1 1 0 1 form are multiplied together.
8 1 1 1 1 •• Each of the product term in standard SOP form is called
a min term.
For some combinations, output Y = 1, and for others Y = 0. •• Each of the sum term in the standard POS form is called
The input combinations for which output Y = 1 are called a max term.
as min terms.
Similarly the input combinations for which output Y = 0
are called as max terms. Conversion from min terms to
Min terms are expressed as product terms, Similarly, max terms representation
max terms are expressed as sum terms.
The output Y = 1, only in rows 4, 6, 7, 8. Y = ABC + ABC + ABC + ABC
So the min terms combinations are 011, 101, 110, 111 in Y ′ = ( ABC + ABC + ABC + ABC )′
Boolean Algebra, 1 input will be written as A, B, C and 0 input
= ( ABC )′( ABC )′( ABC )′( ABC )′
will be written as A, B , C in complement form, we express
(Y ′)′ = [( A + B + C )( A + B + C )( A + B + C )( A + B + C )]′
these min terms as product terms, ABC , ABC , ABC , ABC .
= [p(3, 5, 6, 7)]1 = p(0, 1, 2 ,4)
To express Y as Boolean expression, we can write it as
sum of the min terms. Y = ( A + B + C )( A + B + C )( A + B + C )( A + B + C )
Y = AB C + AB C + ABC + ABC or Y = S(3, 5, 6, 7) = p(0, 1, 2, 4)
We know that AND operation is a product while OR is sum.
So the above equation is a sum of the products (SOP), (or) Conversion from normal SOP/POS form
min terms expression.
to canonical SOP/POS
The other way of expressing Y is Y = Sm (3, 5, 6, 7).
Y = m3 + m5 + m6 + m7. Let us consider f ( A, B, C ) = A + BC + AC
The min term numbers are the decimal equivalent of input The above function is in normal (minimized) SOP
binary combinations. from, to convert this function to standard SOP(or) canoni-
Similar to SOP we can have product of sums (POS) cal SOP form, include missing variable in each and every
Boolean expression. term, to make it complete. First term A, Missing literals
The output Y = 0 for the input combinations 000, 001, are B, C. Consider A X X, so possible combinations are
010, 100. For max terms 1 input will be indicated as A, B , C ABC , ABC , ABC , ABC or we can write
in complement form, 0 input will be indicated as A, B, C
and max terms are expressed as sum terms. A = A = A( B + B)(C + C ) = ABC + ABC + ABC + ABC
Second term BC-missing literal is A. Consider XBC ⇒ So
A + B + C, A + B + C , A + B + C , A + B + C
possible combinations are ABC, ABC or we can write
Any function can be expressed as product of max terms.
BC = ( A + A) BC
So Y = ( A + B + C ) ( A + B + C ) ( A + B + C ) ( A + B + C )
= ABC + ABC
The above equation is a product of sum expression (POS) or
max terms expression. Third term AC = missing literal is B. Consider AXC → so
In other way Y = pM (0, 1, 2, 4) possible combinations are ABC , A, BC or we can write
= M0 ⋅ M1 ⋅ M2 ⋅ M4
AC = A( B + B )C
The max term numbers are decimal equivalents of cor-
responding input binary combinations. = ABC + ABC
Chapter 2 • Boolean Algebra and Minimization of Functions | 1.19
Here the C variables is absent from first term and B from Four-variable K-maps
second term. So add C ⋅ C = (0) to first, and B ⋅ B to second, The K-map for four variables is shown here, 16 min terms
and using distributive law arrive at the result. are assigned to 16 squares.
yz
f ( A, B, C ) = ( A + B + C ) ( A + B + C ) ( A + B + C )( A + B + C ) 00 01 11 10
wx
00 0 1 3 2
F = AC + AC F = AC D + A BD + AB C + AC D F=D
Other variable A, B, C are vanished.
So Pair eliminates one variable by minimization.
Eliminating Redundant Groups
Quad
Quad is a group of four 1s those are horizontally or verti- BC BC
A 00 01 11 10 A 00 01 11 10
cally adjacent.
0 1 1 0 1 1
BC BC
00 01 11 10 00 01 11 10 1 1 1 1 1 1
A A
0 1 1 0 1 1
AB + AC + BC AB + AC
1 1 1 1 1 1
F = C F = AC + AC = ( A + A)C = C Here BC is redundant pair, which covers already covered
min terms of AB, AC .
By considering two pairs also it will be simplified to C.
Quad eliminates two variables from the function RS
CD PQ 00 01 11 10
AB 00 01 11 10 00 1
00 1 1 1 1 1
01
01 1 1 11 1 1 1
11 1 1
10 1
10 1 1
This K-map gives fourpairs and one quad.
F = BD + BD
RS
Corner min terms can from a Quad PQ 00 01 11 10
RS 00 1
PQ 00 01 11 10 01 1 1 1
00 1 1 11 1 1 1
01 10 1
11
10 1 1 But only four pairs are enough to cover all the min times,
Quad is not necessary.
Prime Implicant A B C
CD
00 01 11 10
Implementation of Function
AB
00 1 1 1 by Using Nand–Nor Gates
01 1 × NAND or NOR gates are called as universal gates, because
11 1 × × any function can be implemented by using only NAND
10 × ×
gates or only using NOR gates.
A AB
AB AND gate
B
A A + A = A NOT gate
A
A A + B = AB AND gate
B
B
A A+B
A + B OR gate
B
A·A+B
A A−B (A + A + B )(B + A + B ) = AB + A B = A B
B EX–OR, EX-NOR gate
AB + AB ) = A ⊕ B
(B · A + B)
Solution: A Now the circuit consists of all NOR gates. Three NOR
B Gates are required.
B f (A, B, C)
C Example 19: How many number of two-input NAND–
A NOR gates are required to implement three-input NAND–
C NOR gates respectively?
By considering bubbles at output of AND gate and input of (A) 2, 2 (B) 2, 3
OR gate. (C) 3, 2 (D) 3, 3
A
B Solution: f ( A, B, C ) = ABC = AB + C
B f (A, B, C) (1) Implement above function by using two-inputs gates
C
A
A
C B
f (A, B, C ) A
B
A
C A B = AB + A B = AB + AB = A ⊕ B
1.24 | Unit 1 • Digital Logic
From the above discussions we can conclude that inverted (A) 1, 1, 1 (B) 1, 0, 1
input EXOR gate is EX-NOR gate. (C) 0, 1, 1 (D) 0, 0, 1
Similarly, inverted input EX-NOR gate is EX-OR gate. If Solution: (D)
both inputs are inverted the EX-OR / EX-NOR will remain To get output X = 0, all inputs to the NAND gate should be
as it is. 1, so C = 1.
Consider a three-inputs X-OR gates by using two-input When C = 1, the output of X-OR gate B⊕C = 1 only when
XOR gates. B = 0.
If B = 0 the output of X-NOR gate A ⊙ B = 1.
A Only when A = 0
A⊕B⊕C
B So X = 1, only when (A, B, C) = (0, 0, 1).
C Example 21: The minimized expression of
A
A ·B ·C ( A + B) ( AB + AC ) ( AC + B) is
B
Solution: ( A + B) ( AB + AC ) ( AC + B)
C
= ( A + B ) ( AB ⋅ AC + AB ⋅ B + AC ⋅ AC + AC ⋅ B)
A
B
A⊕B · C = ( A + B) ( AB + ABC ) = ( A + B) AB(1 + C )
= AB + AB = AB
C
Example 22: The Boolean function f is independent of
A
A ⊕B ⊕C (A) a (B) b
B
(C) c (D) None of these
C Solution: (A)
So we can conclude that A ⊕ B ⊕ C = A ⊙ B ⊙ C A
B F
A⊕ B ⊕C = A B C
A C
B
F = ab ⋅ bc
C
= ab + bc = ab + b + c
A
A⊕B · C
B = b + c is independent of ‘a’.
Example 23:
C
A
A
A B
A · B⊕C
B
C B
C
A⊕ B ⊕C = A B C = A⊕ B C f=?
A
=A⊙B⊕C
C
A⊕B⊕C⊕D=A⊕B⊙C⊙D=A⊙B⊙C⊕D=A
⊙B⊕C⊙D
A B C D = A⊕ B ⊕C ⊕ D A
A⊙B⊙C⊙D=A⊕B⊕C⊙D=A⊕B⊙C⊕D B
Chapter 2 • Boolean Algebra and Minimization of Functions | 1.25
Y = ( A ⋅ B ⋅ AB ) = ( A + B ) ( A + B) ∵ ( A ⋅ B = A + B )
Solution: f = {A ⊕ B ⊕ B ⊕ C } ⊕ {A ⊕ C ⊕ B ⊕ A}
={A ⊕ 0 ⊕ C} ⊕ {0 ⊕ C ⊕ B} = ( A + B) + ( A + B) = A ⋅ B + A ⋅ B
=A ⊕ C ⊕ C ⊕ B = A ⊕ 0 ⊕ B = A ⊕ B = A⋅ B + A⋅ B = A ⊕ B
3 y 10 1 0 1 1
A
2 X OR gate = A+ BC
B
Example 6: In the figure shown, y2, y1, y0 will be 1s
A B = AB + AB complement of x2 x1 x0 if z = ?
A
z=?
B
A Solution: We are using X-OR gate
∴ XOR out-put is complement of input only when other
B input is high.
∴Z=1
Solution:
Example 7: The output y of the circuit shown is the figure is
A
A A·B A
(A + B )
y=A⊕B B
B
A C y
B A · B (A + B ) D
B E
1.26 | Unit 1 • Digital Logic
C y
Solution: A( AB) ⋅ B( A⋅ B )
D DE
E DE
[ A + ( AB)]⋅[ B + ( AB)] = A + ( AB) + ( B + AB)
y = ( A + B) ⋅ C ⋅ DE = ( A + B) ⋅ C + DE
= A⋅( AB ) + B⋅( AB ) = A ⋅ ( A + B ) + B( A + B)
= ( A + B )C + DE ( x ⋅ y = x + y ) = A⋅ A + A B + B A + B⋅ B = A + B = AB
Exercises
Practice Problems 1 are high. The minimized Boolean expression for the
Directions for questions 1 to 25: Select the correct alternative out put is
from the given choices. (A) AB + BC + AC
1. The output of the following circuit is (B) ABC + ABC + ABC + ABC
A (C) ABC + ABC + ABC
(D) AB + BC + AC
6. Consider the following logic circuit whose inputs are
(A) 0 (B) 1 functions f1, f2, f3 and output is f.
(C) A (D) A′ f1(x, y, z)
2. The circuit which will work as OR gate in positive level
will work as ___ gate in negative level logic f 2(x, y, z) f (x, y, z)
(A) NOR gate
(B) NAND gate f 3(x, y, z)
(C) Both NAND and NOR gate Given that f1(x, y, z) = ∑(0, 1, 3, 5) f2 (x, y, z) = ∑(6, 7)
(D) AND gate and f(x, y, z) = ∑(1, 4, 5), then f3 is
3. Four logical expressions are given below: (A) ∑(1, 4, 5) (B) ∑(6, 7)
(a) A ⋅ B ⋅C ⋅ D E ⋅ F ⋅ G ⋅ H (C) ∑(0, 1, 3, 5) (D) None of these
(b) AB ⋅CD ⋅ EF ⋅GH 7. The circuit shown above is to be used to implement
the function z = f ( A, B) = A + B what values are to be
(c) A + B + C + D + E + F + G + H selected for I and J?
(d) ( A + B) (C + D ) ( E + F ) (G + H ) I J
Two of these expression are equal. They are
(A) c and d (B) b and d
A
(C) a and b (D) a and c Z
4. For the logic circuit shown in figure, the simplified
Boolean expression for the out put y is
A (A) I = 0, J = B (B) I = 1, J = B
B (C) I = B, J = 1 (D) I = B, J = 0
8. Parity checker output from the below figure, if input is
11111 (D4 D3 D2 D1 D0) and 10000 (D4 D3 D2 D1 D0).
y
{1 = error, 0 = no error}
D4
C E
D3
(A) A+B+C (B) A D2
(C) ABC (D) BC
D1
5. In a digital system, there are three inputs A, B and C.
The output should be high when at least two inputs D0
Chapter 2 • Boolean Algebra and Minimization of Functions | 1.27
18. Find the function represented by the figure (A) ABC + DBC, 4 (B) ABC + DAC , 3
4
1 A (C) DAC + DBC , 1 (D) ABC + DBC , 2
A
21. The function f = A ⊕ B ⊕ C ⊕ D is represented as
B
5 (A) f (A, B, C, D) = ∑(2, 6, 10, 11, 12, 13, 14)
2 B
B Output (B) f (A, B, C, D) = ∑(3, 5, 7, 10, 11, 12, 13, 14)
(C) f (A, B, C, D) = ∑(1, 2, 6, 8, 10, 12, 13, 14)
C
6 (D) f (A, B, C, D) = ∑(1, 2, 4, 7, 8, 11, 13, 14)
3 C
A 22. Find the function represented
B x0
…… f
x1
(A) A + B + C (B) AB x2 x3 xn − 2 xn − 1 xn
(C) AB + C (D) B + C
(A) (x0 + x1) (x2 + x3) (x4 + x5) … (xn-1 + xn)
19. A staircase light is controlled by two switches, one is (B) x0 + x1 + x2 + x3 + … + xn
at the top of the stairs and other at the bottom of stairs. (C) x0x2x4 … xn + x1x2 … xn + xn-1 xn
Realization of this function using NAND logic results (D) x0x1 + x2x3 + … + xn-1 xn
in which of the following circuits? (Assume S1 and S2 23. The minimum number of NAND gates required to
are the switches) implement A ⊕ B ⊕ C is
(A) (A) 8 (B) 10
S1 (C) 9 (D) 6
f
24. Which of the following circuit will generate an odd
S2 parity for a 4-bit input? (Assume ABCD as input)
(A) A
B
Output
(B) S1
C
S2
f D
(B) A
S1 B Output
S2
C
(C)
D
S1
f (C) A
B Output
C
S2
(D) D
S1
(D) A
S2
B Output
f
C
S1
D
S2
25. For the output F to be 1 in the circuit, the input combi-
20. For the given figure simplify the expression and find nation should be
which is the redundant gate?
A A
B 1 B
C
4 X
D
A 2 F
C
C
D
B 3 (A) A = 1, B = 1, C = 0 (B) A = 1, B = 0, C = 0
C (C) A = 0, B = 1, C = 0 (D) A = 0, B = 0, C = 1
Chapter 2 • Boolean Algebra and Minimization of Functions | 1.29
C Output
(B) A
D
b Y
(A) (A + C) (B + D) (B) AC + BD B
(C) (A + D) (B + C) (D) ( A + B ) (C + D ) (C) A
17. Minimized expression for Karnaugh map is
AB Y
C 00 01 11 10 B
0 1 1
(D) A
1 1 1
(A) AB + C (B) AB + C Y
B
(C) B (D) B + C
18. An XOR gate will act as ________ when one of its input
23. The equivalent of AND–OR logic circuit is
is one and as ________ when one of its input is zero.
(A) NAND–NOR (B) NOR–AND
(A) buffer, buffer (B) buffer, inverter
(C) NAND–NAND (D) NAND–OR
(C) inverter, buffer (D) inverter, inverter
24. The X-OR is equivalent to
19. The minimum number of two input NAND gates
required to implement A ⊙ B if only A and B are (A) (B)
available
(A) 6 (B) 3
(C) 5 (D) 4 (C) (D)
20. Negative logic in a logic circuit is one in which
(A) logic 0 and 1 are represented by GND and positive
25. Simplify ABC + B + BD + ABD + AC
voltage respectively.
(B) logic 0 and 1 are represented by negative and posi- (A) B (B) B + C
tive voltage. (C) C + A (D) A + B
Chapter 2 • Boolean Algebra and Minimization of Functions | 1.31
3. In the Karnaugh map shown below, × denotes a don’t- Which one of the following is equivalent to PÚQ?
care term. What is the minimal form of the function (A) ¬Qÿ¬P (B) Pÿ¬Q
represented by the Karnaugh map? [2008] (C) ¬PÿQ (D) ¬Pÿ¬Q
ab 8. The min term expansion of f(P, Q, Q) = PQ +
cd 00 01 11 10 QR + PR is [2010]
00 1 1 1
(A) m2 + m4 + m6 + m7
01 × 1
(B) m0 + m1 + m3 + m5
11 ×
(C) m0 + m1 + m 6+ m7
10 1 1 ×
(D) m2 + m3 + m4 + m5
(A) b ⋅ d + a ⋅ d 9. What is the Boolean expression for the output f of
(B) a ⋅ b + b ⋅ d + a ⋅ b ⋅ d the combinational logic circuit of NOR gates given
below? [2010]
(C) b ⋅ d + a ⋅ b ⋅ d
P
(D) a ⋅ b + b ⋅ d + a ⋅ d Q
4. Given f1, f3 and f in canonical sum of products form
(in decimal) for the circuit [2008]
Q
f1 R
f2 f
f
P
f3 R
f1 = Sm(4, 5, 6, 7, 8)
f3 = Sm(1, 6, 15) Q
R
f = Sm(1, 6, 8, 15)
then f2 is
(A) Q + R (B) P + Q
(A) Sm(4, 6) (B) Sm(4, 8)
(C) Sm(6, 8) (D) Sm(4, 6, 8) (C) P + R (D) P + Q + R
1.32 | Unit 1 • Digital Logic
10. The simplified SOP (Sum of Product) form of the 16. The dual of a Boolean function f(x1, x2, … xn, +, .,‘),
Boolean expression. [2011] written as FD, is the same expression as that of F with
(P + Q + R) ( P + Q + R) ( P + Q + R) is + and . swapped. F is said to be self-dual if F = FD.
The number of self-dual functions with n Boolean
(A) ( PQ + R) (B) ( P + Q R) variables is [2014]
(A) 2n (B) 2n-1
(C) ( PQ + R) (D) (PQ + R) n n−1
(C) 22 (D) 22
11. Which one of the following circuits is NOT equiva- 17. Consider the following min term expression for F:
lent to a two-input X-NOR (exclusive NOR) gate?
[2011] F(P, Q, R, S) = Sm(0, 2, 5, 7, 8, 10, 13, 15)
(A) The min terms 2, 7, 8 and 13 are ‘don’t-care terms.
The minimal sum of products form for F is [2014]
(B) (A) QS + QS
(B) Q S + QS
(C) (C) Q R S + Q R S + Q R S + QRS
(D) P Q S + P QS + PQS + PQ S
18. The binary operator ≠ is defined by the following
(D) truth table
p q p≠q
0 0 0
12. The truth table [2012] 0 1 1
X Y F(X, Y) 1 0 1
1 1 0
0 0 0
0 1 0
Which one of the following is true about the binary
1 0 1 operator ≠? [2015]
1 1 1 (A) Both commutative and associative
(B) Commutative but not associative
represents the Boolean function
(C) Not commutative but associative
(A) X (B) X + Y
(D) Neither commutative nor associative
(C) X ⊕ Y (D) Y
13. What is the minimal form of the Karnaugh map shown 19. Consider the operations [2015]
below? Assume that × denotes a don’t-care term.[2012] f(X, Y, Z) = X 1 YZ + XY 1 + Y 1Z 1 and
ab g(X, Y, Z) = X 1 YZ + X 1 YZ 1 + XY.
cd 00 01 11 10
Which one of the following is correct?
00 1 × × 1
(A) Both {f } and {g} are functionally complete
01 × 1
(B) Only {f } is functionally complete
11 (C) Only {g} is functionally complete
10 1 × (D) Neither {f } nor {g} is functionally complete
20. The number of min-terms after minimizing the fol-
(A) bd (B) bd + bc
lowing Boolean expression is _______ [2015]
(C) bd + abcd (D) bd + bc + cd [D1 + AB1 + A1C + AC 1 D + A1C 1D]1
14. Which one of the following expressions does not rep- 21. Let # be a binary operator defined as [2015]
resent exclusive NOR of x and y? [2013] X # Y = X + Y where X and Y are Boolean variables.
1 1
(C) Both S1 and S2 are true Assume for all inputs (a, b, c, d), the respective com-
(D) Neither S1 nor S2 are true plements (a , b, c , d ) are also available. The above
22. Given the function F = P 1 + QR, where F is a function logic is implemented using 2-input NOR gates only.
in three Boolean variables P, Q and R and P 1 = !P, The minimum number of gates required is ________.
consider the following statements. [2015] [2017]
(S1) F = Σ(4, 5, 6) 26. If w, x, y, z are Boolean variables, then which one of
the following is INCORRECT? [2017]
(S2) F = Σ(0, 1, 2, 3, 7)
(A) wx + w(x + y) + x(x + y) = x + wy
(S3) F = p(4, 5, 6)
(B) w x ( y + z ) + w x = w + x + yz
(S4) F = p(0, 1, 2, 3, 7)
Which of the following is true?
(C) (w x ( y + x z ) + w x ) y = x y
(A) (S1) – False, (S2) – True, (S3) – True, (S4) - False (D) (w + y) (wxy + wyz) = wxy + wyz
(B) (S1) – True, (S2) – False, (S3) – False, (S4) - True 27. Given f(w, x, y, z) = ∑m(0,l,2,3,7,8,10) + ∑d(5,6,ll,15),
(C) (S1) – False, (S2) – False, (S3) – True, (S4) - True where d represents the don’t-care condition in
(D) (S1) – True, (S2) – True, (S3) – False, (S4) - False Karnaugh maps. Which of the following is a mini-
mum product-of-sums (POS) form of f(w, x, y, z)?
23. The total number of prime implicants of the function [2017]
f(w, x, y, z) = Σ(0, 2, 4, 5, 6, 10) is ______ [2015]
(A) f = ( w + z )( x + z )
24. Consider the Boolean operator # with the following (B) f = ( w + z )( x + z )
properties: [2016]
x # 0 = x, x # 1 = × , x # x = 0 and (C) f = ( w + z )( x + z )
x # × = 1. Then x # y is equivalent to (D) f = ( w + z )( x + z )
(A) x y + × y (B) x y + × y 28. Let ⊕ and ⊙ denote the Exclusive OR and Exclusive
(C) × y + x y (D) x y + × y NOR operations, respectively. Which one of the fol-
25. Consider the Karnaugh map given below, where X lowing is NOT CORRECT? [2018]
represents “don’t care” and blank represents 0. (A) P ⊕ Q = P Q
(B) P ⊕ Q = P Q
ba
00 01 11 10 (C) P ⊕ Q = P ⊕ Q
dc
(D) ( P ⊕ P ) ⊕ Q = ( P P ) Q
00
X X
29. Consider the minterm list form of a Boolean function
01 1 X
F given below.
F(P, Q, R, S) = ∑ m(0, 2, 5, 7, 9, 11)
11 1 1 + d (3, 8, 10, 12, 14)
Here, m denotes a minterm and d denotes a don’t care
X X
10 term. The number of essential prime implicants of the
function F is ______. [2018]
1.34 | Unit 1 • Digital Logic
Answer Keys
Exercises
Practice Problems 1
1. B 2. D 3. B 4. C 5. A 6. A 7. B 8. A 9. B 10. A
11. C 12. D 13. A 14. A 15. A 16. A 17. D 18. B 19. A 20. D
21. D 22. C 23. A 24. C 25. D
Practice Problems 2
1. D 2. D 3. D 4. C 5. A 6. C 7. B 8. D 9. A 10. C
11. A 12. D 13. A 14. A 15. A 16. C 17. C 18. C 19. C 20. D
21. D 22. C 23. C 24. B 25. B
• Arithmetic circuits 1 1 0 1
• Code converters So, half adder can be realized by using one X-OR gate and
• Data processing circuits one AND gate.
1.36 | Unit 1 • Digital Logic
A A
S S
B B Full adder
C out
C in
= ( A + B) ( A + B ) (A ⊕ B)C in + AB
= A + B + ( A + B) C out
C = A⋅ B = A ⋅ B = A + B
C in
C
Figure 3 Logic diagram of full adder
A S
B NAND logic
A ⊕ B = AAB B AB
Half adder using NOR logic So A ⊕ B ⊕ Cin
Let A ⊕ B = x then s = X ⋅ XCin Cin X ⋅ Cin
Full Adder = X ⊕ Cin
Full adder is an arithmetic circuit that performs addition of
two bits with carry input. The result of full adder is given by
two outputssum and carry. The full adder circuit is used A
S
in parallel adder circuit as well as in serial adder circuit. B
For full adder, if total number of 1’s is odd at input lines,
the sum output is equal to logic 1, and if total number of C in
C out
1’s at input lines are more than or equal to 2, then the carry
output is logic 1. Figure 4 Logic diagram of a full adder using only 2-input NAND gates
Chapter 3 • Combinational Circuits | 1.37
Table 3 Truth Table Figure 6 logic diagram of half subtractor using NOR gate
A B d b
0 0 0 0
1 0 1 0 full Subtractor
1 1 0 0 Full subtractor is an arithmetic circuit similar to half sub-
0 1 1 1 tractor but it performs subtraction with borrow, it involves
subtraction of three bitsminuend, subtrahend and borrow-
d = AB + BA in, and two outputsdifference and borrow. The subtrac-
=A⊕B tion of 1 from 0 results in borrow to become logic 1. The
b = AB presence of odd number of 1’s at input lines make difference
A as logic 1.
d
B
Table 4 Truth Table
A B bi d b
b
0 0 0 0 0
0 0 1 1 1
Figure 5 Logic diagram of a half subtractor
0 1 0 1 1
A half subtractor can also realized using universal logic either
using only NAND gates or only NOR gates as explained below. 0 1 1 0 1
1 0 0 1 0
NAND logic 1 0 1 0 0
d=A⊕B 1 1 0 0 0
= AAB ⋅ B AB 1 1 1 1 1
b = AB = B( A + B ) = B( AB) = B ⋅ AB
d = ABbi + AB bi + AB bi + ABbi
A · AB
= bi ( AB + AB ) + bi ( AB + AB)
A d
B = bi ( A ⊕ B) + bi ( A ⊕ B)
b = A ⊕ B ⊕ bi
B · AB
1.38 | Unit 1 • Digital Logic
and Four bit parallel adder the output carry from each full adder
b = A Bbi + ABbi + ABbi is connected to the input carry of next full adder.
The bits are added with full adders, starting from the
= AB + ( A ⊕ B)bi LSB position to form the sum bit and carry bit.
A The longest propagation delay time in parallel adder
d = A ⊕ B ⊕ bi is the time it takes the carry to propagate through the full
B
adders.
bi For n-bit parallel adders consider tpds is the propagation
delay for sum of each full adder and tpdc is the propagation
b delay of carry.
The total time required to add all n-bits at the nth full
adder is
NAND logic TS = tpds + (n – 1)tpdc
d = A ⊕ B ⊕ bi So propagation delay increases with number of bits. To
overcome this difficulty we use look ahead carry adder,
= ( A ⊕ B)( A ⊕ B)bi bi ( A ⊕ B)bi
which is the fastest carry adder.
b = AB + bi ( A ⊕ B)
Ai Pi
Pi ⊕ Ci
= AB + bi ( A ⊕ B) Bi Si
= AB bi ( A ⊕ B)
Gi Pi Ci + Gi
= B( A + B ) bi bi + ( A ⊕ B) Ci + 1
Ci
A
B d
Consider the full adder circuit for ith stage, in parallel adder,
with two binary variables Ai, Bi, input carry Ci are:
bi Carry propagate (Pi) and carry generate (Gi)
b Pi = Ai ⊕ Bi
Gi = Ai ⋅ Bi
Figure 7 Logic diagram of a full subtractor using NAND logic
The output sum and carry can be expressed as
NOR logic Si = Pi ⊕ Ci
Output of full subtractor is also self dual in nature. So, same Ci + 1 = Pi Ci + Gi
circuit, with all NAND gates, replaced by NOR gates gives Now, the Boolean functions for each stage can be calculated
the NOR gate full subtractor. 9 NOR gates required. as substitute i = 0
Example 1: How many NAND gates are required for C0 is input carry
implementation of full adder and full subtractor respectively? C1 = G0 + P0 C0
(A) 11, 10 (B) 11, 11 (C) 9, 9 (D) 9, 10 Substitute i = 1, 2 …
Solution: (C) C2 = G1 + P1C1 = G1 + P1 (G0 + P0C0)
From the circuit diagrams in the previous discussion, full = G1 + P1 G0 + P1 P0 C0
adder requires 9 NAND gates and full subtractor requires
9 NAND gates. C3 = G2 + P2 C2 = G2 + P2 (G1 + P1 G0 + P1 P0 C0)
= G2 + P2 G1 + P2 P1 G0 + P2 P1 P0 C0
Binary Adder Since the Boolean function for each output carry is
A binary adder is a digital circuit that produces the arithme- expressed in SOP form, each function can be implemented
tic sum of two binary numbers. with AND–OR form or two level NAND gates.
B 3 A3 B 2 A2 B 1 A1 B 0 A0 From the above equations we can conclude that this cir-
cuit can perform addition in less time as C3 does not have to
C3 C2 C1 wait for C2 and C1 to propagate. C3, C2, C1 can have equal
F ·A F ·A F ·A F ·A C in
time delays.
The gain in speed of operation is achieved at the expense
Cout S3 S2 S1 S0 of additional complexity (hardware).
Chapter 3 • Combinational Circuits | 1.39
n-bit Comparator 1 0 1 1 1 0 0
The comparison of two numbers is an operation that deter- 1 1 0 0 0 0 1
mines whether one number is greater than, less than, or 1 1 0 1 0 0 1
equal to the other number. 1 1 1 0 0 0 1
A magnitude comparator is a combinational circuit that 1 1 1 1 0 1 0
compares two input numbers A and B, and specifies the out-
put with three variables, A > B, A = B, A < B: (a < b) = S(1, 2, 3, 6, 7, 11)
(a > b) = S(4, 8, 9, 12, 13, 14)
A L A<B
(a = b) = S(0, 5, 10, 15)
b 1b 0
Magnitude 00 01 11 10
E A=B a1a 0
comparator
B A>B 00 1 1 1
G
01 1 1
a L a<b 11
1-bit
E a=b 00 1
Comparator
b G a>b
a < b = a1′a0′b0 + a0′b1b0 + a1′b1
Figure 9 2-bit comparator will have 2-bit inputs a1 a0 and b1 b0. So we can write (A = B) = (A3 ⊙ B3) (A2 ⊙ B2) (A1 ⊙ B1)
(A0 ⊙ B0).
L E G To determine whether A is greater or less than B, we
a1 a0 b1 b0 a<b a=b a>b inspect the relative magnitudes of pairs of significant bits,
0 0 0 0 0 1 0 starting from MSB. If the two bits of a pair are equal, we
0 0 0 1 1 0 0 compare the next lower significant pair of bits. The com-
0 0 1 0 1 0 0 parison continues until a pair of unequal bits is reached.
0 0 1 1 1 0 0 for A < B, A = 0, B = 1
0 1 0 0 0 0 1 for A > B, A = 1, B = 0
0 1 0 1 0 1 0 A<B=A 3′B3 + (A3 ⊙ B3) A2′B2 + (A3 ⊙ B3)(A2 ⊙ B2)
0 1 1 0 1 0 0 × A1′B1 + (A3 ⊙ B3)(A2 ⊙ B2) (A1 ⊙ B1) A0′B0
0 1 1 1 1 0 0 A>B=A 3B3′ + (A3 ⊙ B3) A2B2′ + (A3 ⊙ B3) (A2 ⊙ B2)
1 0 0 0 0 0 1 × A1B1′ + (A3 ⊙ B3)(A2 ⊙ B2) (A1 ⊙ B1) A0B0′
1 0 0 1 0 0 1 4-bit comparator will have total 8 inputs and 28 = 256 input
1 0 1 0 0 1 0 combinations in truth table.
1.40 | Unit 1 • Digital Logic
Solution: Both 84-2-1 and XS-3 are BCD codes, each needs Figure 11 2 × 4 decoder
4-bits to represent. The following table gives the relation
between these codes. 84-2-1 is a weighted code, i.e., each Table 5 Truth Table
position will have weight as specified. XS-3 is non-weighted EN B1 B0 Y3 Y2 Y1 Y0
code; the binary code is 3 more than the digit in decimal. 0 X X 0 0 0 0
84-2-1 XS-3 1 0 0 0 0 0 1
Decimal B3B2B1B0 X3X2X1X0 1 0 1 0 0 1 0
0 0000 0011 1 1 0 0 1 0 0
1 0111 0100 1 1 1 1 0 0 0
2 0110 0101
3 0101 0110
Y 0 = EN · A · B
4 0100 0111
5 1011 1000
Y 1 = EN · A · B
6 1010 1001 A
7 1001 1010
8 1000 1011 B Y 2 = EN · A · B
9 1111 1100 EN
Y 3 = EN · A · B
We will consider minterm don’t-care combinations as 1, 2, 3,
12, 13, 14. For these combinations 84-2-1 code will not exist
Figure 12 2 × 4 decoder
and the remaining minterms can be found from truth table.
X0(B3, B2, B1, B0) = ∑m(0, 4, 6, 8, 10) Decoder outputs are implemented by AND gates, but reali-
+ ∑ Φ(1, 2, 3, 12, 13, 14) = B0 zation of AND gates at circuit level is done by the NAND
gates (universal gates). So, the decoders available in IC form
X1(B3, B2, B1, B0) = ∑m(0, 4, 5, 8, 9, 15) are implemented with NAND gates, i.e., the outputs are in
+ ∑ Φ(1, 2, 3, 12, 13, 14) = B1 complemented form and outputs are maxterms of the inputs
rather than minterms of inputs as in AND gate decoders.
X2(B3, B2, B1, B0) = ∑m(4, 5, 6, 7, 15) Furthermore, decoders include one or more enable inputs
+ ∑Φ(1, 2, 3, 12, 13, 14) = B2 to control the circuit operation. Enable can be either active
X3(B3, B2, B1, B0) = ∑m(8, 9, 10, 11, 15) low/high input.
+ ∑Φ(1, 2, 3, 12, 13, 14) = B3
EN
Decoder 2×4
Y 0 = EN + B1 + B0
A binary code of n-bits is capable of representing up to 2 n B1 Decoder Y 1 = EN + B1 + B0
elements of distinct elements of coded information. B0 with NAND Y 2 = EN + B1 + B0
gates
The three inputs are decoded into eight outputs, each rep- Y 3 = EN + B1 + B0
resenting one of the minterms of the three input variables.
A decoder is a combinational circuit that converts binary Figure 13 Active low 2 × 4 decoder
information from n input lines to a maximum 2n unique out-
put lines. Table 6 Truth Table
A binary decoder will have n inputs and 2n outputs. EN B1 B0 Y3 Y2 Y1 Y0
EN 1 X X 1 1 1 1
0 0 0 1 1 1 0
2n
Outputs 0 0 1 1 1 0 1
n n × 2n
Inputs Decoder 0 1 0 1 0 1 1
0 1 1 0 1 1 1
1.42 | Unit 1 • Digital Logic
The block diagram shown here is 2 × 4 decoder with Designing High Order Decoders from Lower
active low output and active low enable input. Order Decoders
The logic diagram is similar to the previous 2 × 4 decoder,
Decoder with enable input can be connected together to
except, all AND gates are replaced by NAND gates and EN
form larger decoder circuit.
will have inverter, EN is connected to all NAND inputs, as
The following configuration shows 3 × 8 decoder with
EN is active low input for this circuit.
2 × 4 decoders.
The decoder is enabled when EN is equal to 0.
As shown in the truth table, only one output can be equal B2
to 0 at any given time, all other outputs are equal to 1. The EN Y0
output whose value is equal to 0 represents the minterm B1 2×4 Y1
selected by inputs, enable. B0 Decoder Y2
Y3
Consider a 3–8 line decoder
EN Y 16
B2 3×8
D5 = ABC
B1 Dec
B0 Y 23
D4 = ABC
EN Y 24
B2 3×8
B1 Dec
D 3 = ABC B0 Y 31
D1 = ABC
Combinational Logic Implementation
An n × 2n decoder provides 2n minterms of n input variables.
Since any Boolean function can be expressed in sum-of-
D0 = ABC
minterms form, a decoder that generates the minterms of
Chapter 3 • Combinational Circuits | 1.43
the function, together with an external OR gate that forms (A) PQ + PR (B) P + QR
their logical sum, provides a hardware implementation of
the function. (C) P (Q + R) (D) Q( P + R)
Similarly, any function with n inputs and m outputs can
be implemented with n × 2n decoders and m OR gates. 0
Example 3: Implement full adder circuit by using 2 × 4 R B2 1
decoder. 2
Sum = S (1, 2, 4, 7), Carry = S (3, 5, 6, 7) Q B1
3×8 3 F (P, Q, R)
Decoder 4
0 5
A B2 1 Sum P 6
B0
2 7
3×8 3
B B1
Decoder 4
5 Solution: (C)
C B0 6 Carry The outputs of decoder are in normal form. 0, 2, 3, 4, 6
7 outputs are connected to NOR gate to form F(P, Q, R)
So F = Y0 + Y2 + Y3 + Y4 + Y6
Figure 14 Implementation of full adder circuit with decoder
= Y0 ⋅ Y2 ⋅ Y3 ⋅ Y4 ⋅Y6
The 3 × 8 decoder generates the 8 minterms for A, B, and
C. The OR gate for output sum forms the logical sum of Y0, Y1,…, Y7 indicate minterms, whereas Y0 , Y1 , , Y7 are
minterms 1, 2, 4 and 7. The OR gate for output carry forms maxterms.
the logical sum of minterms 3, 5, 6 and 7. So F = p (0, 2, 3, 4, 6)
Here, from the decoder circuit MSB is R, LSB is P.
Example 4: The minimized SOP form of output F(x, y, z) is
By using K-map
(A) x′ y + z′ (B) x′ y′ + z′
(C) x′ y′ + z′ (D) x′ + y′ z
QP
R 00 01 11 10
0 0 0 0
0
x B2 1 1 0 0
2
3×8 3 F F ( P , Q , R) = P ( R + Q )
y B1
Decoder 4
5
z B0 6 Encoders
7 It is a digital circuit that performs the inverse operation of
a decoder.
An encoder has 2n (or fewer) input lines and n output
Solution: (C) lines.
The outputs of decoder are in active low state. So, we can It is also known as an octal to binary converter.
express outputs as Y7 , Y6 Y0 Consider an 8–3 line encoder:
Outputs 0, 1, 3, 5, 7 are connected to NAND gate to form
function F(x, y, z) Table 8 Truth Table
=Y0 + Y1 + Y3 + Y5 + Y7 D0 D1 D2 D3 D4 D5 D6 D7 A B C
=S(0, 1, 3, 5, 7) 1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 1
By using K-maps
yz 0 0 1 0 0 0 0 0 0 1 0
x 00 01 11 10
0 0 0 1 0 0 1 0 0 1 1
0 1 1 1
0 0 0 0 1 0 0 1 1 0 0
1 1 1
0 0 0 0 0 1 0 0 1 0 1
F = z + x′y′ 0 0 0 0 0 0 1 0 1 1 0
Example 5. The minimal POS form of output function f(P, 0 0 0 0 0 0 0 1 1 1 1
Q, R) is
1.44 | Unit 1 • Digital Logic
Octal inputs The MUX has several data input lines and a single output
line. It also has data select inputs that permits digital data
D1 D2 D3 D4 D5 D6 D7
on any one of the inputs to be switched to the output line.
Binary outputs Depending upon the binary code applied at the selection
C = D1 + D3 + D5 + D 7 inputs, one (out of 2n) input will be gated to single output.
It is one of the most widely used standard logic circuits in
digital design. The applications of multiplexer include data
B = D2 + D 3 + D6 + D 7 selection, data routing, operation sequencing, parallel to
serial conversion, and logic function generation.
A = D4 + D5 + D6 + D 7 2n inputs will be controlled by n selection lines and mul-
tiplexer will have 1 output, we denote it as 2n × 1 multi-
plexer (data selector).
Figure 15 Logic diagram
In other words, a multiplexer selects 1 out of n input data
sources and transmits the selected data to a single output
Priority Encoder channel, this is called as multiplexing.
A priority encoder is an encoder circuit that includes the
priority function. Basic 2 × 1 Multiplexer
When two or more inputs are present, the input with The figure shows 2 × 1 multiplexer block diagram; it will
higher priority will be considered. have 2 inputsI0 and I1, one selection line S, and one output
Consider the 4 × 2 priority encoder. Y. The function table is as shown here.
I0 B1 EN S Y
I1 4×2 B0 0 x 0
I2 Encoder
I3 V 1 0 I0
1 1 I1
I3 I2 I1 I0 B1 B0 V
1 X X X 1 1 1
0 1 X X 1 0 1
EN
0 0 1 X 0 1 1 I0 Y
0 0 0 1 0 0 1 2×1
0 0 0 0 X X 0 MUX
I1
I3-I0 are inputs and B1 B0 are binary output bits, valid (V) S
output is set to 1, when at least one input is present at input
(I3 - I0).
When there is no input present, (I3 - I0 = 0000) then V = 0,
for this combination the output B1B0 will not be considered. The output equation of 2 × 1 multiplexer is
The higher the subscript number, the higher the priority Y = EN ( I 0 S + I1S ).
of the input. Input I3 has the highest priority, I2 has the next When enable is 1, the multiplexer will work in normal
priority level. Input I0 has lowest priority level. The Boolean mode, else the multiplexer will be disabled.
expressions for output B1 B0 are Sometimes enable input will be active low enable EN ,
then Y = EN ( I 0 S + I1S ).
B1 = I 3 + I 3 I 2
= I3 + I2 The 4 × 1 Multiplexer
B0 = I 3 + I 3 I 2 I1
D0
= I 3 + I 2 I1 D1 Output
4×1
V = I3 + I2 + I1 + I0 D2 MUX y
D3
Data input’s
Multiplexer
A multiplexer (MUX) is a device that allows digital infor- S1 S0
mation from several sources to be converted on to a single
Selected
line for transmission over that line to a common destination. lines
Chapter 3 • Combinational Circuits | 1.45
If a binary zero S1 = 0 and S0 = 0 as applied to the data select Solution: Y = ( I 0 S + I1S ) = A. It Implements NOT gate.
line the data input D0 appear on the data output line and so on.
S1 S0 y Example 7: What should be the connections to implement
0 0 D0
NAND gate by using 2 × 1 MUX?
0 1 D1 Solution: Y = AB = A + B = A + AB = 1 ⋅ A + B ⋅ A
1 0 D2
By considering I0 = 1, I1 = B, S = A, we can implement
1 1 D3
NAND gate, or by interchanging A and B also we can get
the same answer.
y = S1 S0 D0 + S1S0 D1 + S1S0 D2 + S1S0 D3
S0
1 I0 Y
S1 0 I1
4×1
0 I2 MUX
D0
1 I3
S1 S2
D1
A B
y
For the above 4 × 1 multiplexer Y = AB + AB = X-NOR gate,
D2 similarly to implement 2 input gates by using 4 × 1 multiplexer,
the inputs I0, I1, I2, I3 should be same as the terms in the truth
table of that gate.
D3
Logic Function Implementation
Figure 16 Logic diagram by Using Multiplexer
Let us consider a full subtractor circuit (borrow) to be
For 8 × 1 multiplexer with 8 inputs from I0–I7 based on
implemented by using multiplexer.
selection inputs S2 S1 S0, the equation for output
Full subtractor borrow (B) is a function of 3 inputs X, Y,
Y = I 0 S2 S1S0 + I1 S2 S1S0 + I 2 S2 S1 S0 + I 3 S2 S1S0 Z. The truth table is
+ I 4 S2 S1S0 + I 5 S2 S1S0 + I 6 S2 S1 S0 + I 7 S2 S1S0 X Y Z B 4 × 1 MUX 2 × 1 MUX
From multiplexer equation, we can observe, each input is 0 0 0 0
B=Z
associated with its minterm (in terms of selection inputs). 0 0 1 1
B=Y+Z
0 1 0 1
Basic Gates by Using MUX B=1
0 1 1 1
B I0 1 0 0 0
Y B=0
1 0 1 0
2×1 B = YZ
MUX 1 1 0 0
B I1 B=Z
1 1 1 1
S
To implement borrow by using 8 × 1 multiplexer, connect
the three variables X, Y, Z directly to selection lines of the
A multiplexer, and connect the corresponding values of B to
inputs, i.e., for I0 = 0, I1 = 1, I2 = 1, etc. as per above truth table.
Figure 17 X-OR gate by using 2 × 1 MUX
To implement borrow by using 4 × 1 multiplexer, con-
Y = AB + AB = X-OR gate, we can interchange inputs A nect any two variables to selection lines (in this case X, Y)
and B also, and write output (B) in terms of other variable, for XY = 00,
By interchanging inputs I0 and I1, Y = A B + AB, X-NOR output B is same as Z, so connect I0 = Z, similarly 1, 0, Z for
gate. remaining inputs.
Similarly, we can build all basic gates by using 2 × 1 To implement the function by using 2 × 1 multiplexer,
multiplexer. connect 1 variable as selection line (in this case consider X)
Example 6: If I0 = 1, I1 = 0, S = A, then Y is and write output (B) in terms of other variables, for X = 0,
1.46 | Unit 1 • Digital Logic
D 1 = ES 1S 0
Multiplexer
I7 S4
C1 C2 S1 D
D 2 = ES 1S 0
S0 S1
Multiplexer S4 D 3 = ES 1S 0
I8 S1 D C1 C2
S1 S0
S2 S3 Figure 17 Logic diagram
I 11 S4
C1 C2
Solved Examples
S0 S1
Example 1: The multiplexer shown in the figure is a 4 : 1
Multiplexer multiplexer. The output z is
I 12 S1 D
I3
C
I2 MUX
I 15 S4 Z
I1 4×1
C1 C2 C
I0
S1 S0
S0 S1
Solution: = A + CB
A1 B0 Z
= A + C + B = ABC
0 0 C \ NAND Gate
0 1 C
Example 4: In the TTL circuit in figure, S2–S0 are select
1 0 C
lines and x7–x0 are input lines. S0 and X0 are LSBs. The
1 1 C output Y is
1
∴ Z = A BC + ABC + ABC + AB C
0
= B( AC + AC ) + B( AC + AC ) X0 X1 X2 X3 X4 X5 X6 X7
0 S2
= ( AC + AC )( B + B)( x + x = 1) A 8 : 1 MUX y
∴ = AC + AC = A ⊕ C B S1
C S0
Example 2: The logic circuit shown in figure implements
D0
Solution: S2 = A, S1 = B, S0 = C
C I0 D1
D2 S2(A) S1(B) S0(C) Y
I1 3 to 8 D3
B 0 0 0 1
Decoder
D4
0 0 1 0
A I2 D5
0 1 0 0
D6
D7 0 1 1 1
1 0 0 0
D 1 0 1 1
1 1 0 1
1 1 1 0
Solution: z = D( A B C + A BC + ABC + AB C + ABC )
= D( A B(C + C ) + BC ( A + A) + AB C ) Y = A B C + ABC + ABC + ABC
× D( B A + B C + BC ) = C ( A B + AB ) + C ( AB + AB )
= D( B Θ C + AB) Y = C ( A ⊕ B) + C ( A ⊕ B) = A ⊕ B C
Example 3. The network shown in figure implements Example 5: The logic realized by the adjoining circuit is
A 0
A 1 MUX
f2 1 MUX
F
1 0 2
Select
S0 A 3 lines
S1 S0
MSB
B 1 MUX
B C
f1
0 0 Solution: F = B CA + BCA + BC A + BC A
S0 × C ( BA + B A) + C ( BA + B A)
× AB + AB(C + C ) = A ⊕ B
c
Example 6: Consider the following multiplexer, where I0,
Solution: f1 = C 0 + CB = CB, f1 = CB I1, I2, I3 are four date input lines selected by two address
F2 = f1 + f1 A = A ⋅ CB + CB line combinations AIA0 = 00, 01, 10, 11, respectively and f
1.48 | Unit 1 • Digital Logic
Exercises
Practice Problems 1 (A) are high; and G, G2 are low
Directions for questions 1 to 21: Select the correct alterna- (B) are high; and G is low G2 is high
tive from the given choices. (C) are high; and G, G2 are high
(D) are high; and G is high G2 is low
1. The binary number 110011 is to be converted to gray
code. The number of gates and type required are 5. The MUX shown in figure is 4 × 1 multiplexer the
(A) 6, AND (B) 6, X-NOR output z is
(C) 6, X-OR (D) 5, X-OR
2. The number of 4-to 16-line decoder required to make
an 8- to 256-line decoder is C I0
(A) 16 (B) 17 I1 MUX
(C) 32 (D) 64 Z
I2 4×1
3. f (x2, x1, x0) = ?
I3
S1 S0
D0
x0 I0 D1
D2 +5 V A B
x1 I1 3 to 8 D3 f
Decoder
D4 (A) ABC
x2 I2 D5 (B) A⊕B⊕C
D6 (C) AQBQC
D7
(D) A+B+C
(A) p(1, 2, 4, 5, 7) (B) Σ(1, 2, 4, 5, 7) 6. If a 4 to 1 MUX (shown below) realizes a three vari-
(C) Σ(0, 3, 6) (D) p(0, 2, 3, 6) able function f ( x, y, z ) = xy + xz then which of the
following is correct?
4. A 3-to-8 decoder is shown below
8
I0
3 7
6 I1 4 to 1
F(x, y, z)
5 Output I2 MUX
Input 2
4
I3
3 S1 S0
1
2
(MSB)
G2 G 1
Y Z
C y
BCD to Decimal decoder
(A) Full adder (B) Full subtractor
(C) Comparator (D) Parity generator
D0 D1 D8 D9
13. Which of the following represents octal to binary
y3 encoder?
y2 (A) D0 D1 D2 D3 D4 D5 D6 D7
y1
y0 A2
A1
(A) gray code numbers (B) 2421 BCD
(C) Excess – 3 code numbers (D) 84–2–1 A0
9. A 4-bit parallel full adder without input carry requires
(A) 8 HA, 4 OR gates (B) 8 HA, 3 OR gates D0 D1 D2 D3 D4 D5 D6 D7
(B)
(C) 7 HA, 4 OR gates (D) 7 HA, 3 OR gates
10. In the circuit find X.
A2
0 I0 0 I0 A1
1 I1 1 I1
4×1 y 4×1 y x A0
1 I2 1 I2
0 I3 0 I3 (C) D0 D1 D2 D3 D4 D5 D6 D7
S1 S0 S1 S0
A2
A B C
A1
(A) ABC + ABC + ABC + ABC
A0
(B) ABC + ABC + ABC + ABC
1.50 | Unit 1 • Digital Logic
(C) I=
0 I=
3 Cin ; I=
1 I=
2 Cin
b c
(D) I=0 I=
3 Cin ; I=
1 I=
2 Cin
15. The given circuit act as (A) b
(B) 0
b 1
4×1 4×1
c 1 0 b
MUX y1 0 b
c 0
S0
a 1
y0 a c a c
MUX
a 0
S0 S0
c 1 (C) (D)
MUX y2 b 1
b b 0 b 1
4×1
4×1 1
1
0 1
(A) Full adder (B) Half adder
(C) Full subtractor (D) Half subtractor a c a c
16. For a 4 × 16 decoder circuit, the outputs of decoder
(y0, y1, y4 . y5 . y10 . y11 . y14 . y15) are connected to 8 input 20. The circuit is used to convert one code to another.
NOR gate, the expression of NOR gate output is Identify it.
(A) A ⊕ D (B) A ⊙ D
A3 B3
(C) A ⊙ C (D) A ⊕ C
17. The function implemented by decoder is B2
A2
D0
A D1 A1 B1
X
D2
3 to 8 D3 A0 B0
B
Decoder
D4
C D5 Y
(A) Binary to gray
D6 (B) Gray to binary
D7 (C) Gray to XS–3
(D) Gray to 8421
Chapter 3 • Combinational Circuits | 1.51
21. The Boolean function realised by logic circuit is (A) F = Σm(0, 1, 3, 5, 9, 10, 14)
(B) F = Σm(2, 3, 5, 7, 8, 12, 13)
C I0
(C) F = Σm(1, 2, 4, 5, 11, 14, 15)
D I1 4:1
MUX Y F(A, B, C, D) (D) F = Σm(2, 3, 5, 7, 8, 9, 12)
I2
I3
S1 S0
A B
Practice Problems 2 C I0
Directions for questions 1 to 21: Select the correct alterna- C I1
tive from the given choices. 4:1 F
C I2 MUX
1. For a binary half subtractor having two input A and B,
the correct set of logical expression for the outputs D C I3
S0 S1
= (A minus B) and X (borrow) are
B
(A) D = AB + AB, X = AB A
(B) D = AB + AB +, AB, X = AB
(A) AB + BC + CA + BC (B) A ⊕ B ⊕ C
(C) D = AB + AB, X = AB (C) A ⊕ B (D) B ⊕ C
(D) D = AB + A B, X = AB 5. Full subtractor can be implemented by using
2. The function ‘F’ implemented by the multiplexer chip (A) 3-to-8 line decoder only
shown in the figure is (B) 3-to-8 line decoder and one OR gate
0 1 0 1 (C) 3-to-8 line decoder and two OR gates
(D) None
I0 I1 I2 I3 6. What are the difference and borrow equations for the
A S1 above circuit?
Y F (A) D = x Q y Q z, B = x′y + yz + zx′
B S0
(B) D = X ⊕ y ⊕ z, B = xy + yz + zx
(C) D = x ⊕ y ⊕ z, B = x′y + yz + zx′
(A) A (B) B (D) A and C both
(C) AB (D) AB + AB 7. Combinational circuits are one in which output depends
_________, whereas sequential circuit’s output depends
3 The following multiplexer circuit is equal to _________
(A) only on present input, only on past input
0 4:1 (B) only on present input, only on past and future input
MUX
1 (C) only on present input, only on present input and
y past output
2
(D) on present input, on past and present output
3
S1 S0 8. The sum output of the half adder is given by (assume A
a
b
and B as inputs)
c (A) S = AB( A + B) (B) S = ( A + B) AB
(C) S = ( A + B)( AB) (D) S = ( A + B )( AB )
(A) implementation of sum equation of full adder
(B) implementation of carry equation of full adder 9. MUX implements which of the following logic?
(C) implementation of borrow equation of full (A) NAND–XOR (B) AND–OR
substractor (C) OR–AND (D) XOR–NOT
(D) all of the above 10. A DeMUX can be used as a
4 The output ‘F’ of the multiplexer circuit shown in the (A) Comparator (B) Encoder
figure will be (C) Decoder (D) Adder
1.52 | Unit 1 • Digital Logic
X
A B A B A B A B s c s c
C D C D C D C
S S S S 16. Identify the circuit.
Y1
D A
B Y2
Output
(A) 4-bit adder giving X + Y
(B) 4-bit subtractor giving X - Y
(C) 4-bit subtractor giving Y - X Y3
(D) 4-bit adder giving X + Y + S
12. The Boolean function f implemented in the figure using (A) Half adder
two input multiplexers is (B) Full adder
(C) 1-bit magnitude comparator
D 0 1 0 (D) Parity generator
f
17. In order to implement n variable function (without any
C 1 B 1 extra hardware) the minimum order of MUX is
S0 S0
(A) 2n × 1 (B) 2n × 1
(C) (2 - 1) × 1
n
(D) (2n - 1) × 1
A
18. A full adder circuit can be changed to full subtractor by
(A) AC + AD + DC + ABD + ABC adding a
(B) A + AC + AD + DC (A) NOR gate (B) NAND gate
(C) B + AC + AD + DC (C) Inverter (D) AND gate
(D) AC + AD + A + B 19. The half adder when implemented in terms of NAND
13. The carry generate and carry propagate function of the logic is expressed as
look ahead carry adder is (A) A ⊕ B (B) A⋅ AB ⋅ B ⋅ AB
(A) CG = A + B, CP = A ⊕ B
(B) CG = A ⊕ B, CP = A + B (C) A ⋅ AB ⋅ B ⋅ AB (D) A ⋅ ABB⋅ AB
(C) CG = AB, CP = A ⊕ B
20. For a DeMUX to act as a decoder, what is the required
(D) CG = AB, CP = A + B
condition?
14. If we have a comparator and if E represents (A) Input should be left unconnected and select lines
the condition for equality i.e., (An ⊕ Bn), if An behave as a input to decoder
and Bn are to be compared then the expression (B) Input should be always 0 and select line behave as
A3 B3 + E3 A2 B2 + E3 E2 A1 B1 + E3 E2 E1 A. B. r e p r e s e n t s inputs to decoder
which of the condition for a 4-bit number? (C) Both are same
(A) A > B (B) B > A (D) Input should become enable and select lines
(C) A = B (D) None of these behave as inputs to decoder
15. When full adder is used to function as a 1-bit incremen- 21. For a full subtractor, which of the combination will give
tor, which of the circuit configurations must be used? the difference?
(A) a 0 (B) a 0
(A) ( A ⊕ B)( A ⊕ B)bi ⋅ bi ( A ⊕ B)bi
F A
0
F A (B) B ⋅ AB ⋅ bi ( A ⊕ B)
0
(C) A + B + bi + A ⊕ B
c s c s (D) None of these
Chapter 3 • Combinational Circuits | 1.53
x x 1 0 1 0 1 (A) P + Q (B) P + Q
x x x 1 1 1 1 (C) P ⊕ Q (D) P ⊕ Q
1 1 4 to 1
F
Multiplexer
R 2
R 3
S1 S0
minimal sum of products form of the output x is
P Q The minimal sum of products form of the output X is
[2016]
The minimal sum-of-products form of the Boolean
expression for the output F of the multiplexer is (A) P Q + PQR (B) P Q + QR
[2014] (C) PQ + P Q R (D) P Q + PQR
(A) PQ + QR + PQR 17. When two 8-bit numbers A7… A0 and B7… B0 in 2’s
(B) P Q + PQR + PQR + PQR complement representation (with A0 and B0 as the
least significant bits) are added using a ripple-carry
(C) PQR + PQR + QR + PQR
adder, the sum bits obtained are S7…S0 and the carry
(D) PQR PQR + PQR + QR + PQR bits are C7…C0. An overflow is said to have occurred
if[2017]
13. Consider the following combinational function block
(A) the carry bit C7 is 1
involving four Boolean variables x, y, a, b, where x, a,
(B) all the carry bits (C7,…,C0) are 1
b are inputs and y is the output. [2014]
f(x, y, a, b) (C) ( A7 ⋅ B7 ⋅ S7 + A7 ⋅ B7 ⋅ S7 ) is 1
{ (D) ( A0 ⋅ B0 ⋅ S0 + A0 ⋅ B0 ⋅ S0 ) is 1
Chapter 3 • Combinational Circuits | 1.55
Answer Keys
Exercises
Practice Problems 1
1. D 2. B 3. B 4. D 5. D 6. A 7. C 8. B 9. D 10. A
11. A 12. B 13. B 14. C 15. C 16. D 17. D 18. B 19. C 20. A
21. D
Practice Problems 2
1. C 2. B 3. A 4. D 5. C 6. C 7. C 8. B 9. B 10. C
11. B 12. C 13. C 14. A 15. C 16. C 17. B 18. C 19. C 20. D
21. A
LEARNING OBJECTIVES
Q R
Q
i/p F.F
Q
Clk Q′
S
There are different types of flip-flops S-R flip-flop, D-flip- Figure 2 Logic diagram for SR latch
flop, T-flip-flop, J-K flip–flops, etc.
S R Qn+1 ′
Qn+1
Latches
0 0 Qn Qn′ (no change)
(i) S-R Latch: The simplest latch is called S-R latch. S-R
0 1 0 1 (Reset)
means Set-Reset. It has two outputs Q and Q and two
inputs S and R, which represent set or reset signal. 1 0 1 0 (set)
1 1 0 0 (invalid)
S G1
G3 Q R
Q
G4 Q
R G2 Q′
S
Figure 3 S R Latch
Above figure shows two cross coupled gates G3 and
G4 and inverters G1 and G2. Here output of G3 is con-
nected to the input of G4 and output of G4 is applied to S R Qn+1 Qn +1
the input of G3. S = 1, R = 0 output of G1 = 0 and G2 =
0 0 1 1 (Invalid)
1. Since one of the input of G3 is 0, so its output will be
0 1 1 0 (Set)
certainly 1 and consequently both input of G4 will be 1
and the output Q = 0. 1 0 0 1 (Reset)
For S = 1, R = 0, Q = 1, Q = 0. S = 0, R = 1 the 1 1 Qn Qn′ (No change)
output will be Q = 0 and Q = 1. The first of the input
condition S = 1 and R = 0 makes Q = 1 which referred
S R latch is active low SR latch
as the set state and the second condition S = 0 and R = (iii) SR latch with control input: The working of gated
1 makes Q = 0 which is referred as reset state. SR latch is exactly the same as SR latch when the EN
For S = 0 and R = 0 output of both G1 and G2 will be pulse is present. When the EN pulse is not present (EN
one and hence there will be no change in Q and Q. pulse = 0) the gates G1 and G2 are inhibited and will not
For S = R = 1, both the outputs Q and Q will try respond to the input.
to become one, which produces invalid results and
should not be used for the above latch. S
Q
Input Output
State EN
S R Q Q
1 0 1 0 Set
Q
0 1 0 1 Reset
R
0 0 0 0 No change
1 1 ? ? Invalid Characteristic table of SR latch shows the operation
of latch in tabular form. Qt stands as the binary state
(ii) SR latch by using NAND/NOR gates: The SR latch of the latch before the application of latch pulse and
is a circuit with two cross-coupled NOR gates or two referred to as the present state. The S and R columns
cross-coupled NAND gates. Two inputs labelled S for give the possible values of the inputs and Qt+1 is the
set and R for reset. Latch will have two outputs: state of the latch after the application of a single pulse,
•• Q: output state in normal form and referred to as next stage. EN input is not included in
•• Q′: output state in complemented form. the characteristic table.
1.58 | Unit 1 • Digital Logic
Characteristic
table for SR latch is given below: Pr
Qt S R Qt+1
0 0 0 0 S Q
0 0 1 0
SR
0 1 0 1 EN
Latch
0 1 1 X
R Q
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 X Clr
Present (Pr) EN
S Q
EN Clr
EN D Qn+1
Clear (Clr)
0 X Qn – No change (Disabled)
Figure 4 SR latch with Pr and Clr inputs 1 0 0 – Reset state
If Pr = Clr = 1, the circuits operates as of S–R latch 1 1 1 – Set state
explained previously.
If Pr = 0, Clr = 1, the output Q will become 1, which in When EN = 0, the circuit will be disabled and input D
turn changes Q = 0. will not have only effect on output, and output will be
If Pr = 1, Clr = 0 the output Q will become 1, which in same as previous state.
turn changes Q = 0. When EN = 1, D = 0, i.e., S = 0, R = 1 which makes
If Pr = Clr = 0, both Q and Q will become 1, which is output Q = 0 and Q = 1 (Reset state).
invalid case, so Pr = Clr = 0 condition must not be used. When EN = 1, D = 1, i.e., S = 1, R = 0 which makes
J S Q
(or) the output Y becomes (0 + 0) = 1 and which in turn
EN SR latch changes X = (Y + A) = (0 + 1) = 0. So, output (X, Y) cannot
be predicted after the invalid condition. So, X = 0, Y = 1 or
K R Q X = 1, Y = 0
Example 2: Refer to the NAND and NOR latches shown
Figure 7 JK latch by using SR latch in the figure the inputs (P, Q) for both the latches are first
made (1, 0) and then after a few seconds, made (0, 0). The
J K S R Qn+1 Qn+1 corresponding stable outputs (X, Y ) are
0 0 0 0 Qn Qn -No change P P
X X
0 1 0 Qn 0 1-Reset
1 0 Qn 0 1 0-Set
1 1 Qn Qn Qn Qn-Toggle Y Y
Q Q
Example 1: The following binary values were applied to A (A) NAND: first (0, 1) then (0, 1); NOR: first (1, 0) then (1, 0)
and B inputs of NOR gate latch shown in the figure, in the (B) NAND: first (0, 1) then (1, 1); NOR: First (0, 1) then
sequence indicated below. A = 1, B = 0; A = 1, B = 1; A = 0, (0, 1)
B = 0. The corresponding stable X, Y outputs will be (C) NAND: first (1, 0) then (0, 0); NOR: first (1, 0) then (1, 0)
(D) NAND: first (1, 0), then (1, 0); NOR: first (1, 0) then
A
X (1, 1)
Solution: (B)
From the truth table of SR latch and S R latch SR latch with
NOR gates:
Y
B For (P, Q) = (1, 0) = (R, S) output (=
X , Y ) (=
Q, Q ) (0, 1)
1.60 | Unit 1 • Digital Logic
Then (P, Q) are made (0, 0), i.e., (R, S) = (0, 0), which G1m
J
results in no change at output. So, (=X , Y ) (=
Q, Q ) (0,1) Qm
SR latch with NAND gates: Q
For (P, Q) = (1, 0) = (S, R) output (X, Y) = (Q, Q ) = (0,1). Clk
Then (P, Q) are made (0, 0), i.e., (S, R) = (0, 0) which is G 2m Qm Q
K
invalid conditions for S R latch. So, (=
X , Y ) (=
Q, Q ) (1,1)
(vii) Race around condition: The difficulties of both the
inputs (S = R = 1) being not allowed in an SR latch is
eliminated in JK latch by using the feedback connec- Figure 8 Logic diagram of JK flip-flop
tion from the output to the input of the gate G1 and G2. Positive clock pulse is applied to the first latch and
In a normal JK latch if J = K = 1 and Q = 0 and enable the clock pulse will be inverted before its arrival at
signal is applied without RC differentiator, after a the second latch. When Clk = 1, the first latch is ena-
time interval ∆t (the propagation delay through two bled and the outputs Qm and Qm responds to the inputs
NAND gate in series) the output will change to Q = 1. J and K, according to the truth table of JK latch. At
Now we have J = K = 1 and Q = 1 and after another this time the 2nd latch is inhibited because its clock
time interval of ∆t the output will change back to Q = is low (Clk = 0). When the clock goes low (Clk = 0),
0. Hence for the duration of (tp) of the enable signal the first latch is inhibited and the second is enabled.
the output will oscillates back and forth between 0 and Therefore, the outputs Q and Q follow the outputs
1. At the end of the enable signal the values of Q is Qm and Qm , respectively. Since the second latch sim-
uncertain. This situation is referred to as race around ply follows the first one, it is referred to as slave and
condition. the first one as the master. Hence this configuration is
The race around condition can be avoided if enable known as master-slave JK flip-flop. In this circuit, the
time period tp < ∆t but it may be difficult to satisfy this input to the gate G1m and G2m do not change, during
condition, because of very small propagation delays the clock pulse levels.
in ICs. To solve this problem the enable signals are
converted to narrows spike using RC differentiator The race around condition does not exist.
circuit having a short time constant. Its output will be
Table 2 State/characteristic Table
high during the high transmission time of the enable.
Another method to avoid this problem is master-slave Clk J K Qt Qt+1
JK flip-flop. ↓
↓
0
0
0
0
0
1
0
1
}Q1
Flip-flops ↓ 1 0 0 1
}1
↓ 1 0 1 1
(i) Master-slave JK flip-flop: This is a cascade of 2 SR
latches with feedback from the output of the second SR
latch to the inputs of the first as shown in the figure below.
↓
↓
0
0
1
1
0
1
0
}
0 0
↓
↓
1
1
1
1
0
1
1
}
0 Qt
J S
Q S Q JK
Clk Q 00 01 11 10
Q R Q
K R 0 1 1
1 1 1
Qt +1 = J Qt + Qt K
(iii) Triggering of flip-flop: The flip-flop can be triggered There is no raising problem with D flip-flop. High or
to set or reset either at one of the edges of the clock 1 state will set the flip-flop and a low or 0 state will
pulse. There are three types of triggering as described reset the flip-flop. The presence of inverter at the input
below: ensure that S/J and R/K inputs will always be in the
1. Positive edge triggering flip-flop: These set or opposite state.
reset at the positive (rising or leading) edge of the Table 4 Characteristic Table of D Flip-flop
clock pulse depending upon the state of i/p signal
and o/p remain steady for 1 clock period. Positive Qt D Qt+1
edge triggering is indicated by an arrow head at the 0 0 0
clock terminal of the flip-flop. 0 1 1
1 0 0
S Q
1 1 1
D
R Q Q 0 1
0 1
2. Negative edge triggered flip-flop: There are flip- 1 1
flops those in which state transmissions take Q t +1=D
place only at the negative edge (falling or trailing)
From the characteristic table of D.flip-flop, the next
of the clock signal. Negative edge triggering is
state of the flip-flop is independent of the present state
indicated by arrow head with bubble at the clock
since Qt+1 = D, whether Qt = 0 or 1.
terminal.
(v) T flip-flop: In a JK flip-flop J = K = 1 and the resulting
S Q
flip-flop is referred to as a T flip-flop.
Pr
R Q
T J Q
3. Level triggering: Level triggering means the
Clk FF
specified action occurs based on the steady state
value of the input. That is, when a certain level is K Q
reached (0 or 1) the output will change states level
triggering will be used in latches. Table 5 Truth Table
(iv) D flip-flop: It receives the designation from its ability Clk T Qn+1
to hold data into its internal storage. An SR/JK flip-
↑ 0 Qn
flop has two inputs. It requires two inputs S/J and R/K
to store 1 bit. This is a serious disadvantage in many ↑ 1 Qn
application to overcome the difficulty D flip-flop has ↑ x Qn
been developed which has only one input line. A D
1.62 | Unit 1 • Digital Logic
1 0 1
×1
T 0 1 Figure 10 State diagram of JK flip-flop
Q
0 1
1
1 1
0 0 1 0
Qt +1 = TQt + Qt T
1
(vi) Excitation table of flip-flops: The truth table of flip- Figure 11 State diagram of T flip-flop
flop is also referred to as the characteristic table, which
specifies the operational characteristic of flip-flop. 1
Sometimes we come across situations in which pre-
0 0 1 1
sent state and the next state of the circuit are known
and we have to find the input conditions that must pre- 0
vail to cause the desired transition of the state.
Consider initially JK flip-flop output Qn = 1, Q n Figure 12 State diagram of D flip-flop
= 0, after clock pulse it changed to Qn +1 = 0, Q n + 1 = 1, (viii) Conversion of one flip-flop to other flip-flop
The input conditions, which made this transition, Conversion of T flip-flop to JK flip-flop
can be 1. Write the characteristic table of required flip-flop
Toggle – for J = 1, K = 1, Qn +1 = Q n (here JK).
or 2. Write the excitation table of available or given
Reset – for J = 0, K = 1, Qn +1 = 0, Q n +1 = 1 Flip-flop (here T).
From the above conditions we can conclude that for 3. Solve for inputs of given flip-flop in terms of
transition Qn = 1 to Qn+1 = 0 occurs when J = 0 (or) 1 required flip-flop inputs and output.
(don’t care) and K = 1.
Table 8 JK flip-flop characteristic and T flip-flop excitation table
Similarly, input conditions can be found out for all
possible situations. JK Flip-flop
Characteristic Table T Flip-flop Excitation Table
Table 7 Excitation table of flip-flop.
J K Qn Qn+1 T
Present Next SR JK T D 0 0 0 0 0
State State Flip-flop Flip-flop Flip-flop Flip-flop
0 0 1 1 0
Qn Qn+1 S R J K T D
0 1 0 0 0
0 0 0 × 0 × 0 0
0 1 1 0 1
0 1 1 0 1 × 1 1
1 0 0 1 1
1 0 0 1 × 1 1 0
1 0 1 1 0
1 1 × 0 × 0 0 1
1 1 0 1 1
These excitation tables are useful in the design of syn- 1 1 1 0 1
chronous circuits.
KQ n
(vii) State diagrams of flip-flops: State diagram is a directed J 00 01 11 10
graph with nodes connected with directed arcs. State of 0 1
the circuit is represented by the node, the directed arcs 1 1 1 1
represent the state transitions, from present state (node)
to next state (node) at the occurrence of clock pulse. T = J Q n + KQn
Chapter 4 • Sequential Circuits | 1.63
The circuit is
J
(A) SR flip-flop with inputs A = S, B = R
T Q Q (B) SR flip-flop with inputs= A R= ,B S
K T (C) JK flip-flop with inputs A = J, B = K
Clk Q Q (D) JK flip-flop with inputs=A K=
,B J
Solution: (C)
Figure 13 D Flip-flop by using other flip-flops
The characteristic equation of D flip-flop is
D S Q D J Q
Qn+1 = D
Qn +1 = J Q n + KQn
T Q
D If A = J, B = K, then this circuit works like JK flip-flop.
Clk Q Example 4: The input Clk frequency for the flip-flop given
is 10 kHz, then the frequency of Q will be
Figure 14 T flip-flop by using other flip-flops
S Q Q
S Q
Clk
T R Q
R Q
T J Q Solution: (B)
=
Form circuit we can say S Q=
n, R Qn .
If initially (Qn , Q n ) = (0, 1), then inputs (S, R) = (1, 0), by
K Q
applying clk pulse (Qn +1 Q n +1 ) becomes (1, 0) . . .
Clr
Clk Qn Qn S R Qn+1 Q n+1
D Q 1 0 1 1 0 1 0
T
2 1 0 0 1 0 1
Clk Q 3 0 1 1 0 1 0
4 1 0 0 1 0 1
Example 3: A sequential circuit using D flip-flop and logic
gates is shown in the figure, where A and B are inputs and The output Qn+1 toggles for every clock pulse.
Q is output.
t
Clk
A
Q
D Q Q 2t
B
Clk Q Q 1 f 10
=
So frequency of Q = = = 5 kHz
2t 2 2
1.64 | Unit 1 • Digital Logic
Examples 5: For the D flip-flop shown, if initially Qn is set are not clocked simultaneously. Each flip-flop is trig-
then what is the output state Qn+1 for X = 0, and for X = 1? gered by the previous flip-flop.
Table 10 Identification of GATE to Clear the Flip-flops From the Truth table R = Q3 Q2
For active Low R is used.
Input to the Gate Output of the Gate Type of Gate
∴ R = 0 for 000 to 101
OR
Q
Clr
R = 1 for 110
R = X for 111
Clr NOR
Q ∴ K-map is
Q2Q3
Q NAND Q1 00 01 11 10
Clr
0 1
Q Clr AND
1 ×
∴ R = Q2 Q3
Example:
Logic diagram is
1 1 1
(i) Clr
Q T2 Q2
T1 Q1 T3 Q3
Clk
Q1 Q2 Q3
(ii) Clr Clr Clr
Q Clr
Q3
Q2
Clr
Q1
Q0
J0 Q0 J1 Q1 J2 Q2 J3 Q3
Clock
K0 K1 K2 K3
1 Clr Q 0 1 Clr Q 1 1 Clr Q 2 1 Clr Q 3
PS NS Required Excitation J2 Q1 K2 Q K3
Q3 Q2 Q1 Q3 Q2 Q1 J3 K3 J2 K2 J1 K1
Clk
0 0 0 0 0 1 0 x 0 x 1 x
0 0 1 0 1 0 0 x 1 x x 1
0 1 0 0 1 1 0 x x 0 1 x
Table 11 Comparison between asynchronous counter and
0 1 1 1 0 0 1 x x 1 x 1 synchronous counter
1 0 0 1 0 1 x 0 0 x 1 x
Asynchronous Counter Synchronous Counter
1 0 1 1 1 0 x 0 1 x x 1
1. In this type of counter, In this type there is no con-
1 1 0 1 1 1 x 0 x 0 1 x flip-flops are connected nection between output of first
1 1 1 0 0 0 x 1 x 1 x 1 in such a way that output flip-flop and clock input of the
of first flip-flop drives the next flip-flop
clock for the next flip-flop
Step IV: Obtain the minimal expression using K-map.
2. All the flip-flops are not All the flip-flops are clocked
Q 2Q 1 clocked simultaneously simultaneously
Q 3 00 01 11 10 3. Logic circuit is very simple Design involves complex logic
0 1 even for more number of circuits as number of state
states increases
1 × × × ×
J 3 = Q 2Q 1 4. Main draw back of these As clock is simultaneously
counters is their low speed given to all flip-flops, there is no
Q 2Q 1 as the clock is propagated problem of propagation delay.
Q 3 00 01 11 10 through number of flip- Hence they are preferred when
flops before it reaches last number of flip-flops increases in
0 × × × ×
flip-flop the given design.
1 1
K 3 = Q 2Q 1
The main drawback of ripple counters is their high
Q 2Q 1 delays, if propagation delay of each flip-flop is
Q 3 00 01 11 10 assumed as x, then to get output of the first flip-flop
0 1 × × it takes x, i.e., after x seconds the second flip-flop
1 1 × × will get its clock pulse from previous stage, and out-
J2 = Q1 put of second flip-flop will be out after another x
seconds, similarly the final output of last flip-flop
Q 2Q 1
Q 3 00 01 11 10 will be after nx seconds, where n is the number of
0 × 1 × flip-flops. So the propagation delay of ripple counter
1 × 1 ×
is nx, which is directly proportionate to the number
of flip-flops.
K 3 = Q1
The maximum frequency of operation of ripple
Q 2Q 1 1
Q3 00 01 11 10 counter is inverse of delay, f max =
nx
0 1 × × 1 Maximum operating frequency is the highest fre-
1 1 × × 1 quency at which a sequential circuit can be reliably
triggered. If the clock frequency is above this maxi-
J1 = 1
mum frequency the flip-flops in the circuit cannot
Q 2Q 1 respond quickly and the operation will be unreliable.
Q3 00 01 11 10 In case of synchronous counters (synchronous
0 × 1 1 × circuits) as clock is applied simultaneously to all the
1 × 1 1 × flip-flops, the output of all the flip-flops change by x
seconds (delay of one flip-flop) and this delay is inde-
K1 = 1
pendent of number of flip-flops used in circuit.
Step V: Draw the logic diagram based on the minimal The maximum frequency of operation of synchro-
expression. 1
nous counter is inverse of delay f max =
x
1.68 | Unit 1 • Digital Logic
1 Serial data
Solution: For ripple counter f max = , given is a MOD-64
nx input
ripple counter, i.e., 26 states, so n = 6 flip-flops are required.
1
x= = 5µ S
33.33K × 6
Parallel data output
For synchronous counter
(iii) Parallel-in–parallel-out:
1 1
f max = = = 0.2 MHz = 200 kHz Parallel data input
x 5 µS
When multiple counters are connected in cascade, then the
total number of states of the new counter is A × B × C, i.e.,
it will work as MOD-A × B × C counter.
Q3 Q2 Q1 Q0
SET SET SET SET
Serial input D Q D Q D Q D Q Serial output
Clk S.I Q3 Q2 Q1 Q0
1 0 1 0
0 1 0 0 0 0 2 0 0 1
1 0 1 0 0 0 3 1 0 0
4 0 1 0
2 1 0 1 0 0
3 1 1 0 1 0 100
4 1 1 0 1
001 010
The first data bit 1 will appear at serial output after 4
clock pulses. A ring counter with N flip-flops can count up to N states,
i.e., MOD-N counter, whereas, N-bit asynchronous counter
Application of Shift Registers can count up to 2N states. So, ring counter is uneconomi-
1. Delay line: Serial input and serial output shift register cal compared to a ripple counter, but has the advantage of
can be used to introduce delay in digital signals. requiring no decoder. Since it is entirely synchronous oper-
1 ation and requires no gates for flip-flop inputs, it has further
Delay = no.of flip-flops × = No. of
Clk frequency advantage of being very fast.
flip-flops × time period of clock pulse Twisted ring counter (Johnson counter): This counter is
2. Serial to parallel, parallel to serial converter: SIPO, obtained from a SISO shift register by connecting the comple-
PISO registers used for data conversion. ment of serial output to serial input as shown in below figure.
3. Sequence generator: A circuit, which generates a Q2 Q1 Q0
prescribed sequence of bits, with clock pulses is D
SET Q
D
SET
Q D SET Q
called as sequence generator
The minimum number of flip-flops ‘n’ required to gen-
erate a sequence of length ‘S’ bits is given by S ≤ 2n - 1
Clr Q Clr Q Clr Q
Shift register counters Clk
One of the applications of the shift register is that they
Figure 20 Twisted Ring Counter
can be arranged to work as ring counters. Ring counters
are constructed by modifying the serial-in, serial-out, shift Let initially all the FFs be reset, after each clock pulse
registers. There are two types of ring counters—basic ring the complement of last bit will appear as at MSB, and other
counter and twisted ring counter (Johnson counter). The bits shift right side by 1-bit. After 6 clock pulses the register
basic ring counter is obtained from SISO shift register by will come to initial state 000. Similarly, the 3-bit Johnson
connecting serial output to serial input. counter will oscillate between the states 101, 010.
Q2 Q1 Q0 Clk Q2 Q1 Q0
SET Q SET D SET Q
D D Q
0 0 0 0
1 1 0 0
1
000 Solution: N ≤
f max ⋅ t pd
001
fmax = 10 MHz N ≤ 8
100
tpd = 12 ns
1
N≤
10 × 10 × 12 × 10 −9
6
011 110
MOD counter is = 2N = 28 = 256
111 Example 6: An AB flip-flop is constructed from an SR
flip-flop as shown below. The expression for next state Q+ is
A
An n-bit Johnson counter can have 2n unique states and S Q
can count up to 2n pulses, so it is a MOD-2n counter. It is
Clk
more economical than basic ring counter but less economi-
cal than ripple counter. B R
Solution:
Solved Examples
A B Q S R Q+
Example 1: Assume that 4-bit counter is holding the count
0101. What will be the count after 27 clock pulses? 0 0 0 1 0 1
0 0 1 1 0 1
Solution: Total clock pulses: 27 = 16 + 11
0 1 0 0 1 0
0101 + 1011 = 0000
0 1 1 0 1 0
Example 2: A MOD-2 counter followed by MOD-5 1 0 0 0 0 0
counter is
1 0 1 0 0 1
Solution: A decade counter, counts 10 states (5 × 2). 1 1 0 1 1 ×
P Clk Clk
R
K Q K Q
Solution
P Q S R Q+
0 0 0 1 0 Solution:
0 1 1 0 1 After 1st pulse y1 = 0, y2 = 1
1 0 1 0 1 After 2nd pulse y1 =0, y2 = 0
After 3rd pulse y1 =1, y2 = 0
1 1 0 1 0
After 4th pulse y1 = 1, y2 = 1
So, Q+ = P ⊕ Q Example 8: A ripple counter is to operate at a frequency
Example 5: A certain JK FF has tpd = 12 n sec what is the of 10 MHz. If the propagation delay time of each flip-flop
largest MOD counter, that can be constructed from these FF in the counter is 10 ns and the storbing time is 50 ns, how
and still operate up to 10 MHz? many maximum stages can the counter have?
Chapter 4 • Sequential Circuits | 1.71
1 b7 b6 b5 b4 b3 b2 b1 b0
Solution: nt pd + t s ≤
f
where, n = number of stages
D Q
tpd = propagation delay time
Clk
ts = strobing time Q1
f = frequency of operation = 10 × 10– 9n + 50 × 10– 9
1
≤ Solution: The output of XOR gate is Z = bi + 1 ⊕ bi and this
10 × 106
output shift the register to left. Initially, Z = 0
(or) 10n + 50 ≤ 100
After 2nd clock Z = b7 ⊕ 0 = b7
(or) 10n ≤ 50
For max stages n = 50 After 2nd clock Z = b7 ⊕ b6
=5 3rd clock Z = b6 ⊕ b5
10
Example 9: In the circuit assuming initially Q0 = Q1 = 0. 4th clock Z = b5 ⊕ b4
Then the states of Q0 and Q1 immediately after the 33rd It is a binary to gray code converter.
pulse are
Example 12: A 4-bit MOD-16 ripple counter uses JK
Q0 flip-flops. If the propagation delay of each flip-flop is 50
J0 Q0 J1 Q1 ns sec, the maximum clock frequency that can be used is
equal to
1 K0 Q1 K1 Q2
1
Solution: Max = clock frequency = = 5 MHz
Clk 4 × 50 × 10 −9
Solution:
Example 13: What is the state diagram for the sequential
J0 K0 J1 K1 Q0 Q1 Count circuit shown?
1 1 0 1 0 0 Initial
1 1 1 0 1 0 1st pulse
0 1 0 1 0 1 2nd
J Q
1 1 0 1 0 0 3rd X
1 1 1 0 1 0 4th Clk
0 1 0 1 0 1 5th pulse
Q1
After 4th pulse, output is same as after 1st one, so, sequence K
gets repeated. So output after 33rd pulse would be same as
after 3rd pulse. i.e., (00).
Example 10: The frequency of the pulse at z in the network X=1
shown in figure is
w
(A) X=0 0 1 X=0
10-bit 4-bit Parallel
Ring counter counter X=1
160 kHz
X=1
y
Mod-25 4-bit Jhonson
z
(B) X=0 0 1 X=0
x Ripple counter counter
X=0
Solution: 10-bit ring counter is a MOD-10. So, it divides
X=1
the 160 kHz input by 10. Therefore, w = 16 kHz. The 4-bit
parallel counter is a MOD-16. Thus, the frequency at x = 1 (C) X=0 0 1 X=0
kHz. The MOD-25 ripple counter produces a frequency at y
= 40 Hz (1 kHz/25 = 40 Hz). The 4-bit Johnson counter is X=1
a MOD-8. The frequency at Z = 5Hz. X=1
Example 11: The 8-bit shift left shift register, and D flip- (D) X=0 0 1 X=0
flop shown in the figure is synchronized with the same
clock. The D flip-flop is initially cleared. The circuit acts as X=0
1.72 | Unit 1 • Digital Logic
Exercises
Practice Problems 1 (A) 001 (B) 010
Directions for questions 1 to 22: Select the correct alterna- (C) 100 (D) 101
tive from the given choices. 6. 12 MHz clock frequency is applied to a cascaded coun-
1. How many flip-flops are needed for MOD-16 ring coun- ter of MOD-3 counter, MOD-4 counter and MOD-5
ter and MOD-16 Johnson counter? counter. The lowest output frequency is
(A) 16, 16 (B) 16, 8 (A) 200 kHz (B) 1 MHz
(C) 4, 3 (D) 4, 4 (C) 3 MHz (D) 4 MHz
2. A 2-bit synchronous counter uses flip-flops with propa- 7. In the modulo-6 ripple counter shown in the figure
gation delay time of 25 n sec, each. The maximum pos- below, the output of the 2-input gate is used to clear the
sible time required for change of state will be JK flip-flops. The 2-input gate is
1
(A) 25 n sec (B) 50 n sec
(C) 75 n sec D) 100 n sec
C J0 B J1 A J2
3. For given MOD-16 counter with a 10 kHz clock input Clk
determine the frequency at Q3 C K0 B K A K
CP 1
10 kHz 2 input Reset
CP 0 MOD-16 gate
Clk Rx Ry Rz
Chapter 4 • Sequential Circuits | 1.73
0 0 0 x 0 0 1 x
y 0 1 1 x 0 1 0 x
(B) Rx, Ry, Rz
z
1 0 x 1 1 0 x 0
x 1 1 x 0 1 1 x 1
(C) y Rx, Ry, Rz
z
(C) Q Q A B (D) Q Q A B
x n n+1 n n+1
(D) Rx, Rz
z 0 0 x 0 0 0 x 0
0 1 x 1 0 1 1 x
10. Two D flip-flops, as shown below, are to be connected
1 0 x x 1 0 x 1
as a synchronous counter that goes through the follow-
ing Q1Q0 sequence 00 → 01 → 11 → 10 → 00. The 1 1 0 x 1 1 0 x
inputs D0 and D1 respectively should be connected as
15. A shift register that shift the bits 1 position to the right
at each clock pulse is initialized to 1100 (Q0, Q1, Q2,
D0 Q0 D1 Q1
LSB MSB Q3). The outputs are combined using an XOR gate cir-
Clk Q 0 Clk Q 1 cuit and fed to the D input. After which clock pulse,
will the initial pattern reappear at the output?
Clk
K Q K Q K
18. If the propagation delay of each FF is 50 ns, and for the (A) MOD-2 counter
AND gate to be 20 ns. What will be the fmax for MOD- (B) MOD-4 counter
32 ripple and synchronous counters? (C) MOD-3 counter
(A) 14.3 MHz, 4 MHz (B) 14.3 MHz, 5 MHz (D) MOD-2 generate 00, 10, 00
(C) 5 MHz, 14.3 MHz (D) 3.7 MHz, 14.3 MHz 21. The MOD number of asynchronous counter shown
19. For a given counter identify its behavior All J = K = 1
(1) (1) T Q J Q0 J J J J
T P
Clk
Clk P K Clr K Clr K Clr K Clr K Clr
Q
T Q T Q
A B (A) 100 MHz (B) 10 MHz
Clk Q Clk Q
(C) 1 GHz (D) 10 GHz
Practice Problems 2 4. Figure below shown as ripple counter using positive edge
Directions for questions 1 to 30: Select the correct alterna- triggered flip-flops. If the present state of the counters is
tive from the given choices. Q2 Q1 Q0 = 011, then its next state (Q2Q1Q0) will be
1. Match List 1 (operation) with List 2 (associated device) 1 1 1
and select the correct answer using the codes given T0 Q0 T1 Q1 T2 Q2
below:
List 1 List 2 Clk Q0 Q1 Q2
(a) Frequency Ddivision (1) ROM
(b) Decoding (2) Multiplexer (A) 010 (B) 100
(c) Data selection (3) Demultiplexer (C) 111 (D) 101
(d) Code conversion (4) Counter
5. A synchronous sequential circuit is designed to detect
a bit sequence 0101 (overlapping sequence include).
(A) a–3, b–4, c–2, d–1
Every time, this sequence is detected, the circuit pro-
(B) a–3, b–4, c–1, d–2
duces output of 1. What is the minimum number of
(C) a–4, b–3, c–1, d–2
states the circuit must have?
(D) a–4, b–3, c–2, d–1
(A) 4 (B) 5
2. A MOD-5 synchronous counter is designed by using (C) 6 (D) 7
JK flip-flop, the number of counts skipped by it will be
6. What is represented by digital circuit given below?
(A) 2 (B) 3
(C) 5 (D) 0
3. A counter starts off in the 0000 state, then clock D Q
pulses are applied. Some time later the clock pulses A
are removed and the counter flip-flops read 0011. How
B
many clock pulses have occurred?
Q
(A) 3 (B) 35
(C) 51 (D) Any of these
Chapter 4 • Sequential Circuits | 1.75
19. For a D.FF input, the s Q is connected. What would be 25. A divide by 50 counter can be realized by using
the output sequence? (A) 5 no. of MOD-10 counter
(A) 0000 (B) 1111 (B) 10 no. of MOD-5 counter
(C) 010101 (D) 101010 (C) One MOD-5 counter followed by one MOD-10
counter
20. In order to implement a MOD-6 synchronous counter (D) 10 no. of MOD-10 counter
we have 3 FF and a combination of 2 input gate(s).
26. The following latch is
Identify the combination circuit.
(A) One AND gate
(B) One OR gate X S Q
(C) One AND and one OR gate
Clk
(D) Two AND gates
21. Given a MOD-5 counter. The valid states for the coun- R Q
ter are (0, 1, 2, 3, 4). The propagation delay of each FF
is TF and that of AND gate is tA. The maximum rate at
which counter will operate satisfactorily (A) D latch (B) T latch
(C) JK latch (D) RS latch
27. Which of the following represent a 3-bit ripple counter
J0 Q0 J1 Q1 J2 Q2 using D FF?
1 K0 Q0 K1 Q1 1 K2 Q2 (A)
D1 Q1 D2 Q2 D3 Q3
Clk Clk Q1 Q2 Q3
1 1
(A) (B) (B)
tF + t A 3t F
D1 Q1 D1 Q2 D3 Q3
1 1 Clk
(C) (D) Q1 Q2 Q3
2t F + t A 3t F − t A
(C) Both (A) and (B)
22. For a NOR latch as shown up A and B are made first (D) None of these
(0, 1) and after a few seconds it is made (1, 1). The cor-
responding output (Q1, Q2) are 28. For the Johnson counter with initial Q2, Q1, Q0 as 101,
the frequency of the output is (Q2, Q1, Q0)
A Q1
J2 Q 2 J 1 Q1 J0 Q0
K2 Q2 K1 Q1 K0 Q0
B Q2
f
The counter is connected as follows:
(A) D D Q
Q
A4 A3 A2 A1
Clk
(B) f D Q D Q
Clk Count = 1
4-bit counter Load = 0
Clear Clock
(C) f D Q D Q Inputs
Clk
0 0 1 1
1.78 | Unit 1 • Digital Logic
Assume that the counter and gate delays are negligi- (A) 000 (B) 001
ble. If the counter starts at 0, then it cycles through the (C) 010 (D) 011
following sequence: [2007]
(A) 0, 3, 4 (B) 0, 3, 4, 5 9. Let K = 2n. A circuit is built by giving the output of an
(C) 0, 1, 2, 3, 4 (D) 0, 1, 2, 3, 4, 5 n-bit binary counter as input to an n-to-2n-bit decoder.
This circuit is equivalent to a [2014)
5. In the sequential circuit shown below, if the initial (A) K-bit binary up counter
value of the output Q1Q0 is 00, what are the next four (B) K-bit binary down counter
values of Q1Q0? [2010] (C) K-bit ring counter
(D) K-bit Johnson counter
10.
1 T Q T Q
Clock
J Q2 J Q1 J Q0
C C C
K Q2 K Q1 K Q0
Q0 Q1
(A) 11, 10, 01, 00 (B) 10, 11, 01, 00 The above synchronous sequential circuit built using
(C) 10, 00, 01, 11 (D) 11, 10, 00, 01 JK flip-flops is initialized with Q2Q1Q0 = 000. The
state sequence for this circuit for the next 3 clock
6. The minimum number of D flip-flops needed to
cycles is [2014]
design a MOD-258 counter is [2011]
(A) 001, 010, 011 (B) 111, 110, 101
(A) 9 (B) 8
(C) 100, 110,111 (D) 100, 011, 001
(C) 512 (D) 258
11. Consider a 4-bit Johnson counter with an initial value
Common Data for Questions 7 and 8: Consider the fol-
of 0000. The counting sequence of this counter is
lowing circuit involving three D-type flip-flops used in a
[2015]
certain type of counter configuration.
(A) 0, 1, 3, 7, 15, 14, 12, 8, 0
(B) 0, 1, 3, 5, 7, 9, 11, 13, 15, 0
(C) 0, 2, 4, 6, 8, 10, 12, 14, 0
P
D Q (D) 0, 8, 12, 14, 15, 7, 3, 1, 0
Clock Q 12. A positive edge-triggered D–flip-flop is connected
to a positive edge-triggered JK flip-flop as follows.
Q
The Q output of the D flip-flop is connected to both
D Q the J and K inputs of the JK flip-flop, while the Q
output of the JK flip-flop is connected to the input
Clock Q
of the D flip-flop. Initially, the output of the D flip-
flop is set to logic one and the output of the JK flip-
R flop is cleared. Which one of the following is the bit
D Q
sequence (including the initial state) generated at the
Clock Q Q output of the JK flip-flop when the flip-flops are
connected to a free-running common clock? Assume
that J = K = 1 is the toggle mode and J = K = 0 is the
7. If all the flip-flops were reset to 0 at power on, what state-holding mode of the JK flip-flop. Both the flip-
is the total number of distinct outputs (states) repre- flops have non-zero propagation delays.[2015]
sented by PQR generated by the counter?[2011] (A) 0110110… (B) 0100100…
(A) 3 (B) 4 (C) 011101110… (D) 011001100…
(C) 5 (D) 6
13. The minimum number of JK flip-flops required to
8. If at some instance prior to the occurrence of the clock construct a synchronous counter with the count
edge, P, Q, and R have a value 0, 1, and 0, respec- sequence (0, 0, 1, 1, 2, 2, 3, 3, 0, 0, …) is ______
tively, what shall be the value of PQR after the clock [2015]
edge?[2011]
Chapter 4 • Sequential Circuits | 1.79
14. We want to design a synchronous counter that counts 16. The next state table of a 2-bit saturating up-counter is
the sequence 0-1-0-2-0-3 and then repeats. The mini- given below.
mum number of J-K flip-flops required to implement
this counteris _____ . [2016] Q1 Q0 Q1+ Q0+
0 0 0 1
15. Consider a combination of T and D flip-flops con-
nected as shown below. The output of the D flip-flop 0 1 1 0
is connected to the input of the T flip-flop and the out- 1 0 1 1
put of the T flip-flop is connected to the input of the D 1 1 1 1
flip-flop.
The counter is built as a synchronous sequential cir-
cuit using T flip-flops. The expressions for T1 and
T0are [2017]
Q1 Q0 (A) T1 = Q1Q0, T0 = Q1 Q 0
T
D
Filp-
Filp-
Flop
Flop (B) T1 = Q1Q0, T0 = Q1 + Q 0
(C) T1 = Q1 + Q0, T0 = Q1 + Q 0
Clock
(D) T1 = Q1Q0, T0 = Q1 + Q0
17. Consider the sequential circuit shown in the figure,
Initially, both Q0 and Q1 are set to 1 (before the 1st where both flip-flops used are positive edge-triggered
clock cycle). The outputs [2017] D flip-flops.
(A) Q1 Q0 after the 3rd cycle are 11 and after the 4th
cycle are 00 respectively
(B) Q1 Q0 after the 3rd cycle are 11 and after the 4th in out
cycle are 01 respectively
D Q D Q
(C) Q1 Q0 after the 3rd cycle are 00 and after the 4th Clock
cycle are 11 respectively
(D) Q1 Q0 after the 3rd cycle are 01 and after the 4th
cycle are 01 respectively The number of states in the state transition diagram of
this circuit that have a transition back to the same state
on some value of “in” is ______. [2018]
Answer Keys
Exercises
Practice Problems 1
1. B 2. A 3. A 4. B 5. C 6. A 7. C 8. A 9. B 10. A
11. C 12. B 13. B 14. C 15. D 16. B 17. A 18. D 19. A 20. C
21. D 22. A
Practice Problems 2
1. D 2. B 3. D 4. B 5. A 6. C 7. C 8. B 9. A 10. B
11. C 12. B 13. C 14. B 15. B 16. D 17. C 18. C 19. C 20. D
21. C 22. A 23. D 24. B 25. C 26. A 27. A 28. C 29. C 30. A