Digital
Digital
Digital
Digital Circuits
Vishesh Agrawal
(M.Tech VLSI)
(IIT Kharagpur)
1
GATE THE Direction Digital Circuits
CONTENTS
CHAPTER I LOGIC GATES 3
2
GATE THE Direction Logic Gates
CHAPTER I
LOGIC GATES
INTRODUCTION
Everything in the digital world is based on the binary number system. Numerically, this
involves only two symbols: 0 and 1. Logically, we can use these symbols or we can equate them
with others according to the needs of the moment. Thus, when dealing with digital logic, we
can specify that: 0 =low = false = no
Using this two-valued logic system, every statement or condition must be either "true"
or "false;" it cannot be partly true and partly false. While this approach may seem limited, it
actually works quite nicely, and can be expanded to express very complex relationships and
interactions among any number of individual conditions.
If logic ‘1’ represent by higher voltage than logic ‘0’ then its called as positive logic
representation.
If logic ‘0’ represent by higher voltage than logic ‘1’ then its called as negative logic
representation.
Truth Table:
The table contain all possible combination of inputs and corresponding outputs called as truth
table.
3
GATE THE Direction Logic Gates
LOGIC GATES
The flow of digital signals is controlled by transistors in various configurations depending
on the logic family. For most purposes we can imagine that the logic gates are composed of
ideal switches with just two states: OPEN and CLOSED. The state of a switch is controlled by a
digital signal. The switch remains closed so long as a logical 1 (high) signal is applied and switch
is open as logical 0 (low) signals is applied. Logic signals interact by means of gates. The three
fundamental gates AND, OR, and NOT, are named after the three fundamental operations of
logic that they carry out. The AND and OR gates each have two or more inputs and one output.
The output state is determined by the states of the inputs. The function of each gate is defined
by a truth table. The logic gates are:
1. NOT Gate
2. AND Gate
3. OR Gate
4. Exclusive-OR Gate
5. Exclusive-NOR Gate
6. NAND Gate
7. NOR Gate
1. Not Gate: This operation changes a logic level by its complementary i.e. 1 become 0 and 0
become 1. A NOT gate is also called an ‘inverter’.
A Q= A’
0 1
1 0
Propagation delay (tp): Practically the output of the gate is come after some delay called as
propagation delay.
Ex. Find the output waveform of output Y of following diagram if propagation delay of inverter
is tp.
4
GATE THE Direction Logic Gates
Solution: The output will be flip (1<---> 0) between 0 and 1 after every tp time as shown below:
2. AND Gate: The AND Gate operation is performed like multiplication of 1s and 0s. If all inputs
are 1 (high) then only output is 1 (high) otherwise output is 0 (low).
A B Q=A.B
0 0 0
0 1 0
1 0 0
1 1 1
1. 2.
3. 4.
TTL IC’s of AND gates: The IC 7408 contains four two inputs AND gates, IC 747411
contain three 3 inputs AND gates, IC 7421 contains two 4 inputs AND gates.
5
GATE THE Direction Logic Gates
3. OR Gate: The OR Gate operation is performed like addition of 1s and 0s. If all inputs are 0
(low) then only output is 0 (low), all other cases output is 1 (high).
Truth table: Symbol: Using NAND Gate
A B Q=A+B
0 0 0
0 1 1
1 0 1
1 1 1
1. 2.
3. 4.
4. NAND Gate: The NAND Gate operation output is 0 (low) when all inputs are 1 (high), All
other cases output is 1 (high).
A B Q=(A.B)’
0 0 1
0 1 1
1 0 1
1 1 0
6
GATE THE Direction Logic Gates
NAND & NOR gate is universal gate since any Boolean expression (any gate) can be
construct by only NAND gate.
i. Inverter:
ii. AND:
iii. OR:
iv. NOR:
v. XOR:
7
GATE THE Direction Logic Gates
vi. XNOR:
1. Write the boolean expression in reduce SOP form and construct logic diagram by AND –
OR gates.
2. For AND gate apply bobble at output and one inverter in series to compensate the effect
of the bubble.
3. For OR gate apply bubble at the input side and inverter in series to compensate the
effect of the bubble.
4. If two inverter in series then neglect them (construct inverter by single NAND gate)
Ex.1: How many two input NAND gate require for boolean function f(A,B,C)=ABC
Solution:
After step 1:
After step 4:
8
GATE THE Direction Logic Gates
Ex. 2: Find the number of minimum two input NAND gate require to construct boolean function
f(A,B,C) = (A+B)(B+C)
Solution:
Their fore for the construction of f(A,B,C)=(A+B)(B+C), we require minimum 3 two input NAND
gates.
5. NOR Gate: The NOR Gate operation output is 1 (high) when all inputs are 0 (low), All other
cases output is 0 (low).
A B Q=(A+B)’
0 0 1
0 1 0
1 0 0
1 1 0
i. Inverter:
9
GATE THE Direction Logic Gates
ii. AND:
iii. OR:
iv. XOR:
v. XNOR:
10
GATE THE Direction Logic Gates
1. Write the boolean expression in reduce POS form and construct logic diagram by OR -
AND gates.
2. For AND gate apply bobble at input and inverter in series to compensate the effect of
the bubble.
3. For OR gate apply bubble at output side and inverter in series to compensate the effect
of the bubble.
4. If two inverter in series then neglect them (construct inverter by single NOR gate)
Ex.1: Find the number of minimum two input NAND gate require to construct boolean function
f(A,B,C) = (A+B)(B+C)
Solution:
6. XOR Gate: The XOR Gate operation output is 1 (high) when odd numbers of inputs are 1
(high), otherwise output is 0 (low).
A B Q=A B
0 0 0
0 1 1
1 0 1
1 1 0
11
GATE THE Direction Logic Gates
Equivalent:
Examples:
1. What is output Q?
Here one input to XOR gates is logic ‘1’, so these gates are acts as inverter. Suppose Q1, Q2 are
outputs of first, second output and goes on then
So Q50 = Q = A.
2. What is output Q?
So Q50 = Q = 1.
12
GATE THE Direction Logic Gates
7. XNOR Gate: For two input XNOR Gate operation output is 1 (high) when both the inputs are
same, otherwise output is 0 (low).
A B Q=AʘB
0 0 0
0 1 1
1 0 1
1 1 0
Act as inverter if one input is logic 0.
Act as buffer if one input is logic 1.
Output of even number of fan-in (input) XOR and XNOR gates are complement to each
other if inputs are same.
Output of odd number of fan-in (input) XOR and XNOR gates are same to each other if
inputs are same.
Truth table for two (even) fan-in XOR and XNOR gates
A B A B AʘB
0 0 0 1
0 1 1 0
1 0 1 0
1 1 0 1
A B C A B C AʘBʘC
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 0
1 0 0 1 1
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
13
GATE THE Direction Logic Gates
NOTE:
A B’ = A’ B = (A B )’ = A ʘ B.
(A B C)=(AʘBʘC)
NAND and NOR Gate are universal Gate because by using only NAND or NOR Gate only
we can construct any Boolean logic (other logic Gates). Number of NAND and NOR Gate
require to formation of other Gates.
Logic Gate No. of NAND Gate require No. of NOR Gate require
NOT 1 1
AND 2 3
OR 3 2
NAND 1 4
NOR 4 1
XOR 4 5
XNOR 5 4
14
GATE THE Direction Logic Gates
Problems:
1) How many 2-input NOR Gate require to design 2-input XOR gate
A) 3 B) 4 C) 5 D) none
2) How many 2 input NAND gate require for following logic expression Y= AB’C’
A) 4 B) 5 C) 6 D) 7
3) How many 2 input NAND gate require to construct logic expression ABC’+ABC
A) 1 B) 2 C) 3 D) 8
A) 3 B) 4 C) 5 D) 6
A) A’ B) A C) 0 D) Data insufficient
A) 1 B) 2 C) 3 D) both A and C
9) Find out Y
15
GATE THE Direction Logic Gates
A) 1 B) 0 C) A XOR B D) none
10) The output of a logic gate is 1 when all its inputs are at logic 0. the gate is either
11) The logic circuit shown in the given figure can be minimised to
A) 1 B) 0 C) X D) X’
14) Output Y of the circuit shown in figure is equal to
16
GATE THE Direction Logic Gates
16) How many two inputs X-NOR gates are required to implement three inputs X-NOR gate?
A) 1 B) 2 C) 3 D) 4
17) If AB’ + A’B= Y, then BY’ + B’Y is
A) A B) B C) Y’ D) 0
18) A B A’ is
A) 0 B) B C) B’ D) A
19) The number of minimum 2-inputs NAND gate require to implement A + AB’ + ABC’ is
A) 0 B) 1 C) 4 D) 7
20) If A.B = 0, then A B is
A) A’ + B’ B) 1 C) 0 D) A + B
21) A Boolean function of two variables A and B is define as f(0,0) = f(1,0) = f(1,1) =1 and
f(0,1)=0. The minimum cost solution for realization of f(A,B) by using NOR and OR gates
only. Assume cost of both the gate is one unit and complement of A and B are not
available.
A) 1 unit B) 2 unit C) 3 unit D) 4 unit
22) What are A,B,C respectively, so output Q become zero
A) 0, 1, 0 B) 1, 0, 1 C) 1, 1, 0 D) All
17
GATE THE Direction Logic Gates
A) 0 B) A’ C) C D) A’ + C’
24) Find the minimum number of 2-input NAND gate require for implementation of following
logic function
A) 2 B) 3 C) 4 D) 5
25) Find the frequency of square wave generated by following circuit if propagation delay of
each inverter is 20 ns.
Answers
1. C 2. C 3. B 4. B 5. A 6. A 7. A 8. D 9. C
10. D 11. D 12. B 13. A 14. D 15. C 16. B 17.A 18.C
19.A 20.D 21.B 22.D 23.C 24.B 25.C 26.A
18
GATE THE Direction Boolean Algebra
CHAPTER II
BOOLEAN ALGEBRA
Why Boolean simplification:
Boolean algebra finds its most practical use in the simplification of logic circuits. If we
translate a logic circuit's function into symbolic (Boolean) form, and apply certain algebraic
rules to the resulting equation to reduce the number of terms and/or arithmetic operations,
the simplified equation may be translated back into circuit form for a logic circuit performing
the same function with fewer components. If equivalent function may be achieved with fewer
components, the result will be increased reliability and decreased cost of manufacture.
Boolean algebra:
The algebra that can be done with binary states (0 and 1) and the operation perform by logic
gates known as Boolean algebra.
• Associative laws: a) A + (B + C) = (A + B) + C
b) A (BC) = (AB) C
• Distributive law: A (B + C) = AB + AC
1. A + 0 = A 7. A.A = A
2. A + 1 = 1 8. A.A’ = 0
3. A.0 = 0 9. (A’)’ = A
4. A.1 = A 10. A + AB = A
5. A + A = A 11. A + A’B = A + B
6. A + A’ = 1 12. (A + B)(A + C) = A + BC
b) (AB)’ = A’ + B’
19
GATE THE Direction Boolean Algebra
Both these forms are known as Canonical forms i.e. each term contain all the variables.
1. SOP:
Sum-Of-Products, or SOP, Boolean expressions may be generated from truth tables
quite easily, by determining which rows of the table have an output of 1, writing one product
term (minterm) for each row has output logic ‘1’ and finally summing all these product terms.
This creates a Boolean expression representing the truth table as a whole Sum-Of-Products
expressions lend themselves well to implementation as a set of AND gates (products) feeding
into a single OR gate (sum).
In SOP form each individual term is known as minterm and expression is written as sum of
minterm.
In SOP representation AND functions are followed by an OR function.
In SOP form, any variable, A represent as logic 1 (high) and A’ represented as 0 (low).
Therefore, Q= A’B’+AB’
20
GATE THE Direction Boolean Algebra
2. POS:
Product-Of-Sums, or POS, Boolean expressions may also be generated from truth tables quite
easily, by determining which rows of the table have an output of 0, writing one sum term for
each row, and finally multiplying all the sum terms. This creates a Boolean expression
representing the truth table as a whole. Product-Of-Sums expressions lend themselves well to
implementation as a set of OR gates (sums) feeding into a single AND gate (product).
In POS each individual term is called as maxterm and expression is represented as product
of maxterm.
In POS form, any variable A represent as logic 0 (low) and A’ represented as 1 (high).
Ex. Represent following truth table in standard SOP and POS form
A B C f(A,B,C)
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 0
21
GATE THE Direction Boolean Algebra
Solution:
SOP: Addition of minterms for which output is logic ‘1’. Here output is logic ‘1’ for following
input combination of A, B and C: (010)2 ---> (2)10, (100)2 --->(4)10, (101)2--->(5)10. So
standard SOP is represented as:
𝒇= 𝒎{𝟐, 𝟒, 𝟓}
POS: Multiplication of maxterms for which output is logic ‘0’. Here output is logic ‘0’ for
following input combination of A, B and C: (000)2 ---> (0)10, (001)2 --->(1)10, (011)2--->(3)10, (110)2
--->(6)10, (111)2--->(7)10 So standard POS is represented as:
𝒇= 𝑴{𝟎, 𝟏, 𝟑, 𝟔, 𝟕}
From above we conclude that for the same truth table (i.e. sane Boolean function) The
term contain in standard POS form are the all possible term except the term presents in
standard SOP and vice versa.
Each individual term in standard Sum Of Products form is called as minterm whereas
The unbarred letter represent 1’s and the barred letter represent 0’s in min terms,
whereas the unbarred letter represent 0’s and the barred represent 1’s in maxterms.
Where the represents the sum and ‘m’ stands for minterms.
Therefore Y = A’B’C + A’BC + AB’C + ABC (The sum of all above min term)
22
GATE THE Direction Boolean Algebra
Ex. Write the given Boolean function f(A,B,C,D)= 𝑚{0,4,5,6,7,9,10,12,13} in POS form
Solution: In POS form contain the term which are absent in SOP form.
Formation of standard SOP form: In SOP form if any variable is absent in any product term then
multiply that product term with (x + x’), where ‘x’ is the missing variable.
Ex. f(A,B,C) = AB + BC, given Boolean function f(A, B, C) write down in standard SOP form
Solution: In first product term ‘AB’ the variable ‘C’ is missing so multiply it with (C + C’) and in
second product term ‘BC’ the variable ‘A’ is missing so multiply it with (A + A’)
Formation of standard POS form: In POS form if any variable is absent in any sum term then
add that sum term with (xx’), where ‘x’ is the missing variable.
Ex. f(A,B,C) = (A + B) (B + C), given Boolean function f(A, B, C) write down in standard POS form
Solution: In first sum term ‘(A + B)’ the variable ‘C’ is missing so add it with (CC’) and in second
sum term ‘(B + C)’ the variable ‘A’ is missing so add it with (AA’)
23
GATE THE Direction Boolean Algebra
= ( A + B + C) (A + B + C’) (A + B + C) (A’ + B + C)
Ex. How many different Boolean function can be possible by using 5-variable.
𝒏 𝟓
Solution: 𝟐𝟐 = 𝟐𝟐 = 232
Dual Expression: Dual expression is equivalent to writing negative logic for given positive logic.
In dual expression:
Self dual function: Some function have their dual expression same as original function. These
function called as self dual function.
Ex: Q=AB+BC+CA its dual as Qd=(A+B)(B+C)(C+A) after simplification it will give same as Q.
24
GATE THE Direction Boolean Algebra
The groups generated are then converted to a Boolean expression by: locating and
transcribing the variable possibility attributed to the box, and by the axiom laws of Boolean
algebra in which if the (initial) variable possibility and its inverse are contained within the same
group the variable term is removed. Each group provides a “product” to create a reduce “sum-
of-products” in the Boolean expression.
For SOP:
For POS:
25
GATE THE Direction Boolean Algebra
Solution:
26
GATE THE Direction Boolean Algebra
Solution:
Solution:
Ex. Minimize the given Boolean function f(A,B,C,D) = 𝑀{0,1,9,10,11,14} in POS and SOP form
27
GATE THE Direction Boolean Algebra
Fig. a Fig. b
Don’t care are only used to make the pair quad etc. If all the minterm or maxterm can be
covered by making pair without using don’t care term then we should not use don’t care term.
As shown in fig. a and fig. b both have same pairing even in fig. b there’s extra don’t care is
available.
28
GATE THE Direction Boolean Algebra
Solution:
For k- map in fig. a use don’t care as one because it increase the numbers of one in group.
For k- map in fig. b use don’t care as zero because it increase the numbers of group.
Ex. Minimize the given Boolean function f(A,B,C,D) = 𝑚(0,1,2,6,11,12) + 𝑑{5, 7,8}.
Solution:
Implicants (I): All minterm of k-map are called implicants. ie. numbers of ‘1’ in k-map is nothing
but numbers of implecants.
Prime Implicant (PI): The all the product term in any reduced expression of k-map are called as
prime Implicant.
Essential prime Implicant (EPI): Prime Implicant which is present in all reduce expression is
called essential prime Implicant.
29
GATE THE Direction Boolean Algebra
Selective prime Implicant (SPI): The prime implicant rather than Essential prime implicant are
called as selective prime implicant.
Ex. Find the implicant, PI, EPI and literal for f(A,B,C) = 𝑚{0,2,4,5,7} .
Solution:
AB A’C’ B’C’ C AB
C 1 1 1 1 1 1
1 1 1 1
AC
1. Here number of minterm in k-map is 5 so number of Implicants are 5. These are A’B’C’,
A’BC’, AB’C’, ABC, AB’C.
2. Here 4 different reduce combinations are possible so numbers of prime Implicants are also
4. These are A’C’, AB’, B’C’, AC.
3. Here two prime Implicants are common in both output expression of ‘Q’, so essential
prime Implicants are 2. There are A’C’ and AC.
4. Here total 6 variable or their compliment present in both of the expression so number of
literal are 6.
K-map may have different reduce solution for the given function (In the above
example we having 2 different solution.) i.e. k-map solution not necessary to always
unique.
Note:
𝒏
With N variable, maximum possible distinct Boolean function can be made are 𝟐𝟐
𝒏−𝟏
With N variable, maximum possible self dual function is 𝟐𝟐
30
GATE THE Direction Boolean Algebra
Problems:
1) How many self dual Boolean functions will possible for 3 variable functions?
A) 16 B) 3 C) 256 D) none
2) Reduce the k-map
A) A+ B’ + D’ B) A + B +D’ C) A + B’ + D D) B’ + D’
A) A B) 1 C) 0 D) BC
8) In 5- variable k-map how many literals will present in prime Implicant form by group of
four 1’s
A) 1 B) 2 C) 3 D) 4
9) The output of logic circuit is HIGH only when A and B both are low and C and D both are
high. Then output logic function is
A) (AB)’+CD B) (AB)’CD C) (A’B’)+CD D) (A’B’)CD
10) Reduce the logic expression AB+A’B+AB’+A’B’
A) A B) B C) 1 D) 0
11) Write following logic expression in canonical form XY+XYZ+XYZ’
A) XYZ+XYZ’ B) XY C) XYZ+XYZ’+XY’Z D) Z
31
GATE THE Direction Boolean Algebra
A) p = x⨁y⨁z B) p = x⨁y⨁z
C) p = x y⨁z + x(y⨁z) D) both A and B
23) The Boolean expression (A+B)(A’+B’) is equivalent to a two-input
A) NAND gate B) NOR gate C) X-OR gate D) X-NOR gate
24) The total number of Boolean function that can be constructed for n Boolean variables is
32
GATE THE Direction Boolean Algebra
𝑛
A) n B) 2n C) (2n)n D) 22
25) Number of product terms in the minimized sum of product expression obtained through
the following K map is
00 01 11 10
00 1 0 0 1
01 0 X 0 0
11 0 0 X 1
10 1 0 0 1
A) 2 B) 3 C) 4 D) 5
f(A,B,C,D,E)= (A’+B+C’)(A’+B+C)(C+D)(C+D+E)
C) (A’+B)(C+D)(C+D+E) D)(A’+B)(C+D+E)
A) (A+B+C +D’) + (A+B’+C’ +D) + (A+B’+C’ +D’) B) (A+B+C +D’)(A+B’+C’ +D)(A+B’+C’ +D’)
33
GATE THE Direction Boolean Algebra
C) (A’+B’+C’ +D) + (A’+B+C +D’) + (A’+B+C +D) D) (A’+B’+C’ +D)(A’+B+C +D’)(A’+B+C +D)
37) The dual of the complement of a certain Boolean expression is given by ABC +D’E +BC’E.
Answers:
1. A 2. D 3. B 4. A 5. B 6. A 7. B 8. C 9. D
10. C 11. A 12. B 13. B 14. A 15. D 16. C 17. A 18. C
19. C 20. D 21. B 22. D 23. C 24. D 25. A 26. C 27. D
28. D 29. B 30. A 31.A 32. B 33. D 34. A 35.B 36.C
37.A
34
GATE THE Direction Number system
CHAPTER III
NUMBER SYSTEM
NUMBER SYSTEMS
The base or radix ‘r’ of the number system is representing the number of different symbol
used in that number system.
Using ‘n’ digit in number system of radix ‘r’ we can make rn different number.
n=1 total different possible number are 101 i.e. 10 there are 0 to 9.
n=2 total different possible number are 102 i.e. 100 there are 00 to 99.
The number system having base-r and n digits, the value of that number in decimal is calculated
as: (An-1……..A2A1A0)r = (An-1×rn-1) +…… +(A2×r2 ) + (A1×r1 ) +(A0×r0 ).
Binary numbers:
Binary number has radix 2 therefore it use 2 symbols namely 0 and 1. It is represented as:
(abc)2 = a × 22 + b × 21 + c × 20
Each digit is known as a bit and can take only two values 0 and 1. The left most bit is the
Highest-order bit and represent the most significant bit (MSB) while the lowest-order bit is the
least significant bit (LSB).
Solution:
35
GATE THE Direction Number system
r’s compliment of any number N having base ‘r’ and number of digits ‘n’ is given by
rn –N (Answer is in decimal).
r’s complicate = (r-1)’s complicate + 1
Solution:
1-complement
The 1-complement of a binary number is obtained just changing each 0 to 1 and each 1 to 0:
Binary number 1 0 1 1 1 0 1 0
↓↓↓↓↓↓↓↓
1-complement 0 1 0 0 0 1 0 1
2- complement:
See from the left side and write down the digit as it is till first 1’s come and after that start
replacing 0’s to 1 and 1’s to 0.
2. 1’s compliment
3. 2’s compliment
36
GATE THE Direction Number system
In sign magnitude representation MSB bit is use for representing the sign of the number (‘0’
indicate ‘+’ number and ‘1’ indicate negative number) and other bits are used to represent the
magnitude of the number.
2. 1’s compliment:
3. 2’s compliment:
Sign magnitude and 1’s compliment representation assign different value for 0 and -0,
But 2’s compliment assign same value for 0 and -0 so that 2’s compliment
representation use in the processing unit.
1’s compliment and sign magnitude range from – (2n-1 -1) to (2n-1 -1).
2’s compliment range from – 2n-1 to (2n-1 -1).
Range of 2’s compliment is one more than 1’s compliment and sign magnitude because
it has only one representation for 0.
For all the representation (sign magnitude, 1’s compliment and 2’s compliment) the
MSB is ‘1’ for negative number and ‘0’ for positive number.
1’s compliment of 1’s compliment of any number is same number
2’s compliment of 2’s compliment of any number is same number
37
GATE THE Direction Number system
Ex. 1: X = 0101 and Y = 1001 are two 4-bit binary numbers represented in two’s complement
format. The sum of X and Y represented in two’s complement format using 5 bits is
Solution:
1. Convert the given number in decimal form X= (0101)2 = (5)10 and Y = (1001)2 = (-7)10
2. Perform the given operation X + Y = 5-7 = (-2)10
3. Convert back the result in 2’s compliment form. (-2)10 = (11110)2
Ex. 2: X = 11101 and Y = 11001 are two 5-bit binary numbers represented in two’s complement
format. Find (X-Y) and represented in two’s complement format using 6 bits is
Solution:
1. Convert the given number in decimal form X= (11101)2 = (-3)10 and Y = (11001)2 = (-7)10
2. Perform the given operation X - Y = (-3) – (-7) = (4)10
3. Convert back the result in 2’s compliment form. (4)10 = (000100)2
Conversion
Binary-to-Decimal Conversion
The decimal equivalent of the binary number (1101.0101)2 is determined as follows:
38
GATE THE Direction Number system
Octal-to-Decimal Conversion
The decimal equivalent of the octal number (721.25)8 is determined as follows:
Hexadecimal-to-Decimal Conversion
The decimal equivalent of the hexadecimal number (CAB.2F)16 is determined as follows:
Decimal-to-Binary Conversion
For the integer part, the binary equivalent can be found by successively dividing the
integer part of the number by 2 and recording the remainders until the quotient becomes ‘0’.
The remainders written in reverse order constitute the binary equivalent. For the fractional
part, it is found by successively multiplying the fractional part of the decimal number by 2 and
recording the carry until the result of multiplication is ‘0’. The carry sequence written in forward
order constitutes the binary equivalent of the fractional part of the decimal number. If the
result of multiplication does not seem to be heading towards zero in the case of the fractional
part, the process may be continued only until the requisite number of equivalent bits has been
obtained. This method of decimal–binary conversion is popularly known as the double-dabble
method.
39
GATE THE Direction Number system
2 15 —
2 7 1
2 3 1
2 1 1
— 0 1
Decimal-to-Octal Conversion
The process of decimal-to-octal conversion is similar to that of decimal-to-binary
conversion. The progressive division in the case of the integer part and the progressive
multiplication while working on the fractional part here are by ‘8’ which is the radix of the octal
number system. Again, the integer and fractional parts of the decimal number are treated
separately.
40
GATE THE Direction Number system
8 77 —
8 9 5
8 1 1
— 0 1
Decimal-to-Hexadecimal Conversion
The process of decimal-to-hexadecimal conversion is also same. Since the hexadecimal number
system has a base of 16, the progressive division and multiplication factor in this case is 16.
16 95 —
16 5 15 i.e. F
— 0 5
41
GATE THE Direction Number system
number system is 8 and it is the third power of the base of the binary number system, i.e. 2. All
we have then to remember is the three-bit binary equivalents of the basic digits of the octal
number system. A binary number can be converted into an equivalent octal number by splitting
the integer and fractional parts into groups of three bits, starting from the binary point on both
sides. The 0s can be added to complete the outside groups if needed.
Solution:
• Any 0s on the extreme left of the integer part and extreme right of the fractional part of the
equivalent binary number can be omitted. Therefore, (001011110.010111)2 =
(1011110.010111)2
• (1110100.0100111)2
= (164.234)8
Solution:
• (11010001.0101011)2 = (11 010 001.010 101 1)2 = (011 010 001.010 101 100)2 = (321.254)8
42
GATE THE Direction Number system
Solution
• The 0s on the extreme left of the integer part and on the extreme right of the fractional part
can been omitted so (000111111011.101011001100)2 = (111111011.1010110011)2
•(11011001110.0110111011)2 =(110 1100 1110.0110 1110 11)2 = (0110 1100 1110.0110 1110
1100)2 = (6CE.6EC)16
Solution
• The binary equivalent = (0001 1111.1011 0100)2 = (011 111.101 101)2 = (37.55)8
• The octal number (734.641)8 = (111 011 100.110 100 001)2 = (0001 1101 1100.1101 0000
1000)2 =(1DC.D08)16
43
GATE THE Direction Number system
Ex. The 7’s complement of a certain octal number is 1354. Determine the binary and
hexadecimal equivalents of that octal number.
Solution
• The 7’s complement is (1354)8 , Therefore, the octal number is (7777)8 - (1354)8 = (6423)8
1. Begin with the most significant bit (MSB) of the binary number. The MSB of the Gray
code equivalent is the same as the MSB of the given binary number.
2. The second most significant bit, adjacent to the MSB, in the Gray code number is
obtained by XOR of MSB and the second MSB of the binary number.
3. The third most significant bit, adjacent to the second MSB, in the Gray code number is
obtained by XOR of second MSB and the third MSB in the binary number
4. The process continues until we obtain the LSB of the Gray code number by the XOR of
the LSB and the next higher adjacent bit of the binary number.
5. Let an n-bit binary number Bn-1 Bn-2…… B0 and its equivalent gray code is Gn-1 Gn-2…… G0,
with Bn-1 and Gn-1 are MSB. The gray code is
Gn-1 = Bn-1. Gn-2 = 𝐁n-1⊕ 𝐁n-2 Gn-3 = 𝐁n-2⊕ 𝐁n-3 ……. G0 = 𝐁1⊕ 𝐁0
The conversion process is further illustrated with the help of an example showing step-by-step
conversion of (1011)2 into its Gray code equivalent:
44
GATE THE Direction Number system
1. Begin with the most significant bit (MSB). The MSB of the binary number is the same as
the MSB of the Gray code number.
2. The bit next to the MSB (the second MSB) in the binary number is obtained by XOR of
the MSB and second MSB in the Gray code number.
3. The third MSB in the binary number is obtained by XOR of MSB to the third MSB in the
Gray code number.
4. The process continues until we obtain the LSB of the binary number.
5. Let an n-bit binary number Bn-1 Bn-2…… B0 and its equivalent gray code is Gn-1 Gn-2…… G0,
with Bn-1 and Gn-1 are MSB. The gray binary code is
Bn-1 = Gn-1. Bn-2 = 𝑮n-1⊕ 𝐆n-2 Bn-3 = 𝑮n-1⊕ 𝐆n-2⊕ 𝐆n-3 ……. B0 = 𝑮n-1⊕ 𝐆n-2 ⊕ 𝐆n-3
……. ⊕ 𝐆1⊕ 𝐆0
The conversion process is further illustrated with the help of an example showing step-by-step
conversion of the Gray code number 1110 into its binary equivalent:
The Gray code is used in the transmission of digital signals as it minimizes the
occurrence of errors.
The Gray code is preferred over the straight binary code in angle-measuring devices.
Use of the Gray code almost eliminates the possibility of an angle misread, which is
likely if the angle is represented in straight binary.
The Gray code is used in Karnaugh maps, a graphical technique used for minimization of
Boolean expressions.
The use of Gray codes to address program memory in computers minimizes power
consumption. This is due to fewer address lines changing state with advances in the
program counter.
Gray codes are also very useful in genetic algorithms
45
GATE THE Direction Number system
BCD-to-Binary Conversion
A given BCD number can be converted into an equivalent binary number by first writing its
decimal equivalent and then converting it into its binary equivalent.
Ex: Find the binary equivalent of the BCD number 0110 0011.0011 1001
Binary-to-BCD Conversion
In the case of unpacked BCD numbers, each four-bit BCD group corresponding to a decimal digit
is stored in a separate register inside the machine. In such a case, if the registers are eight bits
or wider, the register space is wasted.
In the case of packed BCD numbers, two BCD digits are stored in a single eight-bit register. The
process of combining two BCD digits so that they are stored in one eight-bit register involves
shifting the number in the upper register to the left 4 times and then adding the numbers in the
upper and lower registers. The process is illustrated by showing the storage of decimal digits ‘5’
and ‘7’:
• Decimal digit 5 is initially stored in the eight-bit register as: 0000 0101.
46
GATE THE Direction Number system
• Decimal digit 7 is initially stored in the eight-bit register as: 0000 0111.
• After shifting to the left 4 times, the digit 5 register reads: 0101 0000.
• The addition of the contents of the digit 5 and digit 7 registers now reads: 0101 0111.
Ex. How many bits would be required to encode decimal numbers 0 to 9999 in straight binary
and BCD codes? What would be the BCD equivalent of decimal 19 in 16-bit representation?
Solution
• The number of bits required for BCD encoding=16 (as four bit for one decimal digit so sixteen
bit for 4 decimal digits).
Excess-3 Code:
The excess-3 code is another important BCD code. It is particularly significant for arithmetic
operations as it overcomes the shortcomings encountered while using the 8421 BCD code to
add two decimal digits whose sum exceeds 9. The excess-3 code has no such limitation, and it
considerably simplifies arithmetic operations. The excess-3 code for a given decimal number is
determined by adding ‘3’ to each decimal digit in the given number and then replacing each
digit of the newly found decimal number by its four-bit binary equivalent. It may be mentioned
here that, if the addition of ‘3’ to a digit produces a carry, as is the case with the digits 7, 8 and
9, that carry should not be taken forward. The result of addition should be taken as a single
entity and subsequently replaced with its excess-3 code equivalent.
47
GATE THE Direction Number system
Other codes:
Alphanumeric code: These are used to encode the characters of alphabet in addition to the
decimal digits. eg. ASCII, EBCDIC
ASCII code: American standard code for information interchange (ASCII) is widely use
alphanumerical code. It is basically 7-bit code, so number of character can create by 7-bits
are 27 = 128. It is use to encode both upper and lower case alphabets, digits (0 to 9) and
some special symbols.
48
GATE THE Direction Number system
Problems:
1) What will be the decimal equivalent of (456)7
A) (237)10 B) (238)10 C) (236)10 D) Can’t convert
2) What is 5th compliment of (231)6
A) (325)6 B) (325)10 C) (324)6 D) (324)10
3) 2’s compliment representation of + 11 is
A) 10101 B) 01011 C) 00101 D) 11011
4) X = 0111 and Y = 1101 are two 4-bit binary numbers represented in two’s complement
format. The sum of X and Y represented in two’s complement format using 5 bits is
A) 00100 B) 10100 C) 01100 D) 10011
5) A signed integer has been stored in a 8-bit using 1’s complement format. We wish to store
the same integer in 16-bit word. We should copy the original byte to the less significant
byte of the word and fill the more significant byte with
A) 0 B) equal to the MSB of the original byte
C) 1 D) complement of the MSB of the original byte
6) What is addition of (− 60)10 and (60)16 ?
A) (36)10 B) (00)10 C) (36)16 D) (-36)16
7) Which number system used for k-map design
A) Gray code B) Excess 3 code C) binary weighted code D) none
8) 11011, 1011 and 00101 correspond to the 2’s complement representation of following
decimal numbers respectively.
A) 5, 5, 5 B) -5,-5,-5 C) -5,-5, 5 D) 27, 11, 5
9) Find the base x, If (204)x= (123)9.
A) 7 B) 8 C) 9 D) 10
10) The decimal equivalent of the binary number 101101 is
A) 48 B) 45 C) 57 D) 75
11) The octal equivalent of the decimal number 375 is
A) 560 B) 567 C) 565 D) none
12) The octal equivalent of the decimal number 27.125 is
A) 33.23 B) 33.28 C) 33.1 D) 33.01
13) The decimal equivalent of the hexadecimal number 3A.2F is
A) 58.1835 B) 58.1385 C) 58.23 D) none
14) The octal equivalent of the binary number 11010111 is
A) 656 B) 327 C) 653 D) D7
15) The decimal equivalent of hex number 1A53 is
A) 6793 B) 6739 C) 6973 D) 6379
16) The Gray code for decimal number 6 is equivalent to
A) 1100 B) 1001 C) 0101 D) 0110
17) The 2’s complement of the number 1101101 is
A) 0101110 B) 0111110 C) 0110010 D) 0010011
18) -8 is equal to signed binary number
A) 10001000 B) 00001000 C) 10000000 D) 11000000
19) When signed numbers are used in binary arithmetic, then which one of the following
notations would have unique representation for zero.
49
GATE THE Direction Number system
50
GATE THE Direction Number system
Answers:
1. A 2. C 3. B 4. A 5. B 6. A 7. A 8. C 9. A
10. B 11. B 12. C 13. A 14. B 15. B 16. C 17. D 18. A
19. C 20. A 21. B 22. A 23. B 24. A 25. B 26. C 27. B
28. A 29. B 30. D 31. A 32. C 33. D 34. A 35. D 36. A
37. C 38. C 39. C 40. B 41. B 42. A 43. A 44. B 45. A
46. C 47. A 48. A 49. B
51
GATE THE Direction Logic Families
CHAPTER IV
LOGIC FAMILIES
LOGIC FAMILIES
There are a variety of circuit configurations or more appropriately various approaches
used to produce different types of digital integrated circuit. Each such fundamental approach is
called a logic family. The idea is that different logic functions, when fabricated in the form of an
IC with the same approach, or in other words belonging to the same logic family, will have
identical electrical characteristics. These characteristics include supply voltage range, speed of
response, power dissipation, input and output logic levels, current sourcing and sinking
capability, fan-out, noise margin, etc. In other words, the set of digital ICs belonging to the
same logic family are electrically compatible with each other.
Digital IC gates are classified not only by their logic operation, but also by specific logic circuit
family to which they belong. Each logic family has its own basic electronic circuit upon which
more complex digital circuits and functions are developed.
In this the bipolar devices transistors are used and the transistors are going to be saturated.
52
GATE THE Direction Logic Families
1. Schottky TTL
1. PMOS
2. NMOS
NOTE:-
2. The MOS and IIL logic families are used for large scale Integration functions because high
package density.
3. TTL, ECL, CMOS are used for medium scale integration (MSI) or small integration (SSI).
53
GATE THE Direction Logic Families
Characteristic Parameters:
1) Propagation delay (tp):
The propagation delay is the time delay between the occurrence of change in the logical
level at the input and before it is reflected at the output. It is the time delay between the
specified voltage points on the input and output waveforms. Propagation delays are
separately defined for LOW-to-HIGH and HIGH-to-LOW transitions at the output.
Propagation delay tpLH. This is the time delay between specified voltage points on the
input and output waveforms with the output changing from LOW to HIGH.
Propagation delay tpHL. This is the time delay between specified voltage points on the
input and output waveforms with the output changing from HIGH to LOW.
𝒕𝒑𝑳𝑯 + 𝒕𝒑𝑯𝑳
tp = 𝟐
2) Power dissipation:
The power dissipation parameter for a logic family is specified in terms of power
consumption per gate and is the product of supply voltage V CC and supply current ICC. The
supply current is taken as the average of the HIGH-level supply current ICCH and the LOW-
level supply current ICCL.
PD = VCC X ICC(avg) As: ICC(avg) = (ICCH + ICCL )/2
3) Fan-out:
The fan-out is the number of identical inputs of a logic function that can be driven from a
same single output without causing any false output. It is a characteristic of the logic family
to which the device belongs. It can be computed from I OH/IIH in the logic HIGH state and
from IOL/IIL in the logic LOW state. If, in a certain case, the two values I OH/IIH and IOL/IIL are
different, the fan-out is taken as the smaller of the two. This description of the fan-out is
true for bipolar logic families like TTL and ECL. When determining the fan-out of CMOS
logic devices, we should also take into consideration how much input load capacitance can
be driven from the output without exceeding the acceptable value of propagation delay.
Fan-out = min { IOH/IIH , IOL/IIL }
4) Fan-in:
The maximum number of inputs that can be applied to the logic gate.
54
GATE THE Direction Logic Families
5) Noise margin:
This is a quantitative measure of noise immunity offered by the logic family. When the
output of a logic device feeds the input of another device of the same family, a legal HIGH
logic state at the output of the feeding device should be treated as a legal HIGH logic state
by the input of the device being fed. Similarly, a legal LOW logic state of the feeding device
should be treated as a legal LOW logic state by the device being fed.
Figure shows the generalized case of legal HIGH and LOW voltage levels for output (a) and
input (b). As we can see from the two diagrams, there is a disallowed range of output
voltage levels from VOL (max.) to VOH (min.) and an indeterminate range of input voltage
levels from VIL (max.) to VIH (min.). Since VIL (max.) is greater than VOL (max.), the LOW
output state can therefore tolerate a positive voltage spike equal to VIL (max) − VOL (max)
and still be a legal LOW input. Similarly, VOH (min.) is greater than VIH (min.), and the HIGH
output state can tolerate a negative voltage spike equal to VOH (min.) – VIH (min.) and still
be a legal HIGH input.
VOH (min):- It is the minimum voltage level at a logic circuit output in the logic ‘1’ state
under defined load conditions.
VIH (min):- It is the minimum voltage level required for a logical '1' at an input. Any voltage
below this level will not be accepted as a 'High' by the logic circuit.
VIL (max):-It is defined as the maximum voltage level required for a logic ‘0’ at an input. Any
voltage above this level will not be accepted as a 'Low' by the logic circuit.
VOL (max):-It is maximum voltage level at a logic circuit output in the logical '0' state under
defined load conditions.
Figure of merit:-
The product of propagation delay time and power dissipation is known as figure of merit of
performance of a gate. Normally minimum values are desired.
55
GATE THE Direction Logic Families
FOM = tp X PD
Logic swing:-
The difference between the two output voltages (VOH - VOL) is known as the logic swing of the
circuit.
Noise immunity:-
NOTE:-
2. The temperature range of 74-series of TTL logic gate family is 0°c to70°c.This series of IC's
used for commercial applications.
3. The temperature range of 54-series TTL logic gate family is -55°c to 125°c. This series of IC's
used in military applications.
Breadth:-
The number of various functions available in a logic family known as breadth of the logic family.
Wired logic:-
Where the output of logic gates is connected together additional logic functions are performed.
This known as wired logic.
Passive pull-up:-
In a bipolar logic circuit a resistance 'RC' used in the collector circuit of the output transistor is
known as passive pull-up.
In a bipolar logic circuit a BJT and diode circuit used in the collector circuit of the output
transistor instead of 'RC.' is known as active pull-up. This facility is available in TTL family.
NOTE:-
The advantage of active pull up over passive pull-up are increased speed of operation and
reduced power dissipation.
In a bipolar logic circuit if nothing is connected at the collector of the output transistor and this
collector terminal is available to all IC pins known as open-collector output.
56
GATE THE Direction Logic Families
Tri-state logic:-
In the Tri-state logic in addition to low impedance 0 and 1 there is a third state known as high
impedance state where the gate is disabled it is in the third state.
The basic circuit of the RTL digital logic family is the NOR gate shown in figure. Each input is
associated with one resistor and one transistor. The collectors of the transistors are tied
together at the output. The voltage levels for the circuit are 0.2 V for the low level and
from 1 to 3.6 V for the high level.
The fan-out of the RTL gate is limited by the value of the output voltage when high. The
power dissipation of the RTL gate is about 12 mW and the propagation delay averages 12
ns.
57
GATE THE Direction Logic Families
The original basic TTL gate was a slight improvement over the DTL gate. There are several
subfamilies or series of the TTL technology. The standard TTL gate was the first version in
the TTL family. This basic gate was then designed with different resistor values to produce
gates with lower power dissipation or with higher speed.
TTL gates in all the available series come in three different types of output configuration:
1. Open-collector output
2. Totem-pole output
3. Three-state (or tristate) output
We will consider here, TTL logic with totem-pole output.
58
GATE THE Direction Logic Families
The TTL gate with the totem-pole output is shown in figure above. Transistors Q3 and Q4
constitute what is known as a totem-pole output arrangement. In such an arrangement,
either Q3 or Q4 conducts at a time depending upon the logic status of the inputs. The
totem-pole arrangement at the output has certain distinct advantages. The major
advantage of using a totem-pole connection is that it offers low-output impedance in both
the HIGH and LOW output states. In the HIGH state, Q 3 acts as an emitter follower and has
an output impedance of about 70Ω. In the LOW state, Q 4 is saturated and the output
impedance is approximately 10Ω.
If any one of the input is low or all the inputs are low then emitter base junction of
transistor is forward biased and collector base junction is reverse biased due to this
transistor Q2 and Q3 are cutoff where as Q4 is in saturation hence output is logic 1. When
all the inputs are 1 then, emitter base junction is reverse biased and collector base junction
is forward biased due to this Q1 is reverse active mode while Q2 and Q3 are in saturation
and Q4 is in cutoff and output is logic 0.
Note:-
1. In TTL logic gate family three different types of output configurations are available, they
are open collector and totem pole and tri-state output type.
2. The advantage of open collector output is wired- logic can be performed and loads other
than the normal gate can be used.
3. If any input of TTL circuit is left floating it will function as if it is connected to logic 1
level.
54-series is 5±0.5V
74/54S -Schottky
59
GATE THE Direction Logic Families
Gates with open collector output can be used for wired AND operation.
The output provide both the OR and NOR functions. Each input is connected to the base of
a transistor. The bias network configured around transistor Q6 produces a voltage of
typically -1.29V at its emitter terminal. This leads to a voltage of -2.09V at the junction of
60
GATE THE Direction Logic Families
all emitter terminals of various differential transistors Q1–Q4, assuming 0.8V to be the
required forward-biased P–N junction voltage. Now, let us assume that all inputs are in a
logic ‘0’ state, i.e the voltage at the base terminals of various input transistors is -1.75 V.
This means that the transistors Q1, Q2, Q3 and Q4 will remain in cut-off as their base
emitter junctions are not forward biased by the required voltage. This leads us to say that
transistor Q7 is conducting, producing a logic ‘0’ output and transistor Q8 is in cut-off,
producing logic ‘1’ output.
In the next step, let us see what happens if any one or all of the inputs are driven to logic
‘1’ status, that is, a nominal voltage of -0.9V is applied to the inputs. The base-emitter
voltage of differential transistors Q1–Q4 exceeds the required forward-biasing threshold,
with the result that these transistors start conducting. This leads to a rise in voltage at the
common-emitter terminal, which now becomes approximately -1.7V as the common-
emitter terminal is now 0.8V more negative than the base terminal voltage. With rise in the
common-emitter terminal voltage, the base-emitter differential voltage of Q5 becomes
0.31 V, driving Q5 to cut-off. The Q7 and Q8 emitter terminals respectively go to logic ‘1’
and logic ‘0’. The propagation delay of the ECL gate is 2 ns, and the power dissipation is 25
mW.
Act ac wire OR logic
6) MOS:
CMOS Inverter: When the input is in the HIGH state (logic ‘1’),
P-channel MOSFET Q1 is in the cut-off state while the N-channel
MOSFET Q2 is conducting. The conducting MOSFET provides a
path from ground to output and the output is LOW (logic ‘0’).
When the input is in the LOW state (logic ‘0’), Q1 is in
61
GATE THE Direction Logic Families
conduction while Q2 is in cut-off. The conducting P-channel device provides a path for VDD
to appear at the output, so that the output is in HIGH or logic ‘1’ state.
8) I2L (Integrated Injection Logic): Integrated injection logic (I2L), also known as current
injection logic, is well suited to implementing LSI and VLSI digital functions and is a close
competitor to the NMOS logic family. Figure shows the basic I2L family building block,
which is a multi collector bipolar transistor with a current source driving its base.
Transistors Q3 and Q4 constitute current sources. The magnitude of current depends upon
externally connected R and applied +V. This current is also known as the injection current,
which gives it its name of injection logic.
62
GATE THE Direction Logic Families
If input A is HIGH, the injection current through Q3 flows through the base-emitter
junction of Q1. Transistor Q1 saturates and its collector drops to a low voltage, typically
50–100 mV. When A is LOW, the injection current is swept away from the base-emitter
junction of Q1. Transistor Q1 becomes open and the injection current through Q4
saturates Q2, with the result that the Q1 collector potential equals the base-emitter
saturation voltage of Q2, typically 0.7 V. If we take o/p from collector of Q1 then its act as
inverter.
2(ECL 10k)
Propagation
12 10 30 10 0.75(ECL 25-250 70
delay(ns)
100K)
Note:
63
GATE THE Direction Logic Families
Problems:
A) C(A+B)
B) (C(A+B))’
C) AB+C
D) (AB+C)’
A) OR
B) NOR
C) AND
D) NAND
9) Among the following logic families, the one having highest noise margin is
A) Schottky TTL B) TTL C) ECL D) CMOS
10) In TTL gates, the totem pole output stage is primarily used to______.
A) increase noise margin of the gate B) decrease the output switching delay
C) facilitate a wired OR logic connection D) increase the output impendence of circuit.
11) The following circuit is a _______gate
A) CMOS NOR
B) CMOS NAND
C) PMOS NOR
D) NMOS NAND
12) The fan – out of MOS logic gate family is high because of______.
A) Low input impedance B) high input impedance
C) Low output impedance D) high output impedance
13) Ultra high switching speeds are possible in ECL family because of
A) Saturation logic used
B) Unsaturation logic used
C) Independent of saturation and unsaturation logic
D) Propagation delay is high
14) Which one of the gate family having minimum propagation delay
A) TTL B) MOS C) DTL D) ECL
15) A darlington emitter follower circuit is sometimes used in the output stage of a TTL gate in
order to _____
A) Increase its IOL B) reduce its IOH
C) Increase its speed of operation D) reduce power dissipation
16) Commercially available ECL gears use two ground lines & one -ve supply in order to_____
A) Reduce power dissipation
B) Increase fan-out
C) Reduce loading effect
D) Eliminate the effect of power line glitches or the biasing circuit
17) The output of the 74 series gate of TTL gate is taken from a BJT in
A) Totem pole and common collector configuration
B) Either totem pole or open collector configuration
C) Common base configuration
D) Common collector configuration
65
GATE THE Direction Logic Families
18) Figure shown the internal schematic of a TTL AND-OR-Invert (AOI) gate. For the inputs
shown in the figure, the output y is
A) 0 B) 1
C) AB D) (AB)’
66
GATE THE Direction Logic Families
Reason (R): A low value of speed-power product indicates that a propagation delay can be
achieved without excessive power dissipation and vice versa.
A) Both A and R are true and R is the correct explanation of A
B) Both A and R are true but R is NOT the correct explanation of A
C) A is true but R is false
D) A is false but R is true.
26) Which one of the logic families can be operated using a supply voltage from 0.5 V to 5V?
A) TTL B) ECL C) IIL D) CMOS
Answers:
1. B 2. D 3. B 4. D 5. B 6. A 7. A 8. B 9. D
10. B 11. B 12. B 13. B 14. D 15. C 16. D 17. B 18. A
19. A 20. B 21. B 22. B 23. B 24. A 25. A 26. D
67
GATE THE Direction Combinational Logic Circuits
CHAPTER V
COMBINATIONAL LOGIC CIRCUITS
Combinational logic circuitS
HALF ADDER: A B S C
A S 0 0 0 0
0 1 1 0
1 0 1 0
HALF ADDER
1 1 0 1
B C
Ex: In above figure if propagation delay of each gate is 10 ns then calculate the propagation
delay of half adder.
A) 10/3 ns B) 10 ns C) 20 ns D) 30 ns
Ex: If we have all gate expect XOR and XNOR gate then how many minimum number of gate
require constructing half adder.
Solution:
68
GATE THE Direction Combinational Logic Circuits
FULL ADDER:
A Sum
FULL ADDER
B
Cin Cout
A B Cin Sum Cout
0 0 0 0 0
0 0 1 1 0
Sum = A B C
0 1 0 1 0
Cout = AB + BC +CA 0 1 1 0 1
1 0 0 1 0
Realization of full adder using half adder: 1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
69
GATE THE Direction Combinational Logic Circuits
Suppose full adder construct by NAND gate as show above and delay of each NAND gate
is tp then
Propagation delay of full adder is 6t p
Propagation delay of sum is 6tp
Propagation delay of carry is 5t p
HALF SUBTRACTOR:
A S A B S C
0 0 0 0
HALF SUBTRACTOR 0 1 1 1
B C 1 0 1 0
1 1 0 0
S=A B & C = A’B
FULL Subtractor:
A B Cin Sub Cout
0 0 0 0 0
0 0 1 1 1
A Sub 0 1 0 1 1
FULL Subtractor
B 0 1 1 0 1
1 0 0 1 0
Cin Cout 1 0 1 0 0
1 1 0 0 0
Sub = A xor B xor C 1 1 1 1 1
Cout = A’B + BC +CA’
70
GATE THE Direction Combinational Logic Circuits
Co is always zero so we can connect it to ground or we can use half adder instead of FA 0. Final
result will be C4S3S2S1S0. It is parallel adder. It is called as Ripple carry adder.
Example: In the 4-bit ripple carry adder, if delay of full adder for sum is 20 ns and for carry is 10
ns. Find time required to get result.
Solution: tp of adder = (n-1) tp carry + max (tp carry, tp sum) = 3 x 10ns + max (10 ns, 20 ns) = 30 ns + 20
ns = 50 ns.
Multiplexer:
A data selector, more commonly called a Multiplexer, shortened to "Mux" or "MPX", are
combinational logic switching devices that operate like a very fast acting multiple position
rotary switch. They connect or control, multiple input lines called "channels" consisting of
either 2, 4, 8 or 16 individual inputs, one at a time to an output. Then the job of a multiplexer is
to allow multiple signals to share a single common output.
71
GATE THE Direction Combinational Logic Circuits
For example, a single 8-channel multiplexer would connect one of its eight inputs to the single
data output. Multiplexers are used as one method of reducing the number of logic gates
required in a circuit or when a single data line is required to carry two or more different digital
signals.
In above figure the output Y is one of input from I0 to Im-1 depend on select lines. In this we are
using n select line so 2n different combinations are possible so we can use at max 2n different
inputs (as assign one combination from 2 n to one input) so that m ≤ 2n. where m: number of
inputs and n: number of select line.
4:1 Multiplexer
4-to-1 multiplexer. The input combinations 00, 01, 10 and 11 on the select lines respectively
switch I0, I1, I2 and I3 to the output
72
GATE THE Direction Combinational Logic Circuits
Here 2 select lines S0 and S1 and corresponding 22=4 inputs, select line use to select the desire
input.
73
GATE THE Direction Combinational Logic Circuits
Y = S’I0 + SI1
i) NOT gate
I0 = 1 and I1 = 0
Y = S’
Y = AB
iii) OR gate
Y = A’B+A = A+B
I0 = 1 and I1 = B’ and S=A (here one mux require for B’ from B i.e. inverter)
v) NOR gate
I0 = B’ and I1 = 0 and S=A (here one mux require for B’ from B i.e. inverter)
Y = A’B’= A + B
I0 = B and I1 = B’ and S=A (here one mux require for B’ from B i.e. inverter)
74
GATE THE Direction Combinational Logic Circuits
Y = A’B+AB’
I0 = B’ and I1 = B and S=A (here one mux require for B’ from B i.e. inverter)
Y = A’B’+AB
One of the most common applications of a multiplexer is its use for implementation of
combinational logic Boolean functions. The simplest technique for doing so is to employ a 2 n-to-
1 MUX to implement an n-variable Boolean function. The input lines corresponding to each of
the minterms present in the Boolean function are made equal to logic ‘1’ state. The remaining
minterms that are absent in the Boolean function are disabled by making their corresponding
input lines equal to logic ‘0’. As an
Connect variable (A,B,C) to select line (here number of inputs and select lines are same)
Connect input of mux to 1’s, corresponding minterm is available in given Boolean
function and other mux input to 0’s
For above Boolean function connect mux input 2,4,7 to logic 1 and other to logic 0.
Here number of select line are less as compare to number of variable so connect high
significant variable to select line and least significant variable is connect to input of the
mux according to truth table as show below.
75
GATE THE Direction Combinational Logic Circuits
Ex. Implement the given Boolean function: f(A,B,C) = 𝑀 {0,3,6} by using 4:1 mux.
Ex. The 8-to-1 multiplexer use to implement a certain four-variable Boolean function. From the
given logic circuit arrangement, derive the Boolean expression implemented by the given circuit
is.
76
GATE THE Direction Combinational Logic Circuits
Solution:
For design N:1 mux we require atleast (N-1) number of 2:1 mux.
Ex. Find the minimum number of 2:1 mux require to design 7:1 mux
Solution: Atleast (N-1) number of 2:1 mux to design N:1 so here (N-1) = 7-1 = 6
Ex. Find the number of only 8:1 mux require to design 16:1 mux
Solution: On first stage we require two 8:1 mux and at second stage we require one 8:1 mux so
total three 8:1 mux require to design 16:1 mux.
Ex. Find the number of 4:1 mux require to design 10:1 mux
Solution: On first stage use two 4:1 mux that will cover eight inputs and on second stage use
one 4:1 mux which will cover remaining two inputs and two output of two 4:1 mux use at first
stage (one from each), so total three 4:1 mux require to design 10:1 mux.
77
GATE THE Direction Combinational Logic Circuits
Demultiplexer
The data distributor, known more commonly as a Demultiplexer or "Demux", is the
exact opposite of the Multiplexer. It has one input line and many output lines. Input is
transmitted to one of the output line that output line is selected by select line.
1:4 Demultiplexer
Y0= S1’S0’In
Y1=S1’S0In
Y2=S1S0’In
Y3=S1S0In
1:2 Demultiplexer
Y0= S’ In
Y1=S In
Decoder
A decoder is a combinational circuit that decodes the information on n input lines to a
maximum of 2n unique output lines. Figure shows the circuit representation of 2-to-4 line
decoders. If there are some unused or ‘don’t care’ combinations in the n-bit code, then there
will be fewer than 2n output lines. A decoder can generate a maximum of 2n possible minterms
with an n-bit binary code.
2 to 4 Decoder:
Where A and B are binary inputs, E is enable signal and according to 4 different combination of
inputs the corresponding outputs are Y0 to Y3.
78
GATE THE Direction Combinational Logic Circuits
Ex. Design the following Boolean function by using 3 to 8 decoder f(A,B,C) = Y = A’B’C +AB’C’
+ABC’ +ABC
Carry = AB + BC + AC = 𝒎{𝟑, 𝟓, 𝟔, 𝟕}
79
GATE THE Direction Combinational Logic Circuits
Encoder
An encoder is a multiplexer without its single output line. It is a combinational logic function
that has 2n (or fewer) input lines and n output lines, which correspond to n selection lines in a
multiplexer. The n output lines generate the binary code for the possible 2 n input lines. Let us
take the case of an octal-to-binary encoder. Such an encoder would have eight input lines, each
representing an octal digit, and three output lines representing the three-bit binary equivalent.
Circuit:
Priority Encoder:
In this type of encoder, a priority is assigned to each input so that, when more than one input is
simultaneously active, the input with the highest priority is encoded. We will illustrate the
concept of priority encoding with the help of an example. Let us assume that the octal-to-
80
GATE THE Direction Combinational Logic Circuits
binary encoder described in the previous paragraph has an input priority for higher-order digits.
Let us also assume that input lines D2, D4 and D7 are all simultaneously in logic ‘1’ state. In that
case, only D7 will be encoded and the output will be 111. The truth table of such a priority. It
implies that, if D7 = 1, then, irrespective of the logic status of other inputs, the output is 111 as
D7 will only be encoded since D7 has highest priority. The truth table for that is show below:
Ex. We have an eight-line to three-line priority encoder circuit with D0, D1, D2, D3, D4, D5, D6
and D7 as the data input lines. the output bits are A (MSB), B and C (LSB). Higher-order data bits
have been assigned a higher priority, with D7 having the highest priority. If the data inputs and
outputs are active when LOW, determine the logic status of output bits for the following logic
status of data inputs:
(b) D0 to D3 are in logic ‘0’ state and D4 to D7 are in logic ‘1’ state.
(c) D7 and D3 is in logic ‘0’ state. The logic status of the other inputs is not known.
Solution:
(a) Since all inputs are in logic ‘0’ state, it implies that all inputs are active. Since D7 has the
highest priority and all inputs and outputs are active when LOW, the output bits are A = 0, B = 0
and C = 0(since output is active low).
(b) Inputs D0 to D3 are the zero that are active. among these, D4 has the highest priority.
Therefore, the output bits are A = 0, B = 1 and C = 1 (since output is active low).
(c) D7 is active. Since D7 has the highest priority, it will be encoded irrespective of the logic
status of other inputs. Therefore, the output bits are A = 0, B = 0 and C = 0(since output is active
low).
81
GATE THE Direction Combinational Logic Circuits
Ex. Design a four-line to two-line priority encoder with active HIGH inputs and outputs, with
priority assigned to the higher-order data input line.
Solution: Suppose input are D0, D1, D2, D3 with D3 has highest priority and D0 has least priority
and the output bits are X & Y.
When used as a PLD, it can be used to implement m different combinational functions, with
each function being a chosen function of n variables. A generalized ROM device with n inputs
and m outputs has 2n hard-wired AND gates at the input and m programmable OR gates at the
output. Thus, each OR gate can be used to generate any Boolean function of n variables.
Ex. Design the given Boolean function F1(A,B,C) = 𝑚 0,2 & 𝐹2 = 𝑚 1,4,7
Solution: Step:
Design all the minterm possible by using given variables (here three variables A, B, C).
82
GATE THE Direction Combinational Logic Circuits
Connect the minterm present in given function to programmable OR gate. Here function
F1 has minterm 0 & 2 and F2 has minterm 1, 4 &7.
Steps:
83
GATE THE Direction Combinational Logic Circuits
Steps:
84
GATE THE Direction Combinational Logic Circuits
Problems:
A) 6 B) 4 C) 5 D) 8
A) (0, 31)
B) (1, 32)
C) (0, 32)
D) (1, 31)
A) F= m(0,1,3,5,9,10,14) B) F= m(2,3,5,7,8,12,13)
C) F= m(1,2,4,5,11,14,15) D) F= m(2,3,5,7,8,9,12)
5) Find the f
A) A B) B C) 0 D) 1
85
GATE THE Direction Combinational Logic Circuits
8) Find Y
11) The device which changes from serial data to parallel data is
86
GATE THE Direction Combinational Logic Circuits
14) The gate having two inputs (A, B) and one output (Y) is implemented using 4 to 1 mux as
shown in figure. A1 (MSB) and A0 are the control bits and I0-I3 are the inputs to the mux.
The gate is
A) (I0, I1, I2, I3, S1, S0) =(1,0,A’,A,C,B) B) (I0, I1, I2, I3, S1, S0) =(1,0,A’,A,B,C)
C) (I0, I1, I2, I3, S1, S0) =(0,1,A’,A,C,B) D) (I0, I1, I2, I3, S1, S0) =(0,1,A,A’,B,C)
16) How many 2 to 4 line decoder with enable input are needed to construct a 4 to 16 line
decoder?
A) 4 B) 5 C) 6 D) 8
17) The function f(A, B, C, D) = ∑(5,7, 9, 11, 13, 15) is independent of variables
A) B B) C C) A and C D) D
18) An 8x1 mux has input A, B and C connected to the selection inputs S 2, S1 and S0
respectively. The data input I0 to I7 are as follows: I1=I2=I7=0; I3=I5=1; I0=I4=D; I6=D’. The
Boolean function that the mux implements is
A) f(A, B, C, D)=∑(1,6,7,9,10,11,12) B) f(A, B, C, D)=∑(0,3,4,5,11,12)
C) f(A, B, C, D)=∑(1,3,5,7,9,11,13,15) D) f(A, B, C, D)=∑(0,1,3,4,5,6,12)
19) Figure shown a 4 to 1 mux to be used to implement the sum S of a 1-bit full adder with
input bits P and Q and the carry input C. which of the following combination of inputs to
I0, I1, I2 and I3 of the mux will realize the sum S.
87
GATE THE Direction Combinational Logic Circuits
A) (XY)’+X B) X + Y C) X’+Y’ D) XY + X’
21) Match the following:
List –I List – II
P. Full adder 1. Sequential digital circuit
Q. Multiplexer 2. One bit adder
R. Read/write Memory 3. Two bit adder
S. ROM 4. Universal gate
5. Universal element
6. Combination of decoder & demux
7. Combination of decoder & encoder
A) P-3,Q-5,R-1,S-7 B) P-2,Q-5,R-1,S-7 C) P-4,Q-1,R-7,S-2 D) P-4,Q-3,R-5,S-7
22) The following multiplexer circuit is equivalent to
27) Which one of the following statements correctly defines the full adder?
An adder circuit
A) Having 2 inputs used to add two binary digits. It produces their sum & carry as input.
B) Having 3 inputs used to add two binary digits plus a carry. It produces their sum &
carry as output.
C) used in the least significant position when adding two binary digits with no carry in to
consider. It produces their sum & carry as outputs.
D) Having two inputs and two outputs.
28) Which one of the following can be used as parallel to series converter?
A) Decoder B) Digital Counter C) Multiplexer D) Demultiplexer
29) Which of the below statements are correct for multiplexer
1. Select one of the several inputs and transmit it to a single output.
2. Routes the data from a single input to one of many output
3. Converts parallel data into serial data
4. Is a combinational circuit
A) 1,2 & 4 B) 2,3 &4 C) 1,3 &4 D) 1,2 &3
30) A 1-bit full adder takes 20ns to generate carry out bit and 40ns for the sum bit. What is
the maximum rate of addition per second when four 1-bit full adders are cascade?
A) 107 B) 1.25x107 C) 6.25x106 D) 105
31) If we have all gate expect XOR and XNOR gate then how many minimum number of gate
require constructing half adder.
A) 3 B) 4 C) 5 D) 2
32) PLA can be use as
A) to realize sequential logic B) counter
C) to realize combinational logic D) resister
Answers:
1. C 2. C 3. C 4. D 5. B 6. C 7. A 8. C 9. B
10. C 11. C 12. B 13. C 14. D 15. D 16. B 17. B 18. A
19. C 20. B 21. B 22. A 23. C 24. D 25. A 26. C 27. B
28. C 29. C 30. A 31. A 32. C 33. 34. 35. 36.
89
GATE THE Direction Sequential Logic Circuits
CHAPTER VI
SEQUENTIAL LOGIC CIRCUITS
Combinational circuit: Combinational circuits are those whose output level at any instant of
time depends on only present inputs at that time.
Sequential circuit: sequential circuits are those whose output level at any instant of time
depends on present inputs and previous inputs or output or both. So sequential circuit has
memory element for storing previous inputs and output. F/F is basic element of memory so if
F/F is present in circuit then it is sequential otherwise it is combinational circuit.
Truth table or Characteristics table: It contain all the possible combination of inputs and
corresponding outputs.
Excitation table: It contain all the possible combination of outputs and corresponding possible
inputs.
Flip-Flop is the basic memory element. It can store one bit of information. It has two
outputs these are complement to each others. Flip-Flop is also called as Bistable multivibrator
because it has two stable states 0 and 1.
Basic design:
The basic design of latch come from cascade connection of inverters. In above fig. we connect
two inverter in cascade so it is design of bistable multivibrator. Its o/p is change iff i/p is change
otherwise o/p will be same i.e. store and it is the basic requirement of the flip/flop (the
connection of second diagram is as first one just representation is different). For designing basic
S-R latch the inverter design by using NOR & NAND gates as show below.
90
GATE THE Direction Sequential Logic Circuits
Here when S=R=1 then both the output Q and Q’ have same value as 0. But Q and Q’ are
compliment of each other so that S=R=1 condition is not acceptable in S-R latch using NOR
gates.
91
GATE THE Direction Sequential Logic Circuits
S R Qn+1
0 0 Qn
0 1 0
1 0 1
1 1 invalid
Characteristic equation: Qn+1 = S + R’Qn
Excitation table:
Qn Qn+1 S R
0 0 0 X
0 1 1 0
1 0 0 1
1 1 x 0
Representation of clock:
Positive level trigger: The latch which respond to change in inputs when the clock is high
Negative level trigger: The latch which respond to change in inputs when the clock is low
Positive edge trigger: The flip-flop whose output is change only at positive edge of clock (i.e.
clock is changing from low to high).
Negative edge trigger: The flip-flop whose output is change only at negative edge of clock (i.e.
clock is changing from high to low).
Truth table, excitation table is similar for latch and flip-flop (only difference is latch is
level trigger device and flip-flop is edge trigger device.)
F/F’s are edge trigger device and latch’s are level trigger device.
Example: In following diagram, the frequency of clock is 10 kHz find frequency of output signal
Q.
92
GATE THE Direction Sequential Logic Circuits
J-K latch:
93
GATE THE Direction Sequential Logic Circuits
Here we design the flip-flop (master-slave) by using to positive level trigger latch.
the master is active but slave is not active so any change in inputs at that time will
change the output of master but not affect the output of slave.
the master is not active but slave is active so any change in inputs at that time will not
change the output of master so input to slave is not change (since output of master is
input to slave) so output of the slave also not change since inputs to slave is not change.
So the output of slave(in above dig.) is change only when clk is transit from high to low so it is
negative edge trigger master slave flip-flop.
Example1: In following circuit if clock frequency is 10 kHz find the frequency at output Q.
94
GATE THE Direction Sequential Logic Circuits
D Flip-flop:
95
GATE THE Direction Sequential Logic Circuits
Characteristic table:
D Qn Qn+1
D Qn+1 0 0 0
0 0 0 1 0
1 1 1 0 1
1 1 1
Excitation table:
Qn Qn+1 D
0 0 0
0 1 1
1 0 0
1 1 1
Just connect the input D to S and D’ to R for design D F/F from S-R F/F.
Just connect the input D to J and D’ to K for design D F/F from J-K F/F.
Example 1: What will be the output after 5 clock cycle if initially Q=1.
Here D=Q
Example 2: What will be the output after 10 clock cycle if initially Q=1.
96
GATE THE Direction Sequential Logic Circuits
Here D=Q’
So that Qn+1=Q’
T Flip-flop:
Characteristic table:
T Qn Qn+1
T Qn+1 0 0 0
0 Qn 0 1 1
1 Qn’ 1 0 1
1 1 0
Characteristics Equation: Qn+1 = TQn’ + T’Qn
Excitation table:
Qn Qn+1 T
0 0 0
0 1 1
1 0 1
1 1 0
S-R F/F is not used to design the T-f/f since S =R = 1 is invalid state.
Just connect the input T to J and K for design T F/F from J-K F/F.
Conversion of Flip-flop:
Write the characteristics of the Flip-flop which is to be design
97
GATE THE Direction Sequential Logic Circuits
J K Qn Qn+1 S R
0 0 0 0 0 x
0 0 1 1 X 0
0 1 0 0 0 x
0 1 1 0 0 1
1 0 0 1 1 0
1 0 1 1 X 0
1 1 0 1 1 0
1 1 1 0 0 1
The input S-R, D, J-K is called synchronous input because Flip-flops are edge trigger device i.e.
output is change only at the occurrence of edge of clock (positive edge or –ve edge) i.e. the Flip-
flop output is synchronizing with edge of clock input.
98
GATE THE Direction Sequential Logic Circuits
Preset: It set the output of Flip-flop i.e. Q=1. It don’t wait for edge of
clock signal and irrespective of input.
Clear: It reset the output of Flip-flop i.e. Q=0. It don’t wait for edge of
clock signal and irrespective of input.
Counters:
Counters are the sequential circuit, they are use to count number of pulse applied to
them, frequency divider, time measurement in digital watches, distant measurement in RADAR.
If N-number of Flip-flops are used in counter then 2n is maximum numbers of possible states. If
counter uses all possible state then it is also called as binary counter and if it uses less number
of states then it called as non binary counter.
The number of state of counter is represented by the modulus, so if counter has ‘N’
number of stage then it is called as MOD-N counter. If frequency of applied signal is Fclk Hz then
output frequency of MOD-N counter is Fclk/N.
1. Synchronous Counter: In a synchronous counter, the same clock is applied to all flip flops
simultaneously (directly). Synchronous counter is also known as parallel sequential circuit.
Examples of Synchronous Counters are as below:
Ring Counter
Asynchronous Counter
In an asynchronous counter, the flip flop output act as clock of other flip flops i.e. clock to all
the flip-flop is different. Asynchronous counter is also known as serial sequential circuit.
Example of Asynchronous Counters are as below:
99
GATE THE Direction Sequential Logic Circuits
Mod: The number of different states used is nothing but the mod of counter.
Ripple counter:
1. Ripple UP-counter:
These counter are asynchronous type. The ripple UP-counter is shown below:
The external clock is applied to only one Flip-flop then output of that flip-flop take as LSB. The
above counter has 3-F/F so it has maximum 23=8 states. Here we are using all states so it is
binary counter also called MOD-8 counter. Here we used either J-K F/F of T-F/F for designing
ripple counter with J=K=1 or T=1 so at the occurrence of edge of clock the output of that F/F
toggle (i.e. if previous output is 0 then next output become 1 and vice versa). The clock and
output waveform at the output of all the f/f are given below. In this counting is increasing as 0,
1, 2 etc so its called as up counter.
Clk QC QB QA
0 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1
4 1 0 0
5 1 0 1
100
GATE THE Direction Sequential Logic Circuits
6 1 1 0
7 1 1 1
8 0 0 0
Clk QC QB QA
In this counting is decreasing
0 0 0 0 as 7, 6, 5 etc so its called as down counter.
1 1 1 1 In down counter +ve edge
2 1 1 0 trigger f/f is used
3 1 0 1 In up counter -ve edge trigger
4 1 0 0 f/f is used
5 0 1 1 In ripple counter
6 0 1 0 (Asynchronous counter) the worst case
7 0 0 1 propagation delay is n.tp i.e. tpcount = n.tp. Where
8 0 0 0 n: number of f/f and tp: propagation delay of each
f/f.
Therefore maximum frequency of clock that that can be apply to ripple counter is
𝟏 𝟏
Fclk max = =
𝒕𝒑𝒄𝒐𝒖𝒏 𝒏.𝒕𝒑
Example.1: In above counter each Flip-flop has delay of t pd. So find the maximum frequency of
clock pulse
Solution: For worst case resultant output will come after 3 t pd sec. so time period of clock tclk ≥
3 tpd
1 1
So that Fclk ≤ 3𝑡 so Fclk(max) = 3𝑡𝑝𝑑
𝑝𝑑
101
GATE THE Direction Sequential Logic Circuits
1
Fclk ≤ 3𝑡 +𝑡
𝑝𝑑 𝑠𝑡𝑟𝑜𝑏𝑒
Strobe: It is input signal given to observe the permanent output. If n-Flip-flop are used and each
have delay of tpd then strobe signal should be apply after ntpd time.
Example.2: In 4-bit ripple counter propagation delay of each Flip-flop is 25 nsec what is
maximum clock frequency that can applied
1 1
Fclk(max)= = = 10 MHz
4𝑡 𝑑 4×25×10 −9
In ripple counter J-K Flip-flop are used and J=K=1 and same counter can be made using T Flip-
flop with T=1. It can also be implemented using D and S-R Flip-flop.
Ring counter:
Ring counter is synchronous counter. It is serial in serial out counter. It is also called as
end carry counter. One limitation in this counter is that first we have to ON it by applying 1 as
input, so this counter is not self starting counter.
102
GATE THE Direction Sequential Logic Circuits
103
GATE THE Direction Sequential Logic Circuits
Here all states are not used so it is non binary type of counter.
1. From the given sequence we can find out minimum number of f/f require for design (as
number of count ≤ 2𝑛 , 𝑤𝑒𝑟𝑒 𝑛: 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑓/𝑓)
2. Write down all possible state
3. Write down corresponding next state
4. Used excitation table.
Example: Given circuit of 2-bit counter using T- flip-flop giving the following sequence 0,2,3,1,0
and so on.
Solution:
In MOD-10 counter there will be 10 states from 0000 to 1001 and number of flip-flop required
are four so in this counter we want 0000 outputs after 1001.
104
GATE THE Direction Sequential Logic Circuits
Register:
Register are use to store the information in binary form. For storing 1 bit information require 1
flip-flop. In storage register mostly D flip-flop is used.
Base on input and output techniques register can be classified in four type:
105
GATE THE Direction Sequential Logic Circuits
Number of clock pulse require to read the data = 0 (since data is available in parallel)
Example: The clock shown in figure is SIPO with initial data 1010 after 3 clock pulse the data
present in the register will be
Sol:
106
GATE THE Direction Sequential Logic Circuits
Example: In 4-bit SISO register, 8-bit data is applied serially. Minimum number of clock pulse
required to get total data output serially.
Sol: Here 1st bit applied to register will be available at output after 4th clock so 2nd bit after 5th
clock similarly 8th bit will available after 11 clock pulse.
Example: The shift register show in figure has 1010 initially after how many clock pulses the
content of shift register will become 1010
(Ans: 7)
Number of clock pulse required to enter data: 1 (As data enter in parallel)
Number of clock pulse requires to read data: (n-1) (for above example clock pulse require is 3)
For n bit data to enter we require n flip-flop and only one clock pulse is required and for reading
data n-1 clock pulse are required since data can be read serially only. Here MUX is used
between Q3 and I2, Q2 and I1, Q1 and I0 when input is to be given then MUX is used to select the
input line I0, I1, I2, I3, and when output is to be taken then MUX is used to select the output of
each flip-flop Q3, Q2, Q1.
107
GATE THE Direction Sequential Logic Circuits
Here it seems that flip-flops are of no use but these flip-flops store the data bit as long as we
want.
PIPO register is actually not a shift register because all flip-flop are individual. It is the fastest
register. This register is used mostly in microprocessor
108
GATE THE Direction Sequential Logic Circuits
Problems:
4) For the circuit shown in figures below, two 4 - bit parallel - in serial - out shift registers
loaded with the data shown are used to feed the data to a full adder. Initially, all the flip -
flops are in clear state. After applying two clock pulses, the output of the full-adder
should be
A) S = 0, C0 = 0 B) S = 0, C0 = 1 C) S = 1, C0 = 0 D) S = 1, C0 = 1
5) Initially S=R=0 and after that S change as 1,0,1,0,1 then what will be the corresponding
output Q
109
GATE THE Direction Sequential Logic Circuits
A) D= S + R B) D= S + R’ C) D= S D) D= S + R’Qn
8) Given circuit of 2-bit counter using T- flip-flop giving the following sequence 0,3,2,1,0 and
so on.
110
GATE THE Direction Sequential Logic Circuits
A) J = 1, K = 0 B) J = 0, K = 1 C) J = 0, K = 0 D) J = 1, K = 1
12) The given figure shows a ripple counter using -ve edge triggered flip-flops. If the present
state of the counter is Q2Q1Q0 = 011 then is next state Q2Q1Q0 will be
13) Soppose in the above dig. We use positive edge trigger f/f. If the present state of the
counter is Q2Q1Q0 = 011 then is next state Q2Q1Q0 will be
A) 111 B) 010 C) 100 D) 110
14) A master - slave flip flop has the characteristic that
B) Change in the output occurs when the state of the master is affected
C) Change in the output occurs when the state of the slave is affected
D) Both the master and the slave states are affected at the same time
A) 00, 11, 11, 11, 11 B) 00, 10, 01, 00 C) 00, 11, 00, 11 D) 00, 01, 11, 00
16) Initially D-flip flop is clear and SISO shift resister is filled with 01011100 then what will be
data available in shift resister after 3 Clock
111
GATE THE Direction Sequential Logic Circuits
A) 5 B) 6 C) 3 D) 4
19) Data can be changed from special code to temporal code by using
A) Set Q = 1 and Q’ = 0.
B) Set Q = 0 and Q’ = 1.
D) No change in output.
22) A 4-bit synchronous counter uses flip-flops with propagation delay times of 15 ns each.
The maximum possible time required for change of state will be
23) How many flip flops are required to construct a decade counter
A) 10 B) 3 C) 4 D) 2
25) The sequence (Q2Q1) generated by the following ckt (initially Q2Q1 = 00).
112
GATE THE Direction Sequential Logic Circuits
A) 00, 11, 01, 01, 01 B) 00, 01, 01, 01, 01 C) 00, 11, 00, 11, 00 D) 00, 01, 00, 01, 00
26) What will be the Y after four clock pulse and also type of circuit.
A) synchronous, Y= 0 B) synchronous, Y= 1
C) Asynchronous, Y= 0 D) Asynchronous, Y= 0
27) The following ckt is
113
GATE THE Direction Sequential Logic Circuits
1 1 1 1
A) 25 𝑀𝐻𝑧 B) 24 𝑀𝐻𝑧 C) 32 𝑀𝐻𝑧 D) 23 𝑀𝐻𝑧
34) The initial contents of the 4-bit serial-in-parallel-out right-shift, register as shown below
is 1010. After four clock pulses are applied, the contents of the shift register will be
114
GATE THE Direction Sequential Logic Circuits
Answers:
1. D 2. C 3. A 4. B 5. C 6. B 7. D 8. A 9. C
10. C 11. D 12. C 13. B 14. C 15. C 16. A 17. C 18. D
19. A 20. A 21. C 22. A 23. C 24. C 25. A 26. B 27. B
28. A 29. B 30. A 31. C 32. D 33. A 34. C 35. B 36. D
37. C 38. B 39. A 40. D
115
GATE THE Direction ADC and DAC
CHAPTER VII
ADC and DAC
Resolution: It is the change in analog voltage at the output corresponding to one LSB change in
digital input
The output voltage correspond to the digital input one is nothing but resolution of DAC.
𝑽𝒓𝒆𝒇
Resolution =
𝟐𝒏 −𝟏
𝟏
% Resolution = *100
𝟐𝒏 −𝟏
Example: A 4-bit D/A convertor has reference voltage 5 V. Find the resolution.
𝑉𝑟𝑒𝑓 5 1
Solution: Resolution = = = V
2𝑛 −1 24 −1 3
Example: 4-bit DAC and voltage corresponding to 1000 is 6 V. find the resolution and voltage
corresponding to 0101
116
GATE THE Direction ADC and DAC
Example: 8 bit DAC produces 0.05 V for digital input 000000001 find resolution and V out for
input 00101010
There for n-bit Maximum value of resistance that is used will be 2n-1 R
To apply 1 at b0, b1, b2, b3 we connect that them to +5 V and to apply 0 at b0, b1, b2, b3 connect
them to the ground.
Here:
V ref V ref V ref V ref
I = b0 + b1 + b2 + b3
8R 4R 2R R
Rf b3 b2 b1 b0
V0 = -IRf = - Vref [ + + + ]
R 1 2 4 8
For n-bit
Rf n−1 bi
V0 = - Vref i=0 ( )
R 2 −1−i
n
117
GATE THE Direction ADC and DAC
Ex. Find the output voltage of Weighted Resistor type 4-bit DAC. As Vref = 5 V and digital i/p is
1101 (R = 2Rf).
Rf b3 b2 b1 b0 R 1 1 0 1
Solution: V0 = - Vref [ + + + ]= - 5 2Rf [ 1 + + + 8 ] = 4.0625 V
R 1 2 4 8 f 2 4
Here we can see that only two type of resistor of values R and 2R
As op-amp is linear device so the response due to all i/p is just addition of response due to
individual i/p’s.
𝑫𝟑 𝑫𝟐 𝑫𝟏 𝑫
Therefore VO= Vref + + + 𝟏𝟔𝟎
𝟐 𝟒 𝟖
118
GATE THE Direction ADC and DAC
Example: If we applied input 0101 and Vref=5V then what will be the output voltage.
𝑫𝟑 𝑫𝟐 𝑫𝟏 𝑫 𝟎 𝟏 𝟎 𝟏
Sol: V O= Vref + + + 𝟏𝟔𝟎 = 5 + 𝟒 + 𝟖 + 𝟏𝟔
𝟐 𝟒 𝟖 𝟐
VO=1.5625 V
To convert analog signal to digital first of all samples of analog signal is taken and these
sample are converted into corresponding value of Digital.
Here the sample take is given as voltage Va input to OPAMP. Initially ripple counter is set to
0000. Here 4-bit counter is used so that input to DAC is 0000 and output from DAC will be 0 V
which compare with Va and when Va > Vb the V0 = + Vsat and which is input given to the AND gate
the output of AND gate is high so clock is applied to counter so value of counter is increase by 1
and corresponding voltage comes out from DAC which again compare with V a. If Va > Vb the
process is goes on as discuss above till Va < Vb. When Va < Vb then V0 = -Vsat and then clock will
not applied and value at the output of counter will be the corresponding digital value to sample
of analog signal.
119
GATE THE Direction ADC and DAC
Conversion time (tc): Time require to convert analog voltage (sample) to corresponding digital
value.
1st analog sample should be converted into corresponding digital before the occurrence
of next analog sample.
So tc ≤ ts There tcmax = ts (where ts is time period between two sample taken i.e. t s =
1/fs)
Here 𝑫𝒊𝒈𝒊𝒕𝒂𝒍 𝒐𝒖𝒕𝒑𝒖𝒕 × 𝑹𝒆𝒔𝒐𝒍𝒖𝒕𝒊𝒐𝒏 > 𝑉𝒂
(For 4-bit counter maximum output is 1111 so maximum time that it will take to convert a
sample into digital is (24 - 1)Tclk = 15 Tclk)
Here as number of bit increase, then number of clock pulse required also increase and ADC
become slow. The counter reset after each conversion. Conversion time depend on magnitude
of analog signal. It is said counter type because here counter is used and digital ramp because
output of counter is ramp type.
Ex: Determine maximum conversion time that an ADC can have, if it is used to convert signal in
the range of 1 kHz to 50 kHz.
120
GATE THE Direction ADC and DAC
In successive approximation register type ADC conversion time does not depend on
magnitude of sample.
When SOC pin is on then MSB will set and corresponding analog voltage (Vb) will get at the
output of DAC that compare with analog sample voltage (Va) if
Va > Vb (i.e. o/p of comparator is +Vsat) then MSB bit (‘1’) is not change.
Va < Vb (i.e. o/p of comparator is - Vsat) then MSB bit is reset (‘0’).
This will decide is MSB is ‘1’ or ‘0’ and all the other bits are also check by same way one by one from
MSB to LSB.
Solution: When SOC pin is ‘on’ D3 (msb) will set first and we get 1000. DAC convert it into
analog signal of 8V (as 1V resolution) Since 3.4 V < 8. So -Vsat input goes to control circuit (so
MSB become reset and we check next bit) and so next output will be 0100 (D2 set) and output
of DAC is 4V. Then 3.4 < 4 V and then again output from SAR will be (0010) and output of DAC is
2V and 3.4 > 2 then output from SAR will be (0011) = 3V then the output for sample 3.4 will be
0011. For any input voltage between 3 to 4 V the corresponding digital output will be 0011
Link question:
Ex: If 4 bit ADC is used with clock frequency of 2 MHz, then find the maximum conversion time
A) 2 us B) 7.5 us C) 15 us D) 1 us
Ex: What will be the maximum frequency of input analog voltage that can be safely converted
into digital output?
121
GATE THE Direction ADC and DAC
It is also called parallel type or parallel comparator type analog to digital convertor.
In this ADC no clock is required; therefore it is the fastest ADC. The conversion takes place
continuously. The delay occurs is in the comparator and the priority encoder.
Suppose Vcc= 8 V and Va=3.5V then Vcc will divide in the resistor connected in series and
Va is applied to each comparator therefore each comparator will compare 3.5V with other
voltage and give the corresponding output. The output of last 3 comparator will be logic 1.
Since priority encoder will select the input line according to the priority. Here highest
priority is D3; therefore output will be logic 011.
Here since vref= 8V so this ADC will give output 011 for input (3.00001 to 3.9999). if we
want to increase accuracy then we have to reduce the value of v ref but then we cannot convert
high amplitude analog signal into digital or we have to use more number of bits (also
hardware).
Disadvantages
1. It has complex circuitry since for n-bit it uses 2n-1 comparator, 2n resistor and priority
encoder.
2. It is most expensive.
Advantages
122
GATE THE Direction ADC and DAC
1) It is fastest ADC
2) No clock is required
3) It is very useful for high freq.
This is the slowest but most accurate type ADC being most accurate it is used in measuring
instrument like multimeter where slow conversion is not a problem.
Here assume counter is reset. The input sample is applied to negative terminal of OPAMP. Since
1st OPAMP act as integrator it will integrate the Va till counter reach 1111. Let this time be T1.
𝟏 𝑽
Output of integrator is V0 = − 𝑹𝑪 𝑽𝒊𝒏 𝒅𝒕 = − 𝝉𝒂 𝑻𝟏 Where T1 = 2n Tclk and 𝜏 = 𝑅𝐶
The reference voltage which is taken as negative if Va is positive and it is applied to integrator.
Then since - VR is negative then it will integrate in opposite direction and the V0 tend toward
zero. The time at which V0 become zero is counted by counter and it is the corresponding output
value to the input analog sample.
Where N: number of clock that counters count when output reaches from –VaT1/𝜏 to 0.
123
GATE THE Direction ADC and DAC
1 1 𝑉𝑎 𝑇1 1
V0 =− 𝑅𝐶 𝑉𝑖𝑛 𝑑𝑡 + 𝑐′ = − 𝜏 −𝑉𝑅 𝑑𝑡 − = 𝜏 𝑉𝑅 𝑇2 − 𝑉𝑎 𝑇1 /𝜏 Where 𝜏 = 𝑅𝐶 and c’ is
𝜏
initial voltage (integration constant)
note:
124
GATE THE Direction ADC and DAC
Problems:
1) A weighted resistor digital to analog converter using N bits requires a total of
A) N precision resistors. B) 2N precision resistors.
C) N + 1 precision resistors. D) N – 1 precision resistor.
2) A 4 - bit D/A converter is connected to a free - running 3 - big UP counter, as shown in the
following figure. Which of the following waveforms will be observed at V0 ?
65 55
A) 16 V B) 16 V C) 5 V D) Depend on R and Rf value
4) What will be minimum Fclk for 8 bit Successive approximation register type ADC having
sampling time of Tsample=8ns
A) 1 GHz B) 25M Hz C) 125MHz D) 200MHz
5) The speed of conversion is maximum in
A) Successive-approximation A/D converter.
B) Parallel-comparative A/D converter.
C) Counter ramp A/D converter.
D) Dual-slope A/D converter.
6) The A/D converter whose conversion time is independent of the number of o/p digital bits
is
A) Dual slope B) Counter type
C) Successive approximation. D) none
125
GATE THE Direction ADC and DAC
7) The A/D converter whose conversion time is independent of input analog sample is
A) Dual slope B) Counter type
C) Successive approximation. D) none
8) In successive-approximation A/D converter, offset voltage equal to ½ LSB is added to the
D/A converter’s output. This is done to
A) Improve the speed of operation.
B) Reduce the maximum quantization error.
C) Increase the number of bits at the output.
D) Increase the range of input voltage that can be converted.
9) Find the percentage resolution of 8-bit DAC
A) 0.392% B) 0.781% C) 1.96% D) 1.52%
10) The 4-bit DAC has step size of 150 mV. Determine the full scale o/p
A) 2.4 V B) 0.6 V C) 2.1 V D) 2.25 V
11) An 8-bit DAC produce Vout = 0 V for digital input 00000000 & Vout = 2.8 V for digital input
11000000 then find the Vout for digital input 10101010
A) 2.479 V B) 2.956 V C) 1.967 V D) 1.523 V
12) Find the LSB and MSB output (in V) respectively for 8-bit DAC has Vref = 5 V
5 128 128 5 5
A) 255 & 51 B) 0 & 51 C) 255 & 2 D) 0 & 5
13) The analog sample (Va) of 3.563 V is apply to 8-bit dual slope ADC with reference voltage
(VR) of -10 V. find equivalent digital o/p.
A) 01011100 B) 11001101 C) 01101001 D) 01011101
14) Find the 4-bit digital o/p of digital ramp type ADC. For analog sample of 5.7 V and resolution
of DAC is 0.5 V
A) 1100 B) 1011 C) 1010 D) 1101
15) Find the 4-bit digital o/p of SAR ADC. For analog sample of 5.7 V and resolution of DAC is 0.5
V
A) 1100 B) 1011 C) 1010 D) 1101
16) A 8 - bit ADC is operating with a 1us clock period and period between two analog sample is
10 ns, for proper operation the ADC must be
A) Digital ramp type B) SAR type C) flash type D) dual slope type
17) Which of the following ADC’s uses over sampling in its operation (ISRO)
A) Sigma-delta ADC B) SAR ADC C) flash ADC D) counter ramp ADC
18) For an 8-bit DAC having reference voltage of 8 V, the least significant 4 bit of the i/p are
grounded and most significant 4 bits are driven by 4 bit data binary counter. The maximum
obtainable peak-to-peak amplitude of a waveform at the o/p of DAC is (DRDO)
A) 4 V B) 6 V C) 7.2 V D) 7.5 V
19) A 5 bit DAC has a current o/p, for the digital i/p 10100 is 10 mA. What will be the current for
a digital i/p of 11101 is (ISRO)
A) 14.5 mA B) 10 mA C) 100 mA D) cant calculate
20) Find the number of comparator require for 12 bit flash ADC
A) 2048 B) 11 C) 4096 D) 4095
21) The 4-bit digital ramp type ADC with full scale reading of 7.5 has an conversion time 10 us
for 1.3 V analog sample then find conversion time for 2.6 V analog sample
126
GATE THE Direction ADC and DAC
A) 10 us B) 5 us C) 20 us D) can’t determine
22) The 4-bit SAR type ADC with full scale reading of 7.5 has an conversion time 10 us for 1.3 V
analog sample then find conversion time for 2.6 V analog sample
A) 10 us B) 5 us C) 20 us D) can’t determine
23) A certain 6-bit DAC has a full scale output of 2 mA and full scale error of ± 0.5%. what is the
range of possible output for an i/p of 100000
A) 1.004 to 1.024 mA B) 1 to 1.2 mA C) 1.004 to 1.014 mA D) none
24) What will be output voltage due to MSB in 8 bit ladder if input level for 0 is 0 V and for 1 is 5
V
A) 2.5 V B) -2.5 V C) 5 V D) -5 V
25) Find the output voltage correspond to LSB if logic 0 is 0V and logic 1 is 5 V
Answers:
1. A 2. C 3. D 4. A 5. B 6. D 7. C 8. D 9. A
10. D 11. A 12. A 13. A 14. A 15. B 16. B 17. A 18. D
19. A 20. D 21. C 22. A 23. A 24. A 25. D 26. A 27.
127
GATE THE Direction Semiconductor Memory
CHAPTER VII
SEMICONDUCTOR MEMORY
Memory:
There are several types of memory. They can be classified as primary memory and secondary
memory.
Primary memory can be classified into random access memory (RAM), cache memory
and read only memory (ROM). Random access memory (RAM) stores the programs that are
currently being run and the data related to these programs. It is a volatile memory and is used
for temporary storage of data and programs. Cache memory is a special type of internal memory
that can be accessed much faster than the RAM. ROM is a nonvolatile memory that stores the
system programs including the basic input/output system (BIOS), start-up programs and so on.
Secondary memory has a much greater capacity than primary memory, but it is much
slower than the primary memory. It is used to store programs and data for future use. Most
commonly used secondary memory devices include the hard disk, floppy disks, magnetic tape,
compact disks (CDs), and USB disks. The secondary memories are cheap as compare to primary
memories.
Memory is the portion of a system for storing binary data in large quantities. Semiconductor
memories consist of arrays of storage elements that are generally either latches (or) capacitors.
3. The byte can be split into two 4-bit units called nibble
4. A complete unit of information is called a word, generally consist of one (or) more
bytes.
Cell: Each storage element in a memory can retain a '1' (or) '0' and is called a cell. Memories are
made up of array of cells.
128
GATE THE Direction Semiconductor Memory
Ex: A 16K x 8 memory can store 16,384 words of eight bits each. (1k = 1024)
The location of a unit of data in memory array is called address. The capacity of a memory is the
total number of units that can be stored.
RAM has three basic building blocks, namely an array of memory cells arranged in rows
and columns with each memory cell capable of storing either a ‘0’ or a ‘1’, an address decoder
and a read/write control logic. Depending upon the nature of the memory cell used, there are
two types of RAM, namely static RAM (SRAM) and dynamic RAM (DRAM).
RAM Family:
In SRAM, the memory cell is essentially a latch and can store data indefinitely as long as the DC
power is supplied. DRAM on the other hand, has a memory cell that stores data in the form of
129
GATE THE Direction Semiconductor Memory
charge on a capacitor. Therefore, DRAM cannot retain data for long and hence needs to be
refreshed periodically. SRAM has a higher speed of operation than DRAM but has a smaller
storage capacity.
Static RAM
Basic element of SRAM is a latch memory cell. Figure shows a basic SRAM memory cell.
The memory cell is selected by setting the ‘select’ line active. The data bit is written into the cell
by placing it on the ‘data in’ line and is read from the ‘data out’ line.
Storage Cell: All static RAM's are characterized by flip-flop storage cells that are typically
implemented with several MOS transistors (MOSFETS). Some smaller RAMS also implemented
using BJT's.
Asynchronous SRAM: In which the operation is not synchronized with a system clock.
Synchronous SRAM: A synchronous SRAM is synchronized with the system clock.
The burst feature in synchronous SRAM's: Synchronous SRAM's have an address burst feature,
which allow the memory to read (or) write at up to four locations using a single address.
Burst logic: The address burst logic in a typical synchronous SRAM consists of a binary counter
and EX-OR gates.
Application of SRAM:
Cache memory: It is a relatively small and high speed memory that stores the most recently
used instructions (or) data from the larger but slower main memory. It is very costly.
Dynamic RAM
The memory cell in the case of a DRAM comprises a capacitor and a MOSFET. The cell
holds a value of ‘1’ when the capacitor is charged and ‘0’ when it is discharged. The main
advantage of this type of memory is its higher density, or more bits per package, compared with
SRAM. This is because the memory cell is very simple compared with that of SRAM. Also, the
cost per bit is less in the case of a DRAM. The disadvantage of this type of memory is the leakage
of charge stored on the capacitors of various memory cells when they are storing a ‘1’. To
prevent this from happening, each memory cell in a DRAM needs to be periodically read, its
charge (or voltage) compared with a reference value and then the charge restored to the
capacitor. This process is known as ‘memory refresh’ and is done approximately every 5–10 ms.
130
GATE THE Direction Semiconductor Memory
Figure shows the basic memory cell of a DRAM and its principle of operation. The
MOSFET acts like a switch. When in the ‘write’ mode (R/W = 0, the input buffers are enabled
while the output buffers are disabled. When ‘1’ is to be stored in the memory, the ‘data in’ line
must be in the HIGH state and the corresponding ‘row line’ should also be in the HIGH state so
that the MOSFET is switched ON. This connects the MOSFET to the ‘data in’ line, and it charges
the capacitor to a positive voltage level. When ‘0’ needs to be stored, the ‘data in’ line is LOW
and the capacitor also acquires the same level. When the ‘row line’ is taken to the LOW state,
the MOSFET is switched OFF and is disconnected from the bit line. This traps the charge on the
capacitor. In ‘read’ mode (R/W = 1, the output buffers are enabled while the input buffers are
disabled. When the ‘row line’ is taken to HIGH logic, the MOSFET is switched ON and connects
the capacitor to the ‘data out’ line through the output buffer. The refresh operation is
performed by setting R/W = 1 and by enabling the refresh buffer.
Storage cell: It can store a data bit in a small capacitor rather than a latch. It having capacitors &
MOS transistors.
Disadvantages: The storage capacitor cannot hold its charge over an extended period of time
and will lose the stored data bit unless its charge is refreshed periodically. To refresh requires
additional memory circuit and complicated the operation of DRAM.
Types of DRAMS:
FPM DRAM: Fast Page Mode DRAM. The page in memory is all of the column address as
contained within one row address.
EDO DRAM: Extended data output DRAM. It is also called hyper page mode DRAM. The
difference between FPM DRAM & EDO DRAM is the access time "speed up in EDO DRAM".
131
GATE THE Direction Semiconductor Memory
In the case of ROM, instructions can be written into the memory only once at the
manufacturer’s premises. These instructions can, however, be read from a ROM as many times
as desired. Once it is written, a ROM cannot be written into again. The internal structure or
architecture of a ROM comprises three basic parts, namely the array of memory cells, the
address decoder and the output buffers. The address decoder comprises a single decoder in the
case of small memories. In the case of large memories it comprises two decoders referred to as
row and column decoders. The operation of a ROM can be best explained with the help of the
simplified representation of a 32×8 ROM, as shown in figure.
The array of memory cells stores the data to be programmed into the ROM. The
number of memory cells in a row equals the word size, and the number of memory cells in a
column equals the number of such words to be stored. In the memory shown in Figure, the word
size is eight bits and the number of words is 32. The data outputs of each of the memory cells in
the array are connected to an internal data bus that runs through the entire circuit. The address
decoder, a 1-of-32 decoder in this case, sets the corresponding ‘row line’ HIGH when a binary
address is applied at its input lines. A five-bit address code (A4A3A2A1A0) is needed to address 32
memory cells.
132
GATE THE Direction Semiconductor Memory
Mask ROM:
ROMs can use look up tables (LUT's) for code conversions and logic function generation.
PROM: PROM's are same as mask ROM's, once they have been programmed. The difference is
that PROM's come from manufacturer un programmed and are custom programmed in the field
to meet the user's needs.
Once a PROM is programmed it cannot be changed. Cells: MOS transistors with fusible links.
EPROM (Erasable Programmed ROM): Unlike an ordinary PROM, EPROM can be reprogrammed
if an existing program in the memory array is erased first.
UVEPROM: Ultra Violet EPROM: Here erase can be done by exposure of the memory array chip
to high intensity UV radiation through quartz window on top of the package.
The memory cell in a UV EPROM is a MOS transistor with a floating gate. UV EPROMs suffer from
disadvantages such as the need to remove the chip from the circuit if it is to be reprogrammed,
the non feasibility of carrying out selective erasure and the reprogramming process taking
several tens of minutes. These are overcome in the EEPROMs.
EEPROM: Electrically Erasable PROM's can be both erased and programmed with electrical
pulses. The memory cell of an EEPROM is also a floating-gate MOS structure with the slight
modification that there is a thin oxide layer above the drain of the MOS memory cell. Application
of a high-voltage programming pulse between gate and drain induces charge in the floating-gate
region which can be erased by reversing the polarity of the pulse. Since the charge transport
mechanism requires very low current, erasing and programming operations can be carried out
without removing the chip from the circuit. EEPROMs have another advantage that, it is possible
to erase and rewrite data in the individual bytes in the memory array. The EEPROMs, however,
have lower density and higher cost compared with UV EPROMs.
Two types of EEPROMs: (1) Floating gate MOS (2) Metal Nitride - Oxide silicon (MNOS)
Flash memory: These are high density read/ write memories that are non volatile.
133
GATE THE Direction Semiconductor Memory
Comparison of Memories:
One IN-System
Memory Type Nonvolatile High density
transistor Cell writability
Memory Expansion:
Available memory can be expanded to increase word length (number of bits in each address) or
the word capacity (number of different addresses) or both Memory expansion is accomplished
by adding an appropriate number of memory chips to the address ,data, and control busses.
Word-length expansion : - To increase word length in memory the number of bits in the data
bus must be increased.
Ex : - An 8 bit word length can be achieved using two memories, each with 4 - bit words.
134
GATE THE Direction Semiconductor Memory
When memories are expanded to increase the word capacity the number of addresses is
increased.
Each individual memory has 20 address bits to select 1,048,576 address. The expanded memory
has 2,097,152 addresses requires 21 address bits. The 21st address bit is used to enable
appropriate memory chip.
135
GATE THE Direction Semiconductor Memory
Points to remember: -
(2) Primary memories are semiconductor memories. They available in the form of IC's with
different memory capacities.
(4) The no. of address bits required to identify 2 n memory locations are ‘n'.
(5) To increase the bit capacity (or) length of each memory location, memory IC's connected
in parallel.
Ex: 1024 x 8 - memory capacity can be obtained by using '2' IC's of memory capacity 1024x4.
5. To increase the no. of memory locations, the memory IC's connected such that at any
time only one memory IC must be selected.
Ex: - To get 4k x 8 memory capacity: it is required to use four 1k x 8 IC's and at any time one of
the four memory IC's can be selected using decoder.
6. The number of memory IC's of capacity 1k x 4 required to construct a 8k x 8 are 16. (16
memory IC's of 1 k x 4 capacity).
𝐫𝐞𝐪𝐮𝐢𝐫𝐞𝐝 𝐦𝐞𝐦𝐨𝐫𝐲 𝐬𝐢𝐳𝐞
𝐧𝐮𝐦𝐛𝐞𝐫 𝐨𝐟 𝐦𝐞𝐦𝐨𝐫𝐲 𝐈𝐂 ′ 𝐬 =
𝐚𝐯𝐚𝐢𝐥𝐚𝐛𝐥𝐞 𝐦𝐞𝐦𝐨𝐫𝐲 𝐬𝐢𝐳𝐞
7. Access time : It is the time for a memory to access a memory location for reading or writing.
9. Random access : If the access time is independent of position of memory location called
Random access. The access time of every memory location is same eg. RAM.
10. Sequential access : A memory in which the locations can be accessed in a sequence. eg.
magnetic tape, magnetic bubble.
136
GATE THE Direction Semiconductor Memory
11. SRAM : The data stored in terms of voltage. Storage cells are conventional flip flops.
12. DRAMs: The data stored in form of charge on capacitor. Storage cells are - charge storage
capacitors with driver transistors. SRAMs are faster than DRAMs.
Magnetic memories: -
Access time: The access time of a magnetic drum defined as the sum of seek time & transfer
time.
Seeking time: It is the time for moment of read/write head to the desired track.
Magnetic hard disks: Computers use hard disks as the internal mass storage media. Hard disks
are rigid "platters" made up of aluminum alloy (on formatted into tracks and sectors. Each track
divided into number sectors, and each track and sector has a physical address that is used by the
OS to locate a particular data record.
Latency period: It is the time takes for the desired sector to spin under the head is positioned
over the desired track.
Floppy disks: It is made up of a flexible polyester material with a magnetic coating on both
sides. Floppy disks are formatted into tracks, sectors like hard disks. Floppy disks are removable
disks but hard disks are not.
Magnetic tape: Tape is used for backup data from mass storage devices and is typically slower
than disks because data on tape is accessed serially rather than randomly.
Points to remember :
1. Destructive Read out memory (DRO): If the reading method destroys its contents that
memory called DRO. For such memories each read operation must be followed by write
operation to restore the contents eg. Magnetic core.
2. Non destructive Read out: (NDRO) if the read operation does not change its contents eg.
Magnetic tapes, disks, RAMS, ROMs.
137
GATE THE Direction Semiconductor Memory
Problems:
1) SD RAM refers to
A) Synchronous DRAM B) Static DRAM
C) Semi DRAM D) Second DRAM
2) Which of the following is true with respect to EEPROM?
A) Contents can be erased byte wise
B) Contents of full memory can be erased together only
C) Contents can be erased using ultra violet rays
D) Contents cannot be erased
3) Which of the memory is volatile memory
5) The minimum number of MOS transistor require for dynamic ram cell
A) 1 B) 2 C) 3 D) 4
6) Eight memory chip of 1k x 4 size have their address buses connected together. This system
will be of size
A) 8k x 4 B) 1k x 32 C) 4k x 16 D) 8k x 32
7) The number of address bus of memory size 1k x 4 is
A) 8 B) 9 C) 10 D) 11
8) Find the number of 1k x 8 memory chip require for designing of 4k x 16 memory chip
A) 4 B) 8 C) 16 D) 12
9) The access time of ROM using bipolar transistors is about
10) Words having 8-bits are to be stored into computer memory. The number of lines required
for writing into memory are
A) 1 B) 2 C) 4 D) 8
12) Which of the following memories stores the most number of bits
138
GATE THE Direction Semiconductor Memory
14) Which of the following number of address bits can use to access a 32 K memory
Answers:
1. A 2. A 3. B 4. D 5. A 6. B 7. C 8. B 9. C
10. D 11. A 12. D 13. B 14. D 15. B 16. B 17. D 18. B
139
GATE THE Direction Microprocessor
CHAPTER VIII
MICROPROCESSOR
Microprocessor:
Internal Architecture of 8085 Microprocessor
Control Unit: Control unit generates signals with in uP to carry out the instruction, which has
been decoded. In reality causes certain connections between blocks of the uP to be opened or
closed, so that data goes where it is required, and so that ALU operations occur.
Arithmetic Logic Unit: The ALU performs the actual numerical and logic operation such as
‘add’, ‘subtract’, ‘AND’, ‘OR’, etc. It uses data from memory, resister and from Accumulator to
perform arithmetic and logical operation. It is always stores result of operation in Accumulator.
Registers: The 8085A-programming model includes six registers, one accumulator, and one
flag register, as shown in Figure. In addition, it has two 16-bit registers: the stack pointer and
the program counter. They are described briefly as follows. The 8085A has six general-purpose
registers to store 8-bit data; these are identified as B,C,D,E,H, and L as shown in the figure. They
can be combined as register pairs - BC, DE, and HL - to perform some 16-bit operations. The
140
GATE THE Direction Microprocessor
programmer can use these registers to store or copy data into the registers by using data copy
instructions.
Accumulator: The accumulator is an 8-bit register. This register is used to store 8-bit data and
to perform arithmetic and logical operations. The result of an operation is stored in the
accumulator. The accumulator is also identified as register A. It is generally used in every ALU
operation.
Flags: There are five flags, which are set or reset after an operation according to data
conditions of the result in the accumulator.
Zero (Z), Carry (CY), Sign (S), Parity (P), Auxiliary Carry (AC)
They are listed in the Table and their bit positions in the flag register are shown in the Figure
below. The most commonly used flags are Zero, Carry, and Sign. The microprocessor uses these
flags to test data conditions. For example, after an addition of two numbers, if the sum in the
accumulator is larger than eight bits, the Carry flag uses to indicate a carry and Carry flag (CY) is
set to one. When an arithmetic operation results in zero, the flag called the Zero (Z) flag is set
to one. Five bit positions out of eight are used to store the outputs of the five flags. The flags
are stored in the 8-bit register so that the programmer can examine these flags (data
conditions) by accessing the register through an instruction.
These flags have critical importance in the decision-making process of the microprocessor. The
conditions (set or reset) of the flags are tested through the software instructions. For example,
the instruction JC (Jump on Carry) is implemented to change the sequence of a program when
CY flag is set. The thorough understanding of flag is essential in writing assembly language
programs. The flag resister show as:
S Z X AC X P X CY
D7 D6 D5 D4 D3 D2 D1 D0
Sign flag: In case of arithmetic operations with signed numbers, the most significant bit D 7 is
reserved to indicate sign information, and the remaining seven bits are used to represent the
magnitude of the number. After the execution of an arithmetic or logic operation, the MSB of
the result (usually in the accumulator) is copied into sign flag. S =1 indicates result is negative, S
= 0 indicates result is positive.
Zero flag: Z =1 if the ALU operation results in zero. Z=0 if the result is not zero.
Auxiliary carry flag: In an arithmetic operation, the carry obtained from D3 to D4 bit position is
called Auxiliary carry. This flag is used only internally for BCD operation and is not available for
the programmer to change the sequence of a program with a jump instruction.
141
GATE THE Direction Microprocessor
Parity flag: After ALU operation, the result has an even number of 1 's then P=1 otherwise P =
0.
Carry flag: If an arithmetic operation results in a carry, the carry flag is set i.e. CY=1, Otherwise
it is reset. The carry flag also serves as a barrow flag for subtraction.
Note: Among the five flags, the Ac flag is used internally for BCD arithmetic; the instruction set
does not include any conditional jump instructions based on this flag.
> Accumulator register content and status register content together is called PSW (Program
Status Word or processor status word)
PSW
Ex. Find the flag condition after the execution of the ADD B (i.e. A<---A+B)instruction. If A=6C H
and B = 49 H.
B = 49 +0100 1001
1011 0101
Program Counter (PC): This 16-bit register deals with sequencing the execution of
instructions. This register is a memory pointer. Memory locations have 16-bit addresses, and
that is why this is a 16-bit register. The microprocessor uses this register to sequence the
execution of the instructions.
The function of the program counter is to point to the memory address from which the
next byte is to be fetched.
Stack Pointer (SP): The stack pointer is also a 16-bit register used as a memory pointer. It
points to a memory location in R/W memory, called the stack register (stack). The beginning of
the stack is defined by loading 16-bit address in the stack pointer.
142
GATE THE Direction Microprocessor
Memory Address Register: It is holds address, received from PC, of next program
instruction.
Address Bus: The Address Bus consists of 16 wires, therefore 16 bits. Its "width" is 16 bits. A
16 bit binary number allows 216 different numbers (ie 0000000000000000 up to
1111111111111111). Each and every memory has unique address; the size of the address bus
determines number of different memory location, which can be used. To communicate with
memory the microprocessor sends an address on the address bus, eg 0000000000000011 (3 in
decimal), to the memory. It will select the memory location 3 for reading or writing data.
Question: If you have a memory chip of size 256 kilobytes (256 x 1024 x 8 bits), how many wires
does the address bus need, in order to be able to specify an address in this memory? Note: the
memory is organized in groups of 8 bits per location, therefore, how many locations must you
be able to specify?
Answer: The total 256 x 1024 different locations are available. So we require address bus width
(n) as 2n ≥ 256X1024 therefore n=18
Data Bus: It carries ‘data’, in binary form, between μP and other external units, such as
memory. Its size is 8 bits for uP 8085A. Data bus Size indicates the size of μP and so it helps to
determine performance of μP. Data bus used to transmit "data", ie information, results of
arithmetic, etc, between memory and the microprocessor. Data Bus is bi-directional. The size of
the data bus determines range of arithmetic can be done. If only 8 bits wide then largest
number is 11111111 (255 in decimal). Data Bus also carries instructions from memory to the
microprocessor so size of the bus also limits the number of possible instructions to 256.
Control Bus: Control Bus are various lines which have specific functions for coordinating and
controlling uP operations. Eg: Read/Write line. Typically μP has 10 control lines. The Up cannot
function correctly without these vital control signals. The Control Bus carries control signals
partly unidirectional, partly bi-directional.
143
GATE THE Direction Microprocessor
Single + 5V Supply
Five hardware interrupt From which 4 Vectored Interrupts (One is Non Maskable)
Serial In/Serial Out Port
Decimal, Binary, and Double Precision Arithmetic
Direct Addressing Capability to 64K bytes of memory
The 8085A uses a multiplexed lower byte address and data bus.
Pin Description
The following describes the function of each pin:
A8 - A15 (Output) : Address Bus; The most significant 8 bits of the memory address or the 8
bits of I/0 addresses.
ALE (Output): Address Latch Enable (ALE) occurs during the first clock cycle of a machine
state and enables the address to get latched into the on chip latch of peripherals. The falling
edge of ALE is set to guarantee setup and hold times for the address information. ALE can also
be used to strobe the status information.
S0, S1 (Output): Data Bus Status. Encoded status of the bus cycle:
S1 S0
0 0 HALT
0 1 WRITE
1 0 READ
1 1 FETCH
RD (Output): READ; indicates the selected memory or I/O device is to be read and that the
Data Bus is available for the data transfer.
WR (Output): WRITE; indicates the data on the Data Bus is to be written into the selected
memory or I/O location. Data is set up at the trailing edge of WR.
144
GATE THE Direction Microprocessor
READY (Input): If Ready is high during a read or write cycle, it indicates that the memory or
peripheral is ready to send or receive data. If Ready is low, the CPU will wait for Ready to go
high before completing the read or write cycle.
HOLD (Input): HOLD; indicates that another Master is requesting the use of the Address and
Data Buses. It will relinquish the use of buses as soon as the completion of the current machine
cycle. Internal processing can continue. The processor can regain the buses only after the Hold
is removed.
HLDA (Output): HOLD ACKNOWLEDGE; indicates that the CPU has received the Hold request
and that it will relinquish the buses in the next clock cycle. HLDA goes low after the Hold
request is removed. The CPU takes the buses one half clock cycle after HLDA goes low.
INTR (Input): INTERRUPT REQUEST; is used as a general purpose interrupt. If it is active, the
Program Counter (PC) will be inhibited from incrementing and an INTA will be issued. During
this cycle a RESTART or CALL instruction can be inserted to jump to the interrupt service
routine. The INTR is enabled and disabled by software. It is disabled by Reset.
INTA (Output): INTERRUPT ACKNOWLEDGE; is used instead of (and has the same timing as)
RD during the Instruction cycle after an INTR is accepted. It can be used to activate the 8259
Interrupt chip or some other interrupt port.
RESET IN (Input):
Reset sets the Program Counter to zero and resets the Interrupt Enable and HLDA flip-flops.
None of the other flags or registers (except the instruction register) are affected. The CPU is
held in the reset condition as long as Reset is applied.
RESET OUT (Output): Indicates CPU is being reset. It can be used as a system RESET. The
signal is synchronized to the processor clock.
X1, X2 (Input): Crystal or R/C network connections to set the internal clock generator X1, X2
can also be an external clock input instead of a crystal. The external input frequency is divided
by 2 to give the internal operating frequency.
CLK (Output): It use as a system clock when a crystal or R/ C network is used as an input to
the CPU. The period of CLK is twice the X1, X2 input period.
IO/𝑴 (Output): IO/𝑀 indicates whether the Read/Write is to memory or I/O (0 for memory
and 1 for I/O). It will be tristated during Hold and Halt modes.
SID (Input): Serial input data line, the data on this line is loaded into accumulator bit 7
whenever a RIM instruction is executed.
SOD (output): Serial output data line. The output SOD is set or reset as specified by the SIM
instruction.
145
GATE THE Direction Microprocessor
Interrupts:
Hardware interrupts are used by devices to communicate that they require attention
from the operating system. Internally, hardware interrupts are implemented using electronic
alerting signals that are sent to the processor from an external device, which is either a part of
the computer itself, such as a disk controller, or an external peripheral. For example, pressing a
key on the keyboard or moving the mouse triggers hardware interrupts that cause the
processor to read the keystroke or mouse position.
The 8085A has five hardware interrupt namely: INTR, RST5.5, RST6.5, RST 7.5, and
TRAP. INTR is identical in function to the 8080 INT. Each of the three RESTART interrupt, 5.5, 6.5
and 7.5, has a programmable mask. TRAP is also a RESTART interrupt except it is non-maskable.
The three RESTART interrupts cause the internal execution of RST (saving the program counter
in the stack and branching to the RESTART address) if the interrupts are enabled and if the
interrupt mask is not set. The non-maskable TRAP causes the internal execution of a RST
independent of the state of the interrupt enable or masks. The interrupts are arranged in a
fixed priority that determines which interrupt is to be recognized if more than one is pending as
follows: TRAP highest priority, RST 7.5, RST 6.5, RST 5.5, INTR lowest priority. The TRAP
interrupt is useful for catastrophic errors such as power failure or bus error. The TRAP input is
recognized just as any other interrupt but has the highest priority. It is not affected by any flag
or mask. The TRAP input is both edge and level sensitive.
146
GATE THE Direction Microprocessor
Maskable interrupt (MI): a hardware interrupt that may be ignored by setting a mask bit in
SIM instruction.
Vector address interrupt: If the address of subroutine is predefine after the occurrence of
interrupt then its called as vector address interrupt.
All the interrupts are presented below in the order of their priority (from lowest to highest):
One of the eight software RST n instructions (RST0 - RST7). The processor saves current
program counter into stack and branches to memory location N * 8 (where N is a 3-bit
number from 0 to 7 supplied with the RST instruction).
CALL instruction (3 byte instruction) The processor calls the subroutine, address of
which is specified in the second and third bytes of the instruction.
RST5.5 is a maskable, vector address interrupt. When this interrupt is received the processor
saves the contents of the PC register into stack and branches to (vector address) 2C H address.
It is level sensitive interrupt.
RST6.5 is a maskable, vector address interrupt. When this interrupt is received the processor
saves the contents of the PC register into stack and branches to 34 H (vector address). It is level
sensitive interrupt.
RST7.5 is a maskable, vector address interrupt. When this interrupt is received the processor
saves the contents of the PC register into stack and branches to 3C H (vector address). It is edge
sensitive interrupt.
Trap is a non-maskable, vector address interrupt. When this interrupt is received the processor
saves the contents of the PC register into stack and branches to 24 H (vector address). It is both
level and sensitive interrupt.
All maskable interrupts can be enabled or disabled using EI and DI instructions. RST 5.5, RST6.5
and RST7.5 interrupts can be enabled or disabled individually using SIM instruction.
147
GATE THE Direction Microprocessor
RST 0 0000 H
RST 1 0008 H
RST 2 0010 H
RST 3 0018 H
RST 4 0020 H
RST 5 0028 H
RST 6 0030 H
RST 7 0038 H
148
GATE THE Direction Microprocessor
> SIM instruction is used for serial output data operation as well as to mask or unmask
different maskable vectored Interrupts
> RIM instruction is used for serial input data operation as well as to read the status of
different Maskable and pending Vectored interrupts
> 8085 is having 8 - bit flag register which is also called status register
The 8085A provides RD, WR, and lO/Memory signals for bus control. An Interrupt
Acknowledge signal (INTA) is also provided. Hold, Ready, and all Interrupts are synchronized.
The 8085A also provides serial input data (SID) and serial output data (SOD) lines for simple
serial interface. In addition to these features, the 8085A has three maskable, restart interrupts
and one non-maskable trap interrupt. The 8085A provides RD, WR and IO/M signals for Bus
control.
Status Information: Status information is directly available from the 8085A. ALE serves as a
status strobe. The status is partially encoded, and provides the user with advanced timing of
the type of bus transfer being done. IO/M cycle status signal is provided directly. So, S1 carries
the status information: halt, write, read,
fetch.
149
GATE THE Direction Microprocessor
System Interface:
8085A family includes memory components, which are directly compatible to the 8085A CPU.
For example, a system consisting of the three chips, 8085A, 8156, and 8355 will have the
following features:
· 2K Bytes ROM
· 1 Timer/Counter
· 4 Interrupt Levels
In addition to standard I/O, the memory mapped I/O offers an efficient I/O addressing
technique. With this technique, an area of memory address space is assigned for I/O address,
thereby, using the memory address for I/O manipulation. The 8085A CPU can also interface
with the standard memory that does not have the multiplexed address/data bus.
1. Immediate addressing.
2. Register addressing.
3. Direct addressing.
4. Indirect addressing.
5. Implied addressing.
Example: MVI rd, data (8 bit); LXI rp, data (16 bit)
150
GATE THE Direction Microprocessor
Indirect Addressing: The address of operand is present in the resister pair and that resister
pair is given in the instruction (by default take it as HL pair).
Implied addressing: In this type of instruction neither immediate data nor address and not
any resister is mention in instruction. The instruction contains only Mnemonics. It is generally
do operation on accumulator.
Instruction Format:
An instruction is a command to the microprocessor to perform a given task on a
specified data. Each instruction has two parts: one is task to be performed, called the operation
code (opcode), and the second is the data to be operated on, called the operand. The operand
(or data) can be specified in various ways. It may include 8-bit (or 16-bit) data, an internal
register, a memory location, or 8-bit (or 16-bit) address.
One-Byte Instructions:
A 1-byte instruction includes the opcode and operand in the same byte. Operand(s) are internal
register or data in memory whose address is given by register pair, Which are coded into the
instruction.
For example:
151
GATE THE Direction Microprocessor
These instructions are 1-byte instructions performing three different tasks. In the first
instruction, both operand registers are specified. In the second instruction, the operand B is
specified and the accumulator is assumed. Similarly, in the third instruction, the accumulator is
assumed to be the implicit operand. These instructions are stored in 8- bit binary format in
memory; each requires one memory location.
rd <-- rs copies contents of rs into rd. It will coded as 01 ddd sss where ddd is a code for one of
the 7 general registers which is the destination of the data, sss is the code of the source
register.
ADD r;
A <-- A + r
Two-Byte Instructions:
In a two-byte instruction, the first byte specifies the operation code and the second byte
specifies the operand. Source operand is a data byte immediately following the opcode. For
example:
Example:
a. MVI r, data
152
GATE THE Direction Microprocessor
r <-- data
It will coded as (3E 30) H as two contiguous bytes. This is an example of immediate addressing.
b. ADI data
A <-- A + data
OUT port: where port is an 8-bit device address. (Port) <-- A. Since the byte is not the data but
points directly to where it is located this is called direct addressing.
Three-Byte Instructions
In a three-byte instruction, the first byte specifies the opcode, and the following two bytes
specify the 16-bit address or 16-bit data. Note that the second byte is the low-order address or
data and the third byte is the high-order address or data. Opcode + data byte + data byte
For example:
rp is one of the pairs of registers BC, DE, HL used as 16-bit registers. Example:
a. LXI H, 0520H coded as 21H 20H 05H in three bytes. This is also immediate addressing. (where
21H is corresponding to opcode of LXI H, data)
b. LDA addr
Example: LDA 2134H coded as 3AH 34H 21H. This is also an example of direct addressing.
153
GATE THE Direction Microprocessor
the microprocessor can perform. These instructions can be classified into the following five
functional categories: data transfer (copy) operations, arithmetic operations, logical operations,
branching operations, and machine-control operations.
The various types of data transfer (copy) are listed below together with examples of each type:
Types Examples
1. Between Registers 1. Copy the content of the register B into
register D.
MOV D,B
2. Specific data byte to a register or a 2. Load register B with the data byte 32H
memory location MVI B, 32H
I. Arithmetic Operations:
These instructions perform arithmetic operations such as addition, subtraction, increment, and
decrement.
Addition: Any 8-bit number, or the contents of a register or the contents of a memory
location can be added to the contents of the accumulator and the sum is stored in the
accumulator. No two other 8-bit registers can be added directly (e.g., the contents of register B
cannot be added directly to the contents of the register C). The instruction DAD is an exception;
it adds 16-bit data directly in register pairs.
Subtraction: Any 8-bit number, or the contents of a register, or the contents of a memory
location can be subtracted from the contents of the accumulator and the results stored in the
accumulator. The subtraction is performed in 2's compliment, and the results if negative, are
expressed in 2's complement. No two other registers can be subtracted directly.
154
GATE THE Direction Microprocessor
AND, OR, Exclusive-OR: Any 8-bit number, or the contents of a register, or of a memory
location can be logically ANDed, Ored, or Exclusive-ORed with the contents of the accumulator.
The results are stored in the accumulator.
Rotate: Each bit in the accumulator can be shifted either left or right to the next position.
Compare: Any 8-bit number, or the contents of a register, or a memory location can be
compared for equality, greater than, or less than, with the contents of the accumulator.
Complement: The contents of the accumulator can be complemented. All 0s are replaced by
1s and all 1s are replaced by 0s.
Jump: Conditional jumps are an important aspect of the decision-making process in the
programming. These instructions test for a certain conditions (e.g., Zero or Carry flag) and alter
the program sequence when the condition is met. In addition, the instruction set includes an
instruction called unconditional jump.
Call, Return, and Restart: These instructions change the sequence of a program either by
calling a subroutine or returning from a subroutine. The conditional Call and Return instructions
also can test condition flags.
1. Copying data
155
GATE THE Direction Microprocessor
1. In data transfer, the contents of the source are not destroyed; only the contents of the
destination are changed. The data copy instructions do not affect the flags.
2. Arithmetic and Logical operations are performed with the contents of the accumulator, and
the results are stored in the accumulator (with some expectations). The flags are affected
according to the results.
3. Any register including the memory can be used for increment and decrement.
4. A program sequence can be changed either conditionally or by testing for a given data
condition.
Data transfer instructions: These instructions are used to transfer data from register to
register, register to memory or from memory to register. No flags will be affected for these
instructions. r1, r2, r can be any one out of B, C, D, E, H, L, A and r p can be any one out of three
register pairs BC, DE & HL.
STAX rp
Arithmetic Instructions: This group consists of addition, subtraction, increment and decrement
operations. 8085 microprocessor does not support multiplication and division instructions
156
GATE THE Direction Microprocessor
DAA
> In 8085, the service of AC flag is used by only one instruction. It is DAA.
> Following table shows the list of flags affected for different instructions
Instruction S Z Ac P Cy
DAD No No No No Yes
ADD, ADC, SUB, SBB, DAA Yes Yes Yes Yes Yes
157
GATE THE Direction Microprocessor
Logical Instructions: This group consists of AND, OR, NOT, XOR, Compare and Rotate perations
CMP r (A) r)
CMPM (A) (M)
CPI 45 (A) 45
CMA (A) ( A)
CMC Cy 𝐶𝑦
STC Cy 1
Following table shows how flags affected for different logical instructions
Instruction S Z Ac P Cy
158
GATE THE Direction Microprocessor
CMA No No No No No
Branch Instructions: These are also called program control transfer instructions. These are two
types: Un conditional branch and Conditional Branch instructions
RET
RST n (n = 0 to 7)
PCHL
Machine Control, Stack and IO related Instructions: No flags affected for these instructions.
159
GATE THE Direction Microprocessor
Stack related:
PUSH PSW
POP rp
POP PSW
SPHL
IO Related:
160
GATE THE Direction Microprocessor
Instruction table:
161
GATE THE Direction Microprocessor
COMPARISION OF PUSH AND POP INSTRUCTIONS WITH CALL AND RET INSTRUCTIONS
The instructions PUSH and POP are similar to the instructions CALL and RET. The Similarities and
differences are as follows:
162
GATE THE Direction Microprocessor
When PUSH is executed, the stack pointer When CALL is executed, the stack pointer
register is decremented by two register is decremented by two
The instruction POP transfers the contents of The instruction RET transfers the contents of the
the top two locations of the stack to the top two locations of the stack to Program
specified register pair. counter
When the instruction POP is executed the When the instruction RET is executed, the stack
stack pointer is incremented by two pointer is incremented by two
There are no conditional PUSH and POP In addition to the unconditional CALL and RET
instructions. instructions, there are eight conditional CALL
and RETURN instructions
Sample Programs
1) Write an assembly program to add two numbers 8B and 6F H and store result at port 1.
Program
MVI D, 8BH
MVI C, 6FH
MOV A, C
ADD D
OUT PORT1
HLT
2) Write an assembly program to multiply a number by 8 and store result at port 1.
Program
MVI A, 30H
RRC
RRC
RRC
OUT PORT1
HLT
3) Write an assembly program to find greatest between two numbers and send to port 1. If
both numbers are same then send 00 H to port 1.
Program
MVI B, 30H
MVI C, 40H
MOV A, B
163
GATE THE Direction Microprocessor
CMP C
JZ EQU
JC GRT
OUT PORT1
HLT
EQU: MVI A, 00H
OUT PORT1
HLT
GRT: MOV A, C
OUT PORT1
HLT
> Each instruction cycle of the 8085 microprocessor can be divided into a few basic
operations called machine cycles, and each machine cycle can be divided into T-states.
Machine cycle: It is defined as the time required to complete the operation of accessing
either memory or I/O. In the 8085, the machine cycle may consist of three to six T-states.
> T-state is defined as one sub-division of the operation performed in one clock-period.
> The time required to complete the execution of an instruction is called instruction cycle.
> The 8085 instruction cycle consists of one to five machine cycles or one to five
operations.
> The first machine cycle of 8085 consists of four or six T-states and all other subsequent
machine cycles consist of three T-states only.
> Read or write signal is generated at the beginning of T2 and will be completed before the
end of T3 in every machine cycle.
> Types of machine cycles of 8085 : Op Code fetch cycle, Memory read cycle, Memory
write cycle, I/O read cycle, I/O write cycle, Interrupt acknowledge machine cycle and Bus
idle machine cycle.
> The first machine cycle of each instruction cycle is always Op Code fetch machine cycle.
> In 8085, CALL instruction is the lengthy instruction which takes 18-T states and the
shortest instruction takes only 4-T states (Ex: MOV A,B ).
> One machine is essential for each and every instruction. Other machine cycles depends on
operation of the instruction.
> ALE signal is generated during T1 state of each machine cycle since at that time lower order
data is available on multiplex AD0 to AD7 bus.
164
GATE THE Direction Microprocessor
MOV r1 r2 1-opcode 4
XCHG 1-opcode 4
165
GATE THE Direction Microprocessor
STACK OPS
SPHL 1-opcode 6
JUMP
166
GATE THE Direction Microprocessor
CALL
RETURN
RESTART
INPUT/OUTPUT
167
GATE THE Direction Microprocessor
INR r 1-opcode 4
DCR r 1-opcode 4
INX B 1-opcode 6
INX D 1-opcode 6
INX H 1-opcode 6
INX SP 1-opcode 6
DCX B 1-opcode 6
DCX D 1-opcode 6
DCX H 1-opcode 6
DCX SP 1-opcode 6
ADD
ADD r 1-opcode 4
ADC r 1-opcode 4
DAD B 10
DAD D 10
DAD H 10
DAD SP 10
168
GATE THE Direction Microprocessor
SUBTRACT
SUB r 1-opcode 4
SBB r 1-opcode 4
LOGICAL
ANA r 1-opcode 4
XRA r 1-opcode 4
ORA r 1-opcode 4
CMP r 1-opcode 4
ROTATE
RLC 1-opcode 4
RRC 1-opcode 4
RAL 1-opcode 4
169
GATE THE Direction Microprocessor
RAR 1-opcode 4
SPECIALS
CMA 1-opcode 4
STC 1-opcode 4
CMC 1-opcode 4
DAA 1-opcode 4
CONTROL
EI 1-opcode 4
DI 1-opcode 4
NOP 1-opcode 4
HLT 5
RIM 1-opcode 4
SIM 1-opcode 4
Where MR: memory read, Mw: memory write, IOR: I/O read, IOW: I/O write.
In memory mapped I/O, MEMR and MEMW control signals are used to activate I/O devices. In
memory mapped I/O, the entire memory map is shared by memory locations and I/O devices.
One address can be used by once. This technique is used in a system where the numbers of I/O
170
GATE THE Direction Microprocessor
devices are less. The maximum number of I/O devices can be connected to microprocessor in
this technique are 65536.
In this technique I/O mapping is independent of memory mapping. Same address can be used
to identify input device and output device. This technique is used in a system where numbers of
I/O devices are more. By using this method a maximum of 256 input devices & 256 output
devices can be connected to the processor (total of 512 I/O devices).
Interfacing:
Designing hardware circuit and writing software instruction to enable the
microprocessor to communicate with peripheral devices is called interfacing. And the hardware
circuit is called the interfacing devices.
Programmable interfacing devices: writing a specific word, called the control word,
according to the internal logic, can program a programmable interfacing device.
1. 8155- Programmable Peripheral Interfacing (PPI) device with 256 bytes RAM and 16-bit
timer/counter. It is a general purpose interfacing device i.e. it can be used to interface
variety of I/O devices to the microprocessor.
2. 8255- PPI. It is also called programmable interface adapter (PIA). It consist of three 8-bit
ports.
3. 8253- Programmable Interval Timer. It can work in six different modes.
Mode 0- Interrupt on terminal count
Mode 1- Programmable one shot
Mode 2- Rate generator
Mode 3- Square wave generator
Mode 4- Software Triggered strobe
Mode 5- Hardware Triggered strobe
4. 8251- Programmable communication interfacing device. It is also called USART (universal
synchronous Asynchronous receiver transmitter).
171
GATE THE Direction Microprocessor
5. 8257- Programmable DMA (Direct memory access) controller, DMA transfer is an I/O
technique used commonly for high speed data transfer. The 8257 is a four channel DMA
controller.
6. 8259- Programmable Interrupt Controller (PIC). It is equivalent to providing eight INTR
pins on 8085 microcontroller. By using nine 8259 IC’s it is possible to connect a maximum
of 64 I/O devices to the microprocessor with interrupt driven data transfer mode.
7. 8272- Programmable floppy disk controller
8. 8275- Programmable CRT controller
9. 8179- Programmable keyboard and display interfacing device. By using this it is possible
to connect sixteen seven segment display and sixty four keys (8 x 8 matrix) to the
microprocessor.
172
GATE THE Direction Microprocessor
Problems:
1) In a DMA write operation the data is transferred
2) A certain SRAM has 𝐶𝑆 = 0 ,𝑊𝑅 = 0 and 𝑅𝐷 = 1. In which of the following modes this SRAM
is operating.
3) Number of the times the instruction sequence below will loop before coming out of loop is
MVI A, 00 H
A1: INC A
JNZ A1
4) What will be the contents of register AL after the following has been executed
MVI B, 8C H
MVI A, 7E H
ADD A, B
173
GATE THE Direction Microprocessor
7) Which microprocessor pins are used to request and acknowledge a DMA transfer?
A) 13 B) 14 C) 15 D) 16
10) While an instruction is executed, the program counter should contain the address of
A) the current instruction B) the next sequential instruction
C) the operand D) the previous instruction
11) Static RAM
A) is a volatile memory B) is a non-volatile memory
C) needs refreshing to retain value D) cannot be modified
12) The duration of one T-state in the 8085 microprocessor that uses a crystal of 5 MHz is
A) 0.2us B) 0.4us C) 2.5us D) 5us
13) An instruction of the 8085 microprocessor that requires both memory read and memory
write machine cycle is
A) MVI M, 8F B) LHLD 8088 C) RST1 D) ADD M
14) An arithmetic operation of 8085 microprocessor sets the sign and parity flags. The content
of the accumulator after the execution of the operation can be
A) 1011 0100 B) 0010 1101 C) 1010 1101 D) 0110 0111
15) The contents of the HL register pair after the execution of the following program on the
8085 are
LXI H, 2095 H
LXI B, 8FBF H
LXI SP, 9FFF H
PUSH B
XTHL
POPH
HLT
16) The contents of the Accumulator after the execution of the following program on the 8085
are
XRA A
MVI B, F0 H
SUB B
174
GATE THE Direction Microprocessor
17) The 8085 assembly language instruction that stores the content of L and H registers into
the memory locations 2050H and 2051H respectively is
A) SPHL 2050H B) SPHL 2051H C) SHLD 2050H D) STAX 2050H
18) A memory system has a total of 8 memory chips, each with 12 address lines and 4 data
lines. The total size of the memory system is
A) 16kbytes B) 32kbytes C) 48kbytes D) 64kbytes
19) Which one of the following is not a vectored interrupt?
A) TRAP B) INTR C) RST 7.5 D) RST 6.5
20) In an 8085 microprocessor, after the execution of XRA A instruction
A) the carry flag is set B) the accumulator contains FF H
C) the zero flag is set D) the accumulator contents are shifted by one bit
21) An 8085 assembly language program is given as follows. The execution time of each
instruction is given against the instruction in terms of T-state.
Instructions T-states
MVI B, 0A H 7T
LOOP: MVI C, 05H 7T
DCR C 4T
DCR B 4T
JNZ LOOP 10T/7T
The execution time of the program in terms of T-states is
A) 247 T B) 250 T C) 254 T D) 257 T
22) In an INTEL 8085 microprocessor the address bus and data bus are
A) Non-multiplexed B) Multiplexed
C) Duplicated D) same as control bus
23) Which of the following microprocessor has a 16-bit data bus?
A) 8085 B) Z-80 C) 68000 D) 6502
24) The address bus of any microprocessor is always
A) Unidirectional B) Bi-directional
C) Either unidirectional or bi-directional D) None
25) The number of hardware interrupt present in 8085 microprocessor are
A) 5 B) 8 C) 10 D) 16
26) Identify the non-maskable interrupt from the following
A) RST 7.5 B) RST 6.5 C) RST 5.5 D) RST 4.5
27) Maximum number of either input or output devices that can be addressed by 8085 in I/O
map I/O is
A) 65,536 B) 255 C) 512 D) 256
28) The interrupt vector address for TRAP is
A) 0000H B) 0024H C) 0018H D) 002CH
29) During OPCODE fetch the state of S0 and S1 is
A) 00 B) 01 C) 10 D) 11
30) The interrupt which is only edge-triggered is
A) INTR B) TRAP C) RST 7.5 D) RST 5.5
31) Consider the following loop
XRA A
175
GATE THE Direction Microprocessor
LXI B ,0007H
LOOP: DCX B
JNZ LOOP
HLT
The loop will be executed
A) 1 TIMES B) 2 TIMES C) 7 TIMES D) INFINITE TIMES
Answers:
1. A 2. B 3. D 4. A 5. B 6. B 7. C 8. A 9. A
10. B 11. A 12. B 13. A 14. A 15. A 16. D 17. C 18. A
19. B 20. C 21. C 22. B 23. C 24. A 25. A 26. D 27. D
28. B 29. D 30. C 31. A
176
GATE THE Direction Microprocessor
4. A microcomputer consists of
(a) a microprocessor (b) memory (c) I/O devices (d) all of the above
5. A microprocessor consists of
(a) ALU (b) Control unit (c) array of registers (d) all of the above
10. The address bus width of a microprocessor which is capable of addressing 1K bytes of
memory is
(a) 10 (b) 12 (c) 16 (d) 20
11. The address bus width of a microprocessor which is capable of addressing 64K bytes of
memory is
(a) 8 (b) 12 (c) 16 (d) 20
12. The data bus width of a microprocessor which is capable of addressing 1M bytes of memory
is
(a) 16 (b) 8 (c) 20 (d) can not be predicated
177
GATE THE Direction Microprocessor
14. A number of 1-bit registers used in microprocessors to indicate certain conditions are
usually referred to as
(a) Shift registers (b) flags (c) latches (d) counters
15. A microprocessor has an 8-bit opcode. The maximum possible number of opcodes for this
microprocessor will be
(a) 256 (b)64 (c) 8 (d) 16
18. How many 16-bit special purpose registers are present in the 8085 microprocessor?
(a) 8 (b) 6 (c) 2 (d) 16
178
GATE THE Direction Microprocessor
32. An 8085 microprocessor uses a crystal of frequency 6.25 MHz . The T stale vaiue is
(a) 340ns (b) 640ns (c) 960ns (d) 1280ns
33. In an 8085 microprocessor based system, the contents of SP are 1000H. PUSH B instruction
will transfer the contents of registers B and C respectively for memory locations
179
GATE THE Direction Microprocessor
34. In an 8085 microprocessor based system, the contents of SP are 2000H. POPH instruction
will transfer the contents of memory location
(a) 2001H and 2002H to H and L registers respectively
(b) 2001H and 2000H to H and L registers respectively
(c) 2000H and 1FFFH to H and L registers respectively
(d) 2000H and 1999H to H and L registers respectively
37. In 8085 microprocessor, let the accumulator contains the value 0AH and register C contains
the value 05H. After CMPC instruction is executed, the
(a) zero and carry flags will be set
(b) zero and carry flags will be reset
(c) zero flag will be set and the carry flag will be reset
(d) zero flag will be reset and the carry flag will be set
40. In 8085 microprocessor, in response to RST 7.5 interrupts the execution is transferred to
memory location
(a) 0000H (b) 002CH (c) 0034H (d) 003CH
180
GATE THE Direction Microprocessor
42. EPROM s are preferred for storing programs while developing new microprocessor based
system because of their
(a) non-volatile characteristic
(b) erasable and programmable characteristic
(c) random access characteristic
(d) all the above characteristics
43. When any data transfer instruction, for transfer of data between memory and
microprocessor, is executed the condition flags are
(a) not affected (b) always set
(c) always reset (d) affected indicating specific conditions
44. Let the contents of the accumulator and register B be 00000100 and 01000000 respectively
before execution of instruction SUB B. The contents of the accumulator after the execution of
this instruction will be
(a) 00000100 (b) 01000000 (c) 11000100 (d) 010001000
45. Let the contents of register C be 00000000 before DCR C is executed. The contents of C
after the execution of this instruction will be
(a) 00000000 (b) 11111111 (c) 00000001 (d) None
46. In an 8085 microprocessor based system the maximum possible number input/output
devices can be connected using I/O mapped I/O technique is given by
(a) 64 (b) 512 (c) 256 (d) 65536
48. Which of the following is not true during the execution of an interrupt service routine,
which does not contain any El instructions
(a) the microprocessor can be interrupted by a non-maskable interrupt
(b) the microprocessor can not be interrupted by any interrupt
(c) the microprocessor can not be interrupted by any masksble interrupt
(d) all interrupts except the non-maskable interrupt are disable
49. The reasons for the presence of ALE pin in 8085, but not in 6800 is that
(a) 8085 uses I/O mapped I/O, whereas 6800 uses memory mapped I/O
(b) 8085 has 5 interrupts lines, whereas 6800 has only two
181
GATE THE Direction Microprocessor
(c) 8085 has multiplexed bus, whereas 6800 does not have
(d) None
50. Which of the following interrupt is both level and edge sensitive?
(a) RST5.5 (b) INTR (c) RST 7.5 (d) TRAP
54. What is the execution time for the instruction, "STA ADDR", in an 8085microprocessor if the
clock frequency is 3 MHz ?
(a) 4329ns (b) 3975ns (c) 3115ns (d) 3960ns
57. The 8085 microprocessor will enter into INA cycle after the recognition of
(a) any interrupt (b) TRAP only
(c) INTR only (d) RST 7.5, 6.5, and 5.5 only
182
GATE THE Direction Microprocessor
60. In order to reset carry without affecting accumulator content, one has to use
(a) SUB A (b)XRA A (c)ORA A (d)CMC
61. Maximum number of I/O devices that can be addressed by INTEL 8085 is
(a) 65,536 (b)255 (c)512 (d)256
62. The microprocessor may be made to exit from HALT state by asserting
(a) RESTART (b) any of the five interrupts lines
(c) READY line (d) a (or) b (or) HOLD line
63. The 8085 microprocessor enters into bus idle machine cycle whenever
(a) INTR interrupt is recognized (b) RST X.5 is recognized
(c) DAD rp instruction is executed (d) none of the above
64. In order to complement the lower order nibble of the accumulator, one can use
(a) ANI 0FH (b) XRI 0FH (c) ORI 0FH (d) CMA
69. RST 3 instruction will cause the processor to branch to the location
(a) 0000H (b) 0018H (c) 0024H (d) 8018H
70. Which of the following instruction will never affect the zero flag?
(a)DCR reg (b)ORA reg. (c)DCX rp. (d)XRA reg.
71. The content of the A15-A8 (higher order address lines) while executing "IN” address
instruction are
(a) same as the contents of A7-AO (b) irrelevant
(c) all bits reset (i.e. 00H) (d) all bits set (i.e. FFH)
183
GATE THE Direction Microprocessor
72. Which of the following peripheral ICs is used to interface keyboard and display?
(a) 8251 (b) 8279 (c) 8259 (d) 8253
74. Which one of the following instruction may be used to clear the accumulator content (i.e. A
= 00H) irrespective of its initial value?
(a) CLR A (b) ORA A (c) SUB A (d) MOV A, 00H
80. A single instruction to clear the lower 4 bits of the accumulator in 8085 assembly
language is
(a) XRI 0F H (b) ANI F0H (c) XRI F0 H (d) ANI 0FH
82. A sequence of two instructions that multiplies the contents of the DE register pair by 2
and stores the result in the HL register pair (in 8085 assembly language) is
(a) XCHG and DAD B (b) XTHL and DAD H
(c) PCHL and DAD D (d) XCHG and DAD H
184
GATE THE Direction Microprocessor
83. Identify key board and display interfacing device from the following
(a) 8255 (b)8253 (c) 8279 (d) 8155
89. The maximum number of seven segment displays that can be connected to 8279 is
(a) 12 (b) 14 (c) 16 (d) 8
90. Using one 82591C is equivalent to providing _____________ INTR pins on 8085
(a) 16 (b) 12 (c) 8 (d) None
92. Maximum of how many devices can be connected simultaneously to the microprocessor via
8257 in DMA data transfer mode?
(a) 4 (b) 6 (c) 8 (d) 10
94. The frequency of the driving network connected between pins 1 and 2 of 8085 chip is
(a) twice the desired frequency (b) equal to the desired frequency
(c) four times the desired frequency (d) none of the above
185
GATE THE Direction Microprocessor
96. READY signal in 8085 is useful when the CPU communicates with
(a) a slow peripheral device (b) a fast peripheral device
(c) a DMA chip (d) a PPI
99. During the DMA transfer the processor (check the incorrect answer)
(a) continues its normal operation
(b) suspends its normal operations
(c) needs to initiate read (write) command
(d) needs to check if the input/output device is ready for data transfer
100. In 8085, interrupts except TRAP are disabled (check the incorrect statement) by
(a) a DI instruction (b) a system reset
(c) Acknowledgement of a previous interrupt (d) none of these
Key:
1.d 2.c 3.c 4.d 5.d 6.a 7.b 8.b 9.c 10.a
11.c 12.d 13.d 14.b 15.b 16.d 17.b 18.c 19.d 20.c
21.a 22.a 23.d 24.c 25.a 26.a 27.b 28.d 29.b 30.b
31.a 32.a 33.a 34.b 35.b 36.a 37.b 38.a 39.c 40.d
41.d 42.d 43. a 44.c 45.b 46.b 47.b 48.b 49.c 50.d
51.c 52.d 53.c 54.a 55.a 56.a 57.c 58.c 59.b 60.c
61.d 62.d 63.b 64.b 65.d 66.a 67.d 68.b 69.b 70.C
71.a 72.b 73.c 74.c 75.b 76.b 77.b 78.d 79.a 80.b
81.a 82.d 83.c 84.b 85.c 8 6.a 87.b 88.c 89.c 90.c
91.b 92.a 93.b 94.a 95. c 96.a 97.d 98.c 99.a 100.a
186