Digital Logi
Digital Logi
Digital Logi
1.1 Introduction
The number system is a collection of number to represent the quantifiable
information. Most of the computations in the number systems are addition,
subtraction, multiplication, division, etc. we usually perform all calculation
using the decimal number system.
In decimal number system we have ten different digits or symbols i.e. 0, 1, 2,
3, 4, 5, 6, 7, 8 and 9. The combination of this number gives quantifiable
values. To represent these values in the electronics world, we don’t have
the hardware, so there was need for the hardware which can represent the
any one number system. The invention of transistor, have triggered the
engineers to make use of the binary number system. The binary numbers
system have only two values i.e., 0, 1. With the help of the transistor we can
represent the two states (0, 1) of the number.
The invention of transistor made a remarkable change in the electronic
world especially in computer science. The transistor acted as a switch, able
to represent the binary number. In computer, the computations are not
Example 1.3: How to represent the binary value “1010” in decimal format?
1 x 23 + 0 x 22 + 1 x 21 + 0 x 20
The decimal representation is
8 + 0 + 2 + 0 = 1010
Example 1.4: How do you represent the binary value 1010.101 in decimal
format?
1 x 23 + 0 x 22 + 1 x 21 + 0 x 20. 1 x 2-1 + 0 x 2-2 + 1 x 2-3
The binary representation is
8 + 0 + 2 + 0 . 0.5 + 0.0 + 0.125 = 10.62510
4 bits Nibble
8 bits Byte
16 bits Half Word
32 bit Word
The binary presented in two ways little endian and big endian method are as
shown in the tables 1.2 and 1.3 respectively. Most of computer architecture
has been designed based on either of this format to transfer the data across
the system. The Least Significant Bit (LSB) where the value has least place
holder value. The Most Significant Value (MSB), where the value has
highest place holder value.
Table 1.2: Big Endian Method
1 0 1 0 1
MSB LSB
Example 1.9: How to convert 10010 into binary, octal and hexadecimal?
So far we have studied the decimal number to other number system without
fraction. Now we will concentrate on the fractional conversion.
The fractional decimal number must be multiplied by the base of the other
number system to convert it into other number systems as shown in
example 1.10. For example decimal number is to be converted into the
binary. Fractional part has to be multiplied by 2 repeatedly till we will make
the fractional part zero. If the fractional part goes on and on, we can
terminate in between.
Example 1.10: How to convert 100.26510 into binary, octal and
hexadecimal?
Let us take the integer part first and convert it to other number systems.
Now for the fractional part, we follow the multiplication process as shown
below:
Therefore,
100.26510= (1100100.0100)2 ; 100.26510=(144.20753)8 ;
100.26510= (64.43D70)16
Now before we convert number from octal to binary and vice versa, one has
to know the equivalent numbers for both the systems. The table 1.5 shows
the octal numbers with its equivalent the binary numbers.
Table 1.5: Octal numbers with equivalent binary number formats
Octal Binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
From the table 1.5, it is clear that any octal digit can be represented by a
group of three binary digits (or Bits)
To covert any hexadecimal number to binary and vice versa, refer the table
1.6 which shows the binary equivalent for the hexadecimal numbers. The
table 1.6 also gives the comparison of all the four number systems
From the table 1.6, it is clear that any hexadecimal digit can be represented
by a group of four binary digits (or Bits)
Example 1.11: Convert the 61358 into binary value
In this example, we can replace all independent value into equivalent 3-bit
binary value as shown below to get our answer.
6 1 3 58
110 001 011 1012
Example 1.12: Convert (6135.2478)8 into binary value
Similar with the example 1.11, here we will replace equivalent 3 bit binary
value to represent the octal value.
6 1 3 5 . 2 4 78
110 001 011 101 . 010 100 1112
Example 1.13: Convert 1A2C16 into Binary Value.
In this example, we can replace all independent value into 4-bit binary
equivalent as shown below to get our answer.
1 A 2 C16
0001 1010 0010 11002
Manipal University Jaipur B0948 Page No. 10
Logic Design Unit 1
It is worth noting that the use of the 1's complement in the binary system
raises certain hardware implementation difficulties so that signed arithmetic
processes are invariably performedusing 2's complement notation.
The major advantage of 2's complement over 1's complement is that 2's
complement has only one value for zero. One's complement has a "positive"
zero and a "negative" zero which is the disadvantage of 1's complement.
Also note that there is no addition of end around carry in 2’s complement
method.
Example 1.15: Compute binary arithmetic operation for 9 – 5 using 2’s
Complement.
Note: Refer table 1.4 for the equivalent values.
Here keep the binary equivalent of 9 (1001) as it is and keep the 2’s
complement equivalent of 5 (1011) and add both vales to get the result 4,
ignore carry generated MSB bit.
1001
1011
10100
Discarding the carry (i.e. 1), we get the answer 0100 which is equal to 4 in
decimal.
Example 1.16: Compute Binary arithmetic Operation for 9 – 5 using 1’s
Complement.
Note: Refer table 1.4 for the equivalent values.
Here keep the binary equivalent of 9 (1001) as it is and keep the 1’s
complement equivalent of 5(1010) and add both vales to get the partial
result and add the carry value in the LSB to get the result 4.
1001
1010
10011
+1
0100
Excess Notation
The excess notation is a means of representing both negative and positive
numbers in a manner in which the order of the bit patterns is maintained.
Manipal University Jaipur B0948 Page No. 12
Logic Design Unit 1
The algorithm for computing the excess notation bit pattern is as follows:
1. Add the excess value 2N-1, (where N is the number of bits used to
represent the number) to the number.
2. Convert the resulting number into binary format.
The 2N–1 is often referred to as the Magic Number for computing the excess
representation of the number (except that there is no magic in it). Table 1.9
presents all the numbers that can be represented using the excess-8
notation.
Table 1.9: Numbers using the Excess-8 representation
The number of bits used to represent a code in excess-8 is 4 bits. Also, the
bit patterns are in sequence (the largest number that can be represented
has the bit pattern 1111).
Example 1.17: Consider the following operation 7 – 2. Substituting the bit
patterns from the table:
The result of the addition operation is the bit-pattern used for 5 in binary.
1.9 Summary
Let us recapitulate the important concepts discussed in this unit:
In decimal number system, we have ten different digits or symbols
i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
The base of octal number system is 8, means the number system has
eight different digits 0, 1, 2, 3, 4, 5, 6 and 7.
Any octal digit can be represented by a group of three binary digits (or
Bits)
In Hexadecimal number system, we have sixteen different digits or
symbols i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and A, B, C, D, E and F.
The negative number can be represented in many ways. They are
Signed magnitude, 1’s complement and 2’s complement.
2’s complement is obtained by complementing the binary digits i.e. bits
and then 1 is added to it.
The major advantage of 2's complement over 1's complement is that 2's
complement has only one value for zero.
1.11 Answers
Self Assessment Questions
1. 10
2. 255
3. 0 to 255.
4. 11100100
5. (0101)
6. (0100)2
7. (0101)
8. 0010
9. Magic Number
10. 0012340
11. 13
Terminal Questions
1. Refer to Section 1.3 for conversion method
2. Refer to Section 1.4 forconversion method
3. Refer to Section 1.5 for conversion method
4. Refer to Section 1.7 for conversion method
5. Refer to Section 1.7 for conversion method
6. Refer to Section 1.7 for conversion method
7. Refer to Section 1.6 for method
8. Refer to Section 1.8 for 2’s complement subtraction method
2.1 Introduction
In the last unit, you studied about the different types of number systems and
their conversion from one number system to other. You also studied the
methods of representing negative numbers. The components in computer
accept set of inputs and produce outputs depending upon their functionality.
Any basic 2 state (state-1 & state-0) units can be used to construct the
digital circuits. These basic units can be represented as a switch based on
their state (ON or OFF). In this unit, you will study about the Boolean
algebra, basics of logic gates and realization of other gates or logic function
using universal gates.
Objectives:
By the end of Unit 2, the learners are able to:
list rules & laws of Boolean algebra
explain basic gates
explain universal gates
explain exclusive OR gate and exclusive NOR gate
exercise on realizing circuits with universal gates
a + a = a Idempotent Laws
a•a=a
a + 0 = a Identity Laws
a•1=a
a + b = b + a Commutative Laws
ab = ba
a + (b + c) = (a + b) + c Associative Laws
a(bc) = (ab)c
The above method explains the way to construct a Boolean expression from
the values of a Boolean function. A Boolean product m1, m2, m3…mn is
said to be a minterm of Boolean variables x1, x2, x3,…xn if mi = xi or mi =
xi’. Only if all the variables of minterm are 1, the minterm product will result
in 1. For the 1st scenario discussed above, x’yz will only be the minterm that
has the value 1. In other words, a Boolean expression for a Boolean
function can be quoted as the sum of the minterms. Minterms referred here
are those with value 1 for a given combination.
Boolean sum discussed above is also referred to as sum of products (SOP)
expansion or disjunctive normal form.
Maxterm is the dual of Minterm. It is also referred to as product of sums
(POS) or conjunctive normal form. Duality can be observed from the
table 2.3.
Here the minterm expression will be xyz + xyz’ + x y’z’ + x’yz’ + x’ y’z’ and
the max term expression will be (x’+y+z’)( x+y’+z’) (x+y+z’ )
operators are used: logical OR, logical AND, logical NOT, parenthesis. The
logical OR and logical AND operators are left associative. In a single
expression, if there two operators adjacent to each other with the same
precedence, the expression must be evaluated from left to right. The logical
NOT operation is right associative. As logical NOT is unary operator, the
results of both left associativity and right associativity will result in same
value.
The following sets of postulates are used in digital systems:
Postulate 1: Boolean algebra is closed under the AND, OR, and NOT
operations.
Postulate 2: The identity element with respect to • is one and + is zero.
There is no identity element with respect to logical NOT.
Postulate 3: The • and + Boolean operators are commutative.
Postulate 4: • and + Boolean operators are distributive with respect to one
another. That is,
X • (Y + Z) = (X • Y) + (X • Z) and
X + (Y • Z) = (X + Y) • (X + Z).
Postulate 5: For every value X there exists a value X’ such that
X•X’ = 0 and
X+X’ = 1. X’ value is the logical complement (or NOT) of X.
Postulate 6: • and + Boolean operators are both associative. That is,
(X•Y)•Z = X•(Y•Z) and
(X+Y)+Z = X+(Y+Z).
Using the above postulates any theorem in Boolean algebra can be proved.
Following are the some important theorems in Boolean algebra using which
a digital system can be constructed.
Theorem-1: X + X = X
Theorem-2: X • X = X
Theorem-3: X + 0 = X
Theorem-4: X • 1 = X
Theorem-5: X • 0 = 0
Theorem-6: X + 1 = 1
Theorem-7: (X + Y)’ = X’ • Y’
Theorem-8: (X • Y)’ = X’ + Y’
Theorem-9: X + X•Y = X
Theorem-10: X •(X + Y) = X
Theorem-11: X + X’Y = X+Y
Theorem-12: X’ • (X + Y’) = X’Y’
Theorem-13: XY + XY’ = X
Theorem-14: (X’+Y’) • (X’ + Y) = Y’
Theorem-15: X + X’ = 1
Theorem-16: X • X’ = 0
A Boolean expression is a combination of ones, zeros, and literals which are
separated by Boolean operators. A literal is an unprimed or primed
(negated) variable name. In further discussion, we consider that a single
alphabetic character for all variable names. A specific Boolean expression is
considered as Boolean function; In general the name of Boolean functions
can be any alphabetic character with a possible superscript. For example:
F = A + BC
The Boolean function F first computes the logical AND operation of B and C
and then performs logical OR operation with A. If A=1, B=0, and C=1, then
value one is returned by the function F (1+0•1 = 1). Table 2.5 can be used
as alternate way to represent a Boolean function.
Table 2.5: AND Truth Table
AND 0 1
0 0 0
1 0 1
Truth tables will be more convenient and natural for any binary operators
with two input variables. However, when the Boolean function F mentioned
above is considered, we can observe that the function F has 3 input
variables. For such conditions the above mentioned truth table (for two input
variables) cannot be used, instead a truth table for three input variables can
be used. Truth table for any number of input variables can be constructed
easily. One of the methods to construct the truth table for three or four
variables is explained in the following example:
In the table 2.6 for input variables A & B, the possible combinations of zeros
and ones are given in four different columns of the table.
Table 2.6
A B
0 0
0 1
1 0
1 1
Tables 2.8 and 2.9 show truth tables for three variables and four variables
respectively.
Table 2.8: Truth Table for a Function with Three Variables
The table 2.10 shows the another format for truth tables
Table 2.10: Another Format for Truth Table
From the above discussion, it is clear that we have only three basic logic
operations: OR, AND and NOT. So we have three basic gates to produce
basic logic operations. These are OR gate, AND gate and NOT gate. Before
we study these basic gates let us see what a logic gate is.
A logic gate is an electronic circuit which has one or more inputs but only
one output. Logic gate produces logical operation on binary numbers.
Now let us study basic logic gates.
OR gate: OR gate has two or more inputs and only one output. The
operation of this gate is such that it produces a high output (i.e. logic 1)
when one or more of inputs are high and it produces a low output (i.e. logic
0) when all the inputs are low.
The logic symbol, truth table and Boolean expression for 2-input OR gate is
shown in figure 2.1.
Figure 2.1: OR gate (a) Logic symbol (b) Boolean expression (c) Truth table
Note that A and B are the inputs and Y is the output. The Boolean
expression Y = A + B is read as Y equals A OR B.
AND gate: AND gate has two or more inputs and only one output. This gate
produces a high output (i.e. logic 1) when all of inputs are high and it
produces a low output (i.e. logic 0) when one or more of its inputs are low.
The logic symbol, truth table and Boolean expression for 2-input OR gate is
shown in figure 2.2.
Figure 2.2: AND gate (a) Logic symbol (b) Boolean expression (c) Truth table
Note that A and B are the inputs and Y is the output. The Boolean
expression Y = A .B is read as Y equals A AND B.
NOT gate: A NOT gate has only one input and only one output. This gate
produces the output which is the inversion (i.e. complement) of the input.
Suppose if the input is 1(HIGH), then its output is 0 i.e. logic 0 (LOW). NOT
gate is also known as an inverter. If the input variable is A, the inverted
output is known as NOT A. This can also be shown as A', or A with a bar
over the top i.e. A .
The logic symbol, truth table and Boolean expression for NOT gate is shown
in figure 2.3.
Figure 2.3: NOT gate (a) Logic symbol (b) Boolean expression (c) Truth table
Note that A is the input and Y is the output. The Boolean expression Y = A
is read as Y equals NOT A. This can also be read as Y equals A bar.
There are two symbols for NAND gates: the 'distinctive' symbol (refer figure
2.4) and the 'rectangular' symbol (refer figure 2.5).
NOR operator: ?
x y x?y
0 0 1
0 1 0
1 0 0
1 1 0
Now to prove that we can construct any Boolean function using only NAND
gates, we need only show how to build an inverter (NOT), AND gate, and
OR gate from a NAND (since we can create any Boolean function using
only AND, NOT, and OR). Building an inverter is easy; just connect the two
inputs together. Once we build an inverter, building an AND gate is easy –
just invert the output of a NAND gate. After all, NOT (NOT (A AND B)) is
equivalent to A. AND B. Of course, it takes two NAND gates to construct a
single AND. We have already discussed about AND, OR and NOT Gates.
Let us once again look at their logic symbols shown in figure 2.8 as these
are taken as references while constructing the these gates using universal
gates i.e using NOR and NAND gates.
NAND gate and NOR gates are called universal gates because any logic
function or any logic gate can be realized using either only NAND gates or
only NOR gates. For example, we can construct or realize the operation of
OR, AND, and NOT gates using only NAND gates or only NOR gates.
First, when compared to other gates NAND gates are less expensive to
construct. Second, constructing complex digital systems using same
building blocks will be easier than constructing the digital systems using
different basic blocks. The correspondence between NAND and NOR logic
is orthogonal to the correspondence between the two canonical forms
appearing in this unit (sum of minterms vs. product of maxterms). While
NOR logic is useful for many circuits, most electronic designs use NAND
logic.
16 possible Boolean functions of two variables are shown in table 2.11.
Table 2.11: 16 possible Boolean functions of two variables
The figure 2.9 shows the logic symbol of two input XOR gate and figure 2.10
shows its rectangular symbol.
.
Figure 2.10: Rectangular XOR symbol
X-NOR Gate
The XNOR gate is a digital logic gate whose function is the inverse of the
exclusive OR (XOR) gate. The two-input version implements logical equality,
behaving according to the truth table to the right. If the inputs to XOR gate
are same, then the output will be HIGH. A LOW output will result if both the
inputs to the XOR gate are not same. The table 2.13 shows the truth table
of XNOR gate.
Manipal University Jaipur B0948 Page No. 34
Logic Design Unit 2
INPUT OUTPUT
A B A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1
The figure 2.11 shows the logic symbol of two input XOR gate and figure
2.12 shows its rectangular symbol.
The laws of Association, Commutation and Distribution are also valid for the
XOR operation. They are
If Boolean algebraic equations are written in terms of the XOR function, the
following identities may prove useful:
Now we can construct any circuit for any given Boolean expression using
logic gates. Let see the example 1.
Example 1: Draw a logic circuit for (A + B) C.
Solution: The logic circuit for (A + B) C. is shown in figure 2.12
The figure 2.14 shows the construction of OR gate using NOR Gates only.
The figure 2.15 shows the construction of AND Gate using NOR Gates only.
The figure 2.16 shows the construction of NAND Gate using NOR Gates
only.
The figures 2.17 and 2.18 show the construction of XNOR and XOR gates
using NOR Gates only.
Realizing Circuits with NAND Gates: The figures 2.19 through 2.24 shows
the various gates realized using NAND gates only.
2.7 Summary
Let us recapitulate the important concepts discussed in this unit:
A logic gate is an electronic circuit which has one or more inputs but only
one output. Logic gate produces logical operation on binary numbers.
A logic gate is an elementary building block of a digital circuit.
There are three fundamental logic gates namely, AND, OR and NOT.
We have other logic gates like NAND, NOR, XOR and XNOR.
NAND and NOR gates are called the universal gates.
2.9 Answers
Self Assessment Questions
1. 1
2. Commutative
3. Dominance
4. 0
5. 1
6. False
7. 1
8. 0
9. True
10.
11.
12. A B AB AB
13. NOT of ( A XOR B)
Terminal Questions
1. Refer to section 2.3
2. Refer to section 2.3
3. Refer to section 2.4
4. Refer to section 2.6
5. Refer to section 2.6
6. Refer to section 2.6
7. Refer to section 2.5 for method
8. Refer to section 2.5 for method
9. Refer to section 2.5 for method
10. Refer to section 2.5 for method
3.1 Introduction
In the last unit, you studied about rules and laws of Boolean algebra, basic
gates, universal gates and realization of other gates using universal gates.
In a digital system, there are two voltage levels of electrical signals i.e., 0v
and 5v. If the supply to the system is maintained, the electrical devices can
exist in one of the two voltage levels indefinitely. For example, a bipolar
transistor that is non-conducting in a 5 volt system will have approximately 5
volts between collector and emitter. However, when the transistor is turned
on and is conducting, the voltage between collector and emitter can be
made zero by connecting a suitable load to the transistor. Among the two
voltage levels, logic zero is assigned to 0v and logic one is assigned to 5v.
The presence or absence of a particular condition can be indicated by the
two states logic 0 and logic 1. An algebra developed in the nineteenth
century by George Boole (1815-1864), an English mathematician, is well
suited for representing the situation above. This branch of mathematics,
called Boolean algebra, is a discrete algebra in which the variables can
have one of two values, either 0 or 1. Associated with the algebra is a
number of theorems which allow the manipulation and simplification of
Boolean equations.
Manipal University Jaipur B0948 Page No. 42
Logic Design Unit 3
Shannon, who was the first to develop information theory, became aware
that Boolean algebra was useful in the design of switching networks. Initially,
the algebra was used in the design of relay networks. More recently
switching circuits were implemented using discrete components but rapid
technological advances have seen the introduction of MSI, LSI and VLSI
devices and because of the sophisticated and versatile nature of these
components there have been significant changes in the design techniques
used by engineers. In spite of these changes it is still essential for engineers
to have a good working knowledge of traditional switching theory.
In digital system designing, one of the main objectives to implement a
Boolean function using minimum number of discrete gates. The cost of the
circuit will be low when the number of gates used in implementing a
Boolean function is smaller. Simplification of Boolean function can be
performed using a purely algebraic process. Simplification using algebraic
process can be tedious, and at the end of process designer is not always
sure whether the simplest solution is obtained or not.
Instead of using algebraic process, Boolean function can be simplified easily
by plotting the function to Karnaugh map and simple rules to reduce the
Boolean function. Upto six variables simplification of Boolean function using
karnaugh maps will be very straightforward. Tabulation method which has
been developed by Quine and McCluskey will be better method to simplify
the Boolean function which has more than six variables. So in this unit we
will study about Boolean expressions and functions and simplification of
Boolean expressions using Karnaugh map and Quine-McCluskey Methods.
Objectives:
By the end of Unit 3 the learners are able to
define Boolean variable and Boolean function
simplify the expressions using Boolean algebra
explain Karnaugh maps
explain Quine-McCluskey method
equal sign.Truth tables are used to display the values of a given Boolean
function. A Boolean expression is an expression using Boolean variables
{X1, X2,….Xn} and the operations of a Boolean algebra.
Boolean functions in digital systems are defined by Boolean expression.
The Boolean function value is evaluated by applying 0’s and 1’s to the
variables in the Boolean expression. For example, the Boolean function
F(A,B) is defined by the Boolean expression A’B’ + AB’ i.e., F(A,B) = A’B’ +
AB’. The truth table for the function F(A,B) is given in the table 3.1.
Table 3.1: Truth table for F(A,B) = A’B’ + AB’
The domain in this function is the 2-tuple which represents the values of
x and y. The range is {0, 1} in the last column. The possible value of the
variables in the Boolean expression represents the n-tuple of a Boolean
function. If two or more Boolean expressions represent the same function,
then those Boolean expressions are said to be equivalent. (i.e., have the
same truth table).
3.2.2 More on Boolean Functions
In order to use the above information to construct the digital circuits, the
following basic problems need to solve:
1) how the Boolean expression is derived from the given truth table for a
Boolean function?
2) Can the Boolean function be represented with an optimum set of
operators?
First, question 1. How the Boolean expression can be derived from a given
table (for example table 3.2) of values for a Boolean function?
From the above table 3.2, the function F is 1 when y = z = 1 and x =0. And
hence we get the expression x’yz i.e., the value of the function F will be 1 if
and only if x’ = y = z = 1. The function G will have value 1 in two cases: y = z
= 1, x =0, and x = y = 0, z = 1. From the above information the expression
for G can be represented in the sum of two product terms: x’yz + x’y’z
The above method explains the way to construct a Boolean expression from
the values of a Boolean function. A Boolean product m1, m2, m3…mn is
said to be a minterm of Boolean variables x1, x2, x3,…xn if mi = xi or mi =
xi’. Only if all the variables of minterm are 1, the minterm product will result
in 1. For the 1st scenario discussed above, x’yz will only be the minterm that
has the value 1. In other words, a Boolean expression for a Boolean
function can be quoted as the sum of the minterms. Minterms referred here
are those with value 1 for a given combination.
Boolean sum discussed above is also referred to as sum of products (SOP)
expansion or disjunctive normal form. Maxterm is the dual of minterm. It is
also referred to as product of sums (POS) or conjunctive normal form.
Duality can be observed from the table 3.3 below:
Table 3.3: Duality
minterms. It won't always produce the simplest form, but it's close enough
for most engineers considering the difficulty of the alternative method.
The figure 3.1 shows the template for 3 variable Karnaugh maps
For three variables, there are eight possible combinations and each cell in
K-map corresponds to one of the combination. The templates for 2 and 4
variable Karnaugh maps are given in figure 3.2(a) and 3.2(b) respectively.
(a) (b)
Figure 3.2: (a) Karnaugh map for 2 variables (b) Karnaugh map for 4
variables
Once we have placed the 1's in the map, there is a simple procedure that
we apply.
Before analyzing the procedure, understanding the basis for the procedure
is necessary. As there are many simple functions in Boolean functions, K-
maps are useful. The simple functions in Boolean function are known as
product function; product functions can be product of few variables or all
variables. The product terms can have both normal variable and its
complements. For example, A, A'B and ABC are all product functions but
A + B' and AB + CD are not product functions.
Consider the Boolean function f(A,B,C) = AC. For inputs equal to 101 and
111, the value of the Boolean function will be 1. Its Karnaugh map is shown
in figure 3.3.
Notice that 1’s lie in a 2x2 rectangular block. From the above example, it
can be observed that for every product function there will be corresponding
K-map whose minterms can lie in a block of 1, 2, or 4 cells long. Thus,
recognizing the product function which represented by a K-map has highest
priority.
In order to recognize the product function represented by k-map, the truth
set of the Boolean functions is written down. Truth set is the set of
combinations for which Boolean function will be 1. For example consider the
k-map shown in figure 3.5.
From the above k-map, it can be observed that values 011 and 111 will form
the truth set. Next, the truth set values are analyzed. If the variables of the
Boolean function are A, B, and C, it can be observed that value of A can be
either 0 or 1; while the values of B and C has to be 1. The above analysis
can be characterized as follows: {*11}. A particular value for x will only be
accepted if A is involved in unknown product function. From the above truth
set it can be observed that value of A can be either 0 or 1, thus it can be
Manipal University Jaipur B0948 Page No. 50
Logic Design Unit 3
concluded that A is not involved. From the truth set it is observed that value
of B is 1 for all inputs, thus B must be involved but not B’. The same is
applicable for C. From the above discussion, we can say that BC is the
product function. For the K-maps given in figure 3.6, derive the product
functions associated with it.
1) Truth set for the first k-map is: {011, 010, 111, 110} = {*1*}. It can be
observed that B should be involved in the product function, but A and C
are not necessary to be involved. Thus the product function is B.
2) Truth set for the second k-map is: {010} as there is only one value in the
truth set, the Boolean function for the k-map will be A'BC'.
3) Truth set for the third k-map is: {000, 100, 010, 110} = {**0} = z'. It can
be observed that complement of C should be involved in the product
function, but A and B are not necessary to be involved. From the k-map
it can be noticed that there is a wraparound of rectangular block.
Finally, try some 2 and 4 variable maps as shown in figure 3.7.
But sometimes the Boolean expressions will not be equivalent to the k-maps
product function. The first example we looked at did not break down into a 1,
2, or 4 cell rectangular blocks. Now consider the figure 3.8.
Blocks in the above k-map can be broken down into two separate product
blocks. x’ is represented by one product block and the other product
represents y. The Boolean function which has been derived from the k-map
is x' + y, in the present method, the two product functions are determined
and ORed together. It can be observed that the blocks has been determined
directly without using any truth sets and same can be applied to any
Boolean function. The main idea is to use only minimum blocks to cover the
terms and the Boolean function is derived by summing all the product blocks.
The simple Boolean expression can be derived when the large sized blocks
are used. For example, in the k-map above, one horizontal and two vertical
blocks could be used: the first two ones form one horizontal block, ones in
column 3 forms first vertical block, and ones in column 4 forms the other
vertical block. By using above method the following Boolean expression is
derived: x’y’+yz+yz’.
In the above k-map, if the first two ones form a block and the four ones
forms another block, then the Boolean expression cab be reduced to x’y’+y.
But the Boolean expression derived using second method is not that simple
as the Boolean expression which is derived using the first method. By using
Boolean identities and theorems, the Boolean expression x’y’+y can be
further reduced to x’y. From the above discussion, it can be observed that a
simple Boolean expression can be derived by choosing the blocks carefully.
An implicant of a function is a product term that is included in the function.
In the Boolean expression above implicants are x'y', yz and yz'. A prime
implicant of a function is an implicant of the function that is not included in
any other implicant of the function. Therefore, only few prime implicants
should be used to cover the minterms of the Boolean function.
As additional practice, simplify the following functions represented by
Karnaugh maps shown in figure 3.9.
(a) (b)
Figure 3.9: K-maps for (a) 3 variable and (b) 4 variables
1) x'z' + yz'
2) w'x + xyz' + wx'z x'y'z'
Notice that you can overlap the blocks if necessary as shown in figure 3.10.
(a) (b)
Figure 3.10: Over lapping in K-maps for (a) 3 variable and (b) 4 variables
There are no rules to choose the right set of blocks to determine the simple
expression, it comes with practice.
Now let us see some examples
Example 1: Simplify f (a, b, c, d)=∑m(0, 2, 4, 6, 7, 8, 9, 11, 12, 14).
Solution: Write the karnaugh Map and enter 1’s as shown in figure 3.11 in
the corresponding cells.
Now group the 1’s staring from groups of eight 1’s, then four 1’s, two 1’s as
shown in figure 3.12.
Finally we get,
f = aIdI + bdI+ aIbc+abId + cIdI
Therefore,
Step 2: If the function is not given in binary minterm form, then translate the
decimal values to binary notation of minterms.
F(A,B,C,D) = ∑m(0000, 0010, 0011, 0110, 0111, 1000, 1001, 1010, 1101)
Step 3: Minterms are grouped depending upon number of one’s they have
and entered in table form as shown in the table 3.7.
Table 3.7: Quine-McCluskey Method
Step 4: The minterms in the adjacent blocks are compared to determine the
minterms which are differed by only one bit. Replace the missing literal by –
and place the minterms in the next column. The minterms in the present
column which are combined are placed with a check mark (refer to the
table 3.8).
Table 3.8: Quine-McCluskey Method for Step 4
Step 5: The minterms in the adjacent blocks are compared to determine the
minterms which are differed by only one bit. Note -’s must line up. Replace
the missing literal by – and place the minterms in the next column. The
minterms in the present column which are combined are placed with a
check mark. Table 3.9 shows completion of first phase of Q-M method.
Table 3.9: Quine-McCluskey Method for Step 5
Step 7: Select prime implicants for minterms with only one in a column.
(refer the table 3.11).
Table 3.11: Quine-McCluskey Method for Step 7
Step 8: Repeat step 8 for minterms with only two in a column. (refer the
table 3.12). If the minterms of those colums are already included, then not
required to be considered (refer the table 3.12).
Table 3.12: Quine-McCluskey Method for Step 8
In table 3.12, two correspond to colums 0010, 1000 and 1001. These can
be dropped since corresponding minterms are already included.
Now the final expression is
F(A,B,C,D) = 1-01 + -0-0 + 0-1-
Step 9: Translate to literal notation
F(A,B,C,D) = AC’D + B’D’ + A’C
Don’t Cares
It is important to note that don’t cares are used to find out prime implicant
but not compulsory to include in the final expression.
Step A: Translate to canonical minterm representation
G(A,B,C,D) = m(2,3,6,8,9,10,13) +d(0,7)
Step B: Form table and find prime implicants. Include minterms and don’t
cares in table. Since G(A,B,C,D) is just F(A,B,C,D) with mintems 0 and 7
changed to don’t cares; this process would be identical to steps 3, through 5
from above. See steps 3 through 5 from above.
Step C: Form table with don’t cares missing. Only include required
minterms. Note 0000 and 0111 columns missing. Check required minterms
covered by each prime implicant (refer the table 3.13).
Table 3.13: Step C
3.5 Exercises
Figure 3.14: (c) and (d) independent implementation of f1 and f2 in (a) and (b)
3.6 Summary
Let us recapitulate the important concepts discussed in this unit.
A Boolean function is an expression formed with binary variables, the two
binary operators AND and OR, one unary operator NOT, parentheses
and equal sign.
A Boolean product m1, m2, m3…mn is said to be a minterm of Boolean
variables x1, x2, x3,…xn if mi = xi or mi = xi’.
K-maps are generally used in simplification of two, three or four variables
Boolean function.
A prime implicant of a function is an implicant of the function that is not
included in any other implicant of the function.
Quine-McCluskey method is sometimes referred to as the method of
prime implicants or the tabulation method.
3.8 Answers
Self Assessment Questions
1. 0
2. 1
3. Minterm x I y I z Maxterm x+y+z I
4. 2-dimensional
5. Prime implicants
6. True
Terminal Questions
1. Refer to the sub-section 3.2.4
2. Refer to the sub-section 3.3
3. Refer to the section 3.3 for method
4. Refer to the section 3.3 for method
5. Refer to the section 3.4 for method
4.1 Introduction
In the last unit, we studied about Boolean expressions and functions and
simplification of Boolean expressions using Karnaugh map and Quine-
McCluskey Methods. The digital system which drives the modern computer
can be constructed using the basic gates i.e., AND, OR, and NOT gates.
There are two types of digital circuit: Combinational circuits and Sequential
circuits. Circuits whose outputs depend only on the current inputs are known
as Combinational circuits; hence the outputs will be generated by combining
the inputs according to the functionality. Circuits whose outputs depend on
both past and current inputs are known as Sequential circuits. Outputs of
sequential circuits can be determined by using the sequence of inputs over
the time. Memory circuits are considered as sequential circuits and adders
which is constructed using gates is considered as combinational circuits. In
this unit we will study about combinational circuits, and different codes like
Gray code, BCD code, and Excess-3 code.
Objectives:
By the end of Unit 4, the learners are able to:
explain different types of combinational circuits.
explain Gray code and its conversion
explain BCD code
explain Excess-3 code
Figure 4.1: Building an N-Bit Adder Using Half and Full Adders
From above discussion we can clearly say that Boolean operations and
arithmetic can be implemented using Boolean logic functions.
BCD to Seven segment decoder is the combination circuit which is used
very commonly. Using this circuit, we can determine which Light Emitting
Diode (LED) on seven segment should be displayed. As there are seven
outputs, there will be seven Boolean logic functions (segment 0 through
segment 6). Note that light-emitting diode (LED) is a two-lead
semiconductor light source that resembles a basic pn-junction diode, except
that an LED also emits light.
The four inputs to each of these seven Boolean functions are the four bits
from a binary number in the range 0...9. Let D be the Higher Order bit of this
number and A be the Lower Order bit of this number. Each logic function
should produce a one (segment on) for a given input if that particular
segment should be illuminated.
Counting as we have been taught since kindergarten is based on the
decimal number system. Decimal means base 10 (the prefix dec). In any
number system, given the base (often referred to as radix), the number of
digits that can be used to count is fixed. For example in the base 10 number
system, the digits that can be used to count are 0,1,2,3,4,5,6,7,8,9.
Generalizing that for any base b, the first b digits (starting with 0) represent
the digits that are used to count. When a number ≥ b has to be represented,
the place values are used.
The figure 4.2 shows the logic circuit diagram for Half adder.
Full adder: The figure 4.3 shows the the logic circuit diagram for Full adder
A full adder circuit adds the carry in Cin (or Ci) along with the two inputs A
and B. The full adder performs addition on 3 input bits and generates carry
and sum binary outputs. Multiple full adders can be used to perform the
addition of multibit (binary) inputs. The table 4.2 shows the truth table for
Full adder.
Table 4.2: Truth table for Full adder
Two half adder circuits can be used to implement a full adder circuit, the two
inputs A and B are connected to one half adder and its output sum is
connected as input to the second half adder. Carry in will be the other input
to the second half adder and two carry outputs are ORed. The Boolean
function for S can be expressed as XOR of three inputs A, B, Ci and a
majority function of A, B, and Ci can be Carry out equation. Sum of three
one bit numbers will be the output of the full adder circuit.
4.3.2 Subtractors
The approach used for designing an adder can be used to design a
subtractor. Following is the summary of the process used for subtracting
binary numbers. For multi-bit numbers during subtraction of each bit,
following three bits will be involved: the subtrahend (Yi), minuend (Xi), and a
borrow in from the previous bit order position (Bi). The difference bit (Di) and
borrow bit Bi+1 are the outputs of the subtractor. Following is the equation
for the difference of two bits.
D i X i Yi B i
4.3.3 Comparators
A digital comparator is a hardware electronic device that compares two
numbers in binary form and generates a one or a zero at its output
depending on whether they are the same (i.e. equal) or not.
Comparators can be used in a central processing unit (CPU) or
microcontroller in branching software. A comparator can be simulated by
subtracting the two values (A & B) in question and checking if the result is
zero. This works because if A = B then A - B = 0.
Many microcontrollers have analog comparators on some of their inputs that
can be read or trigger an interrupt.
The operation of a single bit digital comparator can be expressed as truth
table shown in the table 4.3.
Table 4.3: Truth table for Single Bit Comparator
Examples of the comparator include the CMOS 4063 and 4585 and the
TTL 7485 and 74682-'89.
4.3.4 Decoders
A decoder is a digital device which decodes the original information from the
encoded inputs. The functionality of a decoder is exactly the reverse of an
encoder. In order to decode the information from the signals, the method
used to encode the information is reversed.
In digital systems, decoder is a logic circuit with multiple inputs and multiple
outputs that produces a coded output from the coded inputs. In decoder the
input and output codes are different i.e., if there is an n-bit input code then
decoder produces 2n output code. So a decoder is a combinational circuit
that detects the binary information present on n input lines and decodes it
and indicates this decoded output on any one of the 2n output lines.
A slightly more complex decoder would be the n-to-2n type binary decoders.
With n-to-2n binary decoders, maximum of ‘2n’ outputs are generated from
‘n’ coded inputs which carry information. For ‘n’ bit coded input, if there are
any unused combinations then number of outputs of the decoder can be
less than 2n. From above discussion we can say that a decoder can
produce maximum of 2n outputs. In digital systems various types of
decoders like 3-to-8 decoder, 2-to-4 decoder or 4-to-16 decoder are used.
Two 2-to-4 decoders along with enable signal can be used to construct a 3-
to-8 decoders.
In the same way, a 4-to-16 decoder can be constructed by combining
two 3-to-8 decoders. In the above design process, the 4th input which is
given as enable input to both 3-to-8 decoders acts like selector between two
3-to-8 decoders.. The outputs D(0) through D(7) are produced by the first
decoder and D(8) through D(15) are produced by the second decoder, the
4th input in 4-to-16 decoder enables either the first decoder or second
decoder.
This kind of decoders with enable signals is also known as a decoder-
demultiplexer. Thus, we have a 4-to-16 decoder produced by adding a 4th
input shared among both decoders, producing 16 outputs.
4.3.5 Encoders
An encoder is a device used to change a signal (such as a bit stream) or
data into a code. The code may serve any of a number of purposes such as
compressing information for transmission or storage, encrypting or adding
redundancies to the input code, or translating from one code to another.
This is usually done by means of a programmed algorithm, especially if any
part is digital, while most analog encoding is done with analog circuitry.
Single bit 4 to 2 Encoder
An encoder has 2n input lines and n output lines. The output lines generate
a binary code corresponding to the input value. The figure 4.6 shows the
logic symbol of typical encoder.
For example a single bit 4 to 2 encoder takes in 4 bits and outputs 2 bits.
The Gate level circuit diagram of a single bit 4-to-2 line encoder is shown in
figure 4.7 and its truth table shown in the table 4.5.
Figure 4.7: Gate level circuit diagram of a single bit 4-to-2 line encoder
The encoder has the limitation that only one input can be active at any given
time. If two inputs are simultaneously active, the output produces an
undefined combination. To prevent this we make use of the priority encoder.
Priority encoder
A priority encoder is a digital circuit in which when two or more inputs are
given at the same time, the input having the highest priority will take
precedence. An example of a single bit 4 to 2 priority encoder is shown in
figure 4.8. Its truth table is shown in the table 4.6.
instead of using A/D converter or communication line for every input signal,
a single device can be used along with the multiplexer.
A multiplexer is a switch that has multiple inputs and single output. The
schematic symbol for a multiplexer is an isosceles trapezoid. Inputs are
connected to the multiplexer on the longer parallel side and output is
connected on short parallel side. In the schematic shown in figure 4.9, on
the left is the symbol for 2-to-1 multiplexer and on the right is the equivalent
switch of the multiplexer. The single output line can be connected to the
desired output through the sel wire.
In telecommunications, many communication channels can be carried using
multiplexer which combines many input signals (which carries information)
to a single output signal. A demultiplexer is a device which separates the
input signal to multiple output signals.
For a 2-to-1 multiplexer shown in figure 4.10, the Boolean equation in terms
of inputs and output can be as follows:
Where A and B are two input signals, S0 is the selection line, and Z is the
output signal.
S A B Z
0 0 0
0 1 0
0
1 0 1
1 1 1
0 0 0
0 1 1
1
1 0 0
1 1 1
From the truth table 4.7, it can be observed that output Z will be equal to A
when selection line S is 0 and Z is equal to B when S is 1. In order to realize
the 2-to-1 multiplexer using gates, it requires 2 AND gates, a NOT gate and
an OR gate.
In present day digital systems, large multiplexers are used commonly and,
as stated above, for n input signals [log2 (n)] selection pins are required.
Multiplexers that are used frequently apart from 2-to-1 multiplexer are
16-to-1, 8-to-1 and 4-to-1 multiplexers. Since digital logic uses binary
values, for a given number of selection lines powers of 2 (2, 4, 8, 16) is used
to control the number of inputs signals. The figure 4.11 shows the symbol of
4 to1 Mux and figure 4.12 shows the symbol of 8 to1 Mux
The figure 4.13 shows the logic circuit diagram of 4 to1 Mux.
4.3.7 De-Multiplexers
In electronics, a demultiplexer is a device which separates the input signal
to multiple output signals. At the receiving end demultiplexer can be used as
a complementary to the multiplexer which is at transmitting end. A
demultiplexer can be considered as switch with single input and multiple-
outputs. The figure 4.14 shows schematic of a 1 to 2 demultiplexer. A
demultiplexer can also be equated to a controlled switch.
With the above method, when the wheel is turning there is no guarantee
that all the brushes break or make contact with stripes at the same time. As
different brushes break or make contact, while going from position 7 (0111)
to 8 (1000), one might pass spuriously and transiently through 6 (0110),
14 (1110), and 10 (1010).
One can avoid the transient states between 7 and 8 by using Gray code on
the encoding stripes. An algorithm or a circuit which translates back the
Gray code to integer is required. The Gray code is generated by a cascade
of XOR gates; XOR of all most significant input bits gives an individual
output bit. In a circuit, N-1 steps are required to perform the inversion of N
bit Gray code. In a register with binary word operations, instead of doing N
operations consecutively on ln2N operations are sufficient. The number of
operations can be reduced by using associativity of XOR and hierarchically
grouping the operations. The above step involves the right shits of input bits
by 1, 2, 4, 8, and so on bits till the word length are zero.
Gray codes are not arithmetic codes. 4 bit gray code numbers for binary
numbers are shown in table 4.15.
Table 4.9: 4 bit gray code numbers for Binary numbers
↓
Gray
1 0
Code
Binary
Number
1 1 0 0 1 0
↓
Gray
1 0 1
Code
Binary
Number
1 1 0 0 1 0
↓
Gray
1 0 1 0
Code
Binary
Number
1 1 0 0 1 0
↓
Gray
1 0 1 0 1
Code
Binary
Number
1 1 0 0 1 0
↓
Gray
1 0 1 0 1 1
Code
Thus, the BCD encoding for the number 256 would be:
0010 0101 0110
As the data in most of the computers are stored in eight bit bytes, the four
bit BCD digits can be stored in those bytes using two ways:
In a byte, BCD digit is stored in one nibble, and other nibble of a byte is set
to all zeros or all ones (as in the EBCDIC code), or to 0011 (as in the ASCII
code) two digits are stored in each byte.
By mapping each nibble to a different character, BCD encoded numbers
can be easily displayed. Generally, integer multiplication or division
operation are involved in conversion of binary coded number to decimal,
because of above reason the display of binary coded number is harder. In
electronic systems which have only digital logic but no microprocessor, BCD
is used to display the numeric values. In BCD each digit has been treated
as a single sub circuit, because of that the manipulation of numerical values
for display can be simplified to great extent. This matches much more
closely the physical reality of display hardware. For example, a designer can
develop a metering circuit by choosing a series of identical 7-segment
displays. A complex circuitry would be required to interface a display device
if the numeric data is manipulated and stored in the form of pure binary.
Therefore, using BCD a simple digital system can be developed than
converting to pure binary, and also calculations are relatively simple. Even
the digital system which has embedded microcontroller or small processor
will hold the same argument. On limited processors the process of
converting numeric’s to or from binary representation can be expensive,
less expensive systems can be developed by representing numeric’s in
BCD format and often it results in smaller code. For these applications,
some small processors feature BCD arithmetic modes, which assist when
writing routines that manipulate BCD quantities.
Packed BCD
In packed BCD encoding two digits are placed in a single byte. Packed BCD
encoding is also known as simply packed decimal. Decimal integers are
stored in all upper bytes plus upper four bits of the lowest byte of a multi
byte word. The lower four bits of the lowest byte are used as the sign flag.
As an example, in a word of 32 bits which contains 8 nibbles or 4 bytes
lowest nibble is used stores sign flag of the decimal value and integers are
stored in upper 7 nibbles.
Standard sign values are 1100 (Hex C i.e Ch) for positive (+) and 1101 (Dh)
for negative (–). Other allowed signs are 1010 (Ah) and 1110 (Eh) for
positive and 1011 (Bh) for negative. Some implementations also provide
unsigned BCD values with a sign nibble of 1111 (Fh). In packed BCD, the
number 127 is represented by "0001 0010 0111 1100" (127Ch) and -127 is
represented by "0001 0010 0111 1101 (127Dh).
Sign BCD
Digit 8 4 2 1 Sign Notes
A 1010 +
B 1011 −
C 1100 + Preferred
D 1101 − Preferred
E 1110 +
F 1111 + Unsigned
As two digits are stored in a byte, the number of nibbles is always even
irrespective of size of the word. Therefore there can be (2n)-1 decimal digits
in a n bytes word. The number of decimal digit is always odd. A decimal
number with d digits requires ½(d+1) bytes of storage space.
For example, a four-byte (32bit) word can hold seven decimal digits plus a
sign, and can represent values ranging from ±9,999,999. Thus the number
-1,234,567 is 7 digits wide and is encoded as:
0001 0010 0011 0100 0101 0110 0111 1101
1 2 3 4 5 6 7 -
(Note that, like character strings, irrespective to endianness of the digital
system – lowest address space in memory is used to store the first byte of
the packed decimal).
In contrast, a four-byte binary two's complement integer can represent
values from −2,147,483,648 to +2,147,483,647.
While packed BCD does not make optimal use of storage (about 1/6 of the
memory used is wasted), conversion to ASCII, EBCDIC, or the various
encodings of Unicode is still trivial, as no arithmetic operations are required.
The extra storage requirements are usually offset by the need for the
accuracy that fixed-point decimal arithmetic provides. More dense packings
of BCD exist which avoid the storage penalty and also need no arithmetic
operations for common conversions.
Fixed-point packed decimal
Programming languages such as COBOL and PL/I support fixed point
decimal numbers, and a decimal point has to be provided in front of one of
the digits. For example, the fixed point value +1234.567 can be represented
by 12 34 56 7C (a packed decimal value) if the decimal point is placed
between 4th and 5th digits.
12 34 56 7C
12 34.56 7+
Higher-density encodings
Totally 12 bits are required for a three decimal digits if each digit is
represented using four bits. However, since 210 (1,024) is greater than 103
(1,000), only 10 bits are sufficient if the encoding of all three decimal digits
done together. Two such encodings are Chen-Ho encoding and Densely
Packed Decimal. Densely Packed Decimal encodes two digits in the optimal
7 bits and one digit in 4 bits.
Zoned decimal
An IBM mainframe system uses Zoned decimal numeric representations. In
this encoding, each digit is stored in one byte with lower four bits encoding
the digit in BCD form. The upper bits are called the zone bits; they are set to
a fixed value so that the character value of the digit is stored in the byte.
EBCDIC systems use a zone value of 1111 (hex F); this yields bytes in the
range F0 to F9 (hex), which are the EBCDIC codes for the characters "0"
through "9". Similarly, ASCII systems use a zone value of 0011 (hex 3),
giving character codes 30 to 39 (hex). For signed zoned decimal values, the
sign digit of a numeric is stored in the least significant zone nibble of the
byte. Even for packed decimal, sign bits are stored in the same set of
values. Thus a zoned decimal value encoded as hex bytes F1 F2 D3
represents the signed decimal value −123.
i.e. F1 F2 D3 is the zoned representation of -123.
However, in BCD, per nibble value greater than 9 cannot exist. To correct
the value of first two digits, sum will be added with 6 (0110):
[0000 1110] + [0000 0110] = [0001 0100]
[0001] and [0100] are two nibbles, which correspond to "1" and "4"
respectively. This gives correct result “14” in BCD. The above technique can
be extended to adding multiple digits groups from right to left, the second
digit is propagated as a carry, and always 5 bit result is compared to 9.
Subtraction with BCD
Subtraction is done by adding the nines' complement plus 1, or by adding
the ten's complement of the subtrahend.
4.7 Summary
Let us recapitulate the important concepts discussed in this unit:
A digital circuit which generates a set of outputs from set of inputs using
Boolean operations is known as combinational circuits.
A half adder is a digital circuit which accepts two inputs and performs
addition on them and generates two binary digits known as sum(S) and
carry(C).
A digital comparator is a hardware electronic device that compares two
numbers in binary form and generates a one or a zero at its output
depending on whether they are the same (i.e. equal) or not.
An encoder is a device used to change a signal (such as a bit stream) or
data into a code.
A decoder is a digital device which decodes the original information from
the encoded inputs.
Multiplexing of many signals is performed by the device known as
multiplexer or mux.
In packed BCD encoding two digits are placed in a single byte.
Excess-3 binary coded decimal (XS-3), also called biased
representation
4.9 Answers
Self Assessment Questions
1. Combinational
2. Full adder
3. Half adder
4. True
Manipal University Jaipur B0948 Page No. 91
Logic Design Unit 4
5. Decoder
6. Priority encoder
7. Gray codes
8. True
9. True
10. Zoned
11. Biased representation
12. True
Terminal Questions
1. Refer to section 4.3.
2. Refer to section 4.3.3
3. Refer to sub-section 4.3.4
4. Refer to sub-section 4.3.5
5. Refer to sub-section 4.3.6
6. Refer to section 4.4
5.1 Introduction
In the previous unit we studied about combinational circuits, and different
codes like Gray code, BCD code, and Excess-3 code. In 1918 William
Eccles and F.W. Jordan invented the first flip flop. Initially it was named after
the inventers and was called as Eccles Jordan trigger circuit. The name flip-
flop was later derived from the sound produced on a speaker connected to
one of the back coupled amplifiers outputs during the trigger process within
the circuit. This original electronic flip-flop – a simple two-input bistable
circuit without any dedicated clock (or even gate) signal, was transparent,
and thus a device would be labeled as a "latch" in many circles today.
In digital circuits, combinational circuits don’t have memory to store the
values and its output depends only on the inputs. A powerful model is
required to build a complex digital system. In order to build a powerful
model, a digital circuit which has a memory and its output should depend on
its previous state and also on the input to the circuit is required. So a device
should have following three characteristics to serve as a memory:
two stable states should exists in the device
the state of the device should be readable.
at least once, we should be able to set the state of the device.
5.3 Latch
The S-R Latch
The figure 5.1 shows the SR latch constructed using NOR gates. From
figure 5.1, it can be observed that the output of each NOR gate is given as
feedback to the other NOR gate.
Figure 5.1: The S-R Latch. S sets the latch, causing Q to become true.
R resets the latch.
When both the inputs to an NOR gate are low, the output will be high. From
the circuit it can be analyzed that among two NOR gate outputs, only one
output will be high and other will be low. Consider that the output of the
upper NOR gate ( Q ) is high, as this output is connected as input to the
lower NOR gate its output will be low. This circuit is an S-R latch. Where S
stands for set and R stands for reset, because of which it is also known as
set-reset latch.
By examining the circuit we can see that both the inputs of NOR gate should
be low to generate a high output. When the set S button is pressed, the
output of the latch will be high i.e.; output of lower gate and its complement
output will be low. The latch will be set i.e. its output will be high when the
Set S input is high, and the latch will be reset i.e., its output will be low when
the reset R input is high. Even when the inputs are removed the circuit will
be in the stable state. The inputs which generated a particular output and
When the control signal is true, the S and R signals are propagated through
the AND gates and the stored value can change. Because the control input
is generally driven by a regular train of pulses, it is often called a clock input.
Figure 5.3-A shows the digital circuit of a clocked S-R latch and figure 5.3-B
shows the symbol for the clocked S-R latch.
Figure 5.3-A: Clocked S-R latch. The latch can change only when C is true.
First experiment the given digital circuit with different combination of S and
R inputs by giving low to C input. Later a high value is applied to C and
circuit is experimented with different values of S and R inputs. But when
both S and R inputs are high, clocking will not help much. When S and R
values are equal to 1, and C is clocking, it is difficult to predict which value
will be stored in the memory, either true value or complement value. But
latch will settle down to one of the two stable states when both inputs S and
R are removed at the same time.
The Clocked D-Latch
When the idea of clocking is applied to S-R latch, the problem of what
should happen when S=R=1 can be taken care of and the input to the circuit
can also be simplified.
Usually one bit information should be stored in the memory element. The
complexity of the circuit increases when the set and reset of the latch are
explicitly needed.
The main intention is to design a circuit which has a data input and data
output. When the clock signal is high, irrespective of the value at data input
D storage device should store the value of D and transfer to the data output
Q.
Figure 5.4-A shows the circuit for clocked D latch and the figure 5.4-B
shows the logic symbol of clocked D latch.
The circuit shown in above figure 5.4-A has two inputs. One is control input
and other is data input. An AND gate is used to connect the data input to the
S input of an S-R latch and the data input is connected to R input through
an inverter and an AND gate. The control input C is connected as the
second input to both the AND gates. The state of the latch will not change
when the control input C is applied with low value. When the control input
and the data input are true (i.e. High), the Set input of the latch also will be
true and therefore the true value is stored in the element. When the control
input is true and the data input is false, the Reset input of the latch also will
be true and therefore the false value (i.e low value) is stored in the element.
Here is something to think about: The concept of a D latch, where the bit to
be stored is applied to the S input of a latch, and through an inverter to the
R input, can only be made to work when the latch is clocked. Why is that?
When the control input is true, the clocked D latch stores the data input D
value. The correct value of D will be stored in the latch if the control input is
triggered only when the input to the circuit is settled.
The functionality of the circuit is analyzed by asserting the value of C and
changing the values of D. The output of the circuit will be equal to the data
input D if the C input is high. This kind of clocked D latches are said to be
level triggered devices, the level at C says whether to store the data or not.
Self Assessment Questions
3. The latch will be set when the Set S input is ________________.
4. Usually one bit information should be stored in the _________element.
5. The control input which is generally driven by a regular train of pulses
is often called a _____________ input.
6. When the control input is true, the clocked D latch stores the data input
D value (True or False?).
Basic flip-flops
Two NOR gates or two NAND gates can be used to construct a flip flop.
Usually flip flop are used in constructing the sequential circuits. As Flip flop
has two stable states, it is also known as bi-state gate. Until the trigger is
received by the flip flop, it maintains its state for indefinite amount of time.
When the trigger is applied according to the predefined rules, the state of
the flip flop changes and the new state will be unchanged till another trigger
is applied.
Flip – Flop circuit using NOR gates
The functionality of the flip flop can be explained using cross coupled two
NOR gates or NAND gates. The cross coupled circuits will have the
feedback paths. The figure 5.5 shows the logic diagram of SR Flip flop using
NOR gates
Normal value (Q) and the complement value ( Q ) are the two outputs of a
flip flop. Set(S) and Reset (R) are the two inputs for above circuit. The
current state of the output is determined by the feeding back the previous
states. i.e output is feedback to the input as shown in figure 5.5. Flip-flops
which are constructed using NOR gates works normally at input equal to
logic zero.
When the S input is equal to 1 and R input is 0, the output Q is equal to 0.
As this Q value is given again along with R, the output Q will become 1.
Therefore, from the above discussion we can say that when S = 1and R = 0,
outputs Q will be 1 and Q will be 0.
The state of outputs will be unchanged even when the Set input is made 0
and R is also 0. When the S input is equal to 0 and R input is 1, the output
The outputs Q and Q are 0’s when inputs S = 1 and R = 1. This violates the
fact that Q and Q are complement to each other. This condition must be
avoided in normal operations.
From the above discussion, it can be observed that the flip flop has two
stable state i.e., set state (Q =1, Q = 0) and reset state (Q = 0, Q = 1).
Table 5.2: Truth table for S-R flip flop using NAND gates
Flip flops which are constructed using NAND gates works normally at input
equal to logic one. When the input S is applied with logic 0, then the outputs
Q will be 1 and Q will be 0. Then flip flop is said to be in set sate. If R input
is applied with logic 0, then outputs Q will be 0 and Q will be 1. Then flip
flop is said to be in reset state. Both the output Q and Q will be 1 if S and R
inputs are applied with logic 0. In normal operation this condition must be
avoided.
R-S, D, J-K and T are the different types of flip flops used in designing
sequential circuits. The digital circuits like memories and microprocessors
can be constructed by interconnecting flip-flops to form the logic gates.
5.4.1 SR flip-Flop
The figure 5.7 shows the logic symbol of Set-Reset flip-flops (SR flip-flop).
Normally, in storage mode, the S and R inputs are both low, and feedback
maintains the Q and Q outputs in a constant state, with Q the complement
of Q. If S (Set) is pulsed high while R is held low, then the Q output is forced
high, and stays high even after S returns low; similarly, if R (Reset) is pulsed
high while S is held low, then the Q output is forced low, and stays low even
after R returns low. The table 5.3 shows the truth table SR flip-flop which
shows the operation of SR flip-flop.
SR Flip-Flop operation
Characteristic table Excitation table
S R Action Q(t) Q(t+1) S R Action
0 0 Keep state 0 0 0 X No change
0 1 Q=0 0 1 1 0 Set
1 0 Q=1 1 0 0 1 Reset
1 1 Unstable combination, 1 1 X 0 No change
5.4.2 JK flip-flop
The figure 5.8 shows the timing diagram for JK flip-flop.
In the JK flip flop circuit symbol, the clock input is shown as > and data
inputs are J, K. Q and Q are the data outputs. The characteristic equation
of the JK flip-flop is:
The origin of the name for the JK flip-flop is detailed by P. L. Lindley, a JPL
engineer, in a letter to EDN, an electronics design magazine. The letter is
dated June 13, 1968, and was published in the August edition of the
newsletter. In the letter, Mr. Lindley explains that he heard the story of the
JK flip-flop from Dr. Eldred Nelson, who was responsible for coining the
term while working at Hughes Aircraft. Flip-flops in use at Hughes at the
time were all of the type that came to be known as J-K. Another theory
holds that the set and reset inputs were given the symbols "J" and "K" after
one of the engineers that helped design the J-K flip-flop, Jack Kilby.
5.4.3 D flip-flop
The symbol of D flip flop is shown in the figure 5.10.
During the positive edge of the clock or negative edge of the clock, the
output of the flip flop will take the value of D. The flip flop output should not
take the values of inputs on both the edges of the clock. As the output of the
flip flop takes the value of input after one clock cycle, it is called the D or
Delay flip flop. The D flip flop can also be used as a memory cell or zero
order hold or a delay line. The table 5.5 shows the truth table of D flip-flop.
Usually a master slave flip flop responds during the negative edge of the
enable input. When the clock input low for a positive edge triggered master
slave D flip flop and enable to the master is high. During the transition of
clock from low to high, the input value will be latched. When the clock is
changed from 0 to 1, the enable to the master will go low and its locks the
value which is at master’s input. At the same time, the enable to the slave
will be changed from low to high and the signal which is captured by the
master is latched by the slave. When the clock signal is changed from high
to low, the output of the slave is locked and holds the value which is seen at
the last positive edge while the master accepts the new value. The figure
5.12 shows the circuit for positive edge triggered master slave D flip flop.
Figure 5.12: Circuit for positive edge triggered master slave D flip flop
A negative edge triggered flip flop can be determined by removing the left
most inverter in the above circuit. This has a truth table as shown in
table 5.6.
Table 5.6: Truth table for negative edge triggered D flip- flop
D Q > Qnext
0 X Falling 0
1 X Falling 1
Like SR flip flop, most of the D flip flops in digital systems has set and reset
capability. In D flip flop the illegal condition i.e., S=R=1 in SR flip flop is
resolved (refer to the truth table shown in table 5.7).
From the timing diagram, it is clear the circuit accepts the value in the input
when the clock is HIGH, and passes the data to the output on the falling-
edge of the clock signal (i.e when clock pulse is making transition from 1 to
0). Thus Master-Slave J-K flip flop is a Synchronous device since it only
passes data with the timing of the clock signal.
Application of flip-flops
An important application of flip-flops is in the design of digital counters.
These devices generate binary numbers in a specified count sequence
when triggered by an incoming clock waveform. On each trigger, the
counter advances to the next number in the sequence. After reaching the
final state in the sequence, the counter then recycles. Counters may be
used to count up or down, to cycle through memory addresses in
microprocessors applications, to generate waveforms of particular patterns
and frequencies, and to activate other logic circuits in a complex process.
From the state diagram, we can generate the state table shown in table 5.8
Note that there is no output section for this circuit. Two flip-flops are needed
to represent the four states and are designated Q0Q1. The input variable is
labeled x.
Table 5.8: State table
Present State Next State
Q0 Q1 x=0 x=1
00 00 01
01 10 01
10 10 11
11 11 00
We shall now derive the excitation table and the combinational structure.
The table is now arranged in a different form as shown in table 5.9, where
the present state and input variables are arranged in the form of a truth
table.
Table 5.9: Excitation table of the circuit
0 → 0 0 X
0 → 1 1 X
1 → 0 X 1
1 → 1 X 0
The Table 5.10 shows the Excitation table with present state and next state.
Table 5.10: Excitation table with present state and next state
Present State Next State Input Flip-flop Inputs
Q0 Q1 Q0 Q1 x J0K0 J1K1
00 00 0 0X 0X
00 01 1 0X 1X
01 10 0 1X X1
01 01 1 0X X0
10 10 0 X0 0X
10 11 1 X0 1X
11 11 0 X0 X0
11 00 1 X1 X1
In the first row of table 5.10 we have a transition for flip-flop Q0 from 0 in the
present state to 0 in the next state. In table 5.10 we find that a transition of
states from 0 to 0 requires that input J = 0 and input K = X. So 0 and X are
copied in the first row under J0 and K0 respectively. Since the first row also
shows a transition for the flip-flop Q1 from 0 in the present state to 0 in the
next state, 0 and X are copied in the first row under J1 and K1. This process
is continued for each row of the table and for each flip-flop, with the input
conditions as specified in table 5.10.
The simplified Boolean functions for the combinational circuit can now be
derived. The input variables are Q0, Q1, and x; the outputs are the variables
J0, K0, J1 and K1.The information from the truth table is plotted on the
Karnaugh maps shown in figure 5.17.
The Table 5.12 shows the excitation table for D flip-flop. Next step is to
derive the excitation table for the design circuit, which is shown in table
5.13. The output of the circuit is labeled Z.
Table 5.13: Excitation table
Present State Next State Input Flip-flop Input Output
Q0 Q1 Q0 Q1 x D0 D1 Z
00 00 0 0 0 0
00 01 1 0 1 0
01 00 0 0 0 0
01 10 1 1 0 0
10 11 0 1 1 0
10 10 1 1 0 0
11 00 0 0 0 0
11 01 1 0 1 1
Now plot the flip-flop inputs and output functions on the Karnaugh map to
derive the Boolean expressions, which is shown in figure 5.19.
5.6 Summary
Let us recapitulate the important concepts discussed in this unit:
Flip flop is a device which changes its state at the positive edge or
negative edge (also known as leading edge and trailing edge) of the
clock signal. A synchronous latch is device which monitors the input
signal and changes its state whenever the control signal is high.
As the flip flop stores the given values, in a memory device it can be
used as basic storage device. Only one bit information can be stored in
a Flip Flop.
Two NOR gates or two NAND gates can be used to construct a basic
flip flop.
Flip-flops types are: SR ("set-reset"), D ("data" or "delay"), T ("toggle"),
and JK flip flop.
The output of the flip flop takes the value of input after one clock cycle in
case of D flip flop.
All the shift registers which are important part of digital system are
constructed using flip flops.
Master-slave flip flop is designed using two separate flip flops. One acts
as the master and another acts as slave.
5.8 Answers
Self Assessment Questions
1. True
2. Flip flop
3. High
4. Memory
5. Clock
6. True
7. Basic storage
8. True
9. True
10. Clk=1
11. Flip-flops
12. State table
Terminal Questions
1. Refer to section 5.2
2. Refer to section 5.4
3. Refer to sub-section 5.4.4
4. Refer to section 5.5
6.1 Introduction
In the previous unit, we studied about the definition of sequential circuit,
latches and flip flops and various types of flip-flops. We also studied about
real world applications of sequential circuits. Historically a shift register was
built as early as in 1940’s. It was a code-breaking machine, having
five-stages and was built using vacuum tubes. Shift registers are typically
used as converters between serial and parallel devices. Most of the data
processing logic works on set of bits together. An example can be the CPU
of a computer that works on data bits stored in the registers. Hence
mapping serial stream of data into parallel data bytes is really useful. At the
same time it is easier to implement serial data transmission logic. We can
think of shift registers as delay elements. We can implement stack of a CPU
in hardware using bi-directional shift registers. Unlike mono-shots
(mono-stable multi-vibrators), the accuracy of timing offered by shift
registers is independent of its component values. Hence pulse extenders
can be realized using them. However the timing properties of shift register
are defined and limited by the clock signal supplied to it.
Architectures of old computers involved shift registers in the CPU for holding
and moving the data into the ALU (Arithmetic Logic Unit). The two operands
of addition were first shifted into the shift registers and then shifted out into
ALU for performing addition. The answer was again moved back to one of
the shift register, generally known as the Accumulator.
Most of the CPU’s have machine level instructions that can move the bits
stored in a shift register to the left or right in a group. These instructions are
‘shift left’ and ‘shift right’. Higher level languages also provide constructs
that make use of these instructions. As we know from binary arithmetic, left
shifting of data multiplies it by two and right shift of it divides the same by
two.
Historical computers used very large sized shift registers (serial-in – serial-
out type), having sizes of few thousands of bits. These worked like delay
line memory elements. In this unit we study about the definition of shift
registers, its types and their operation. We also study some shift
register ICs.
Objectives:
By the end of Unit 6, the learners are able to:
define shift registers.
list and explain different types of Shift Registers
discuss on IC 74LS395
The string of bits that we want to shift in are given to the input pin named
‘Data In’. Each bit presented at ‘Data In’ is shifted to its right one flip-flop at
a time, every time ‘Data Shift’ signal is enabled. First time, the bit on ‘Data
In’ line is moved into the first ‘flip-flop’s output. The data bit on the rightmost
flip-flop gets shifted out through the output line of the shift register ‘Data
Out’. The bit that goes out through ‘Data Out’ is lost. The figure 6.2 shows
the 4-bit Serial-In Serial-Out (SISO) Shift Register.
Let us see more clearly how this works. Each row of four bits in the table 6.1
can be imagined to be the outputs of the four flip-flops that make up our
SISO (serial-in serial-out) shift register.
Table 6.1: Truth table of SISO shift register
Let the register is reset so that all the flip-flop outputs to 0. We now feed a
stream of bits (LSB) 1, 0, 1 ,1 (MSB) at ‘Data In’ line and at the same time
pulse the ‘Data Shift’ signal for every data bit. We see that data is right
shifted for every pulse and after four pulses the register is filled with 1101
from left to right. If we clock further, the data can be read out from ‘Data Out’
with simultaneous right shift of data bits as shown in the table 6.1. From the
clock pulse 5th onwards, we assumed that the data In takes the 0 as its input
data.
If we collect all the data bits at ‘Data Out’ line after the register is filled with
the serial data input, we get 10110000 as the bit stream. So what we get at
the output is what we had put in through the input. However the output is
delayed by four cycles of clocking or pulsing the ‘Data Shift’ line. The data
movement though SISO shift register resembles a queue implemented in
hardware. To start over again, the register flip-flops can be set to 0 by
asserting the ‘Reset’ input. Since the data bits that are shifted out of ‘Data
Out’ are lost, we call this destructive readout.
Non-destructive readout
It is possible to ensure reading the data out from a SISO shift register is
non-destructive. All we have to do is to connect the ‘Data Out’ line to
Manipal University Jaipur B0948 Page No. 120
Logic Design Unit 6
‘Data In’ line under the control of an additional input line. Let us call this
‘Read/Write (R/W)’ line. When this input is set to 1(or Write), it behaves like
a normal SISO register with destructive readout. When R/W is set to
0 (Read), ‘Data Out’ gets logically connected to ‘Data In’ and the data bits
that get shifted out upon pulsing the ‘Data Shift’ line become the inputs and
get shifted in again. Thus the data is retained in the shift register.
6.3.2 Serial-In Parallel-Out (SIPO)
This is almost similar to SISO shift register discussed in the section 6.3.1
except that the data are readout in parallel at the same time. this means,
We can input the data bits into this shift register serially via ‘Data In’ input
line and data can be read out in parallel from data out lines. The concept of
SIPO is shown in figure 6.3.
The figure 6.6 shows the 4-bit Parallel-In Serial-Out (PISO) Shift Register
and table 6.3 shows its truth table. In this type, the data input can be given
in parallel to the input line of each of the flip-flops, D1 through D4. To switch
between data-input and data-shift mode, we use a signal ‘Write/Shift’ (W/S).
X= 0 or 1
6.3.4 Parallel-In Parallel-Out (PIPO)
The PIPO register is mainly used to shift a given set of bits and present it to
the next stage as illustrated below. Input for shifting can be loaded into the
register in parallel and the shifted output can be read out of the register in
parallel as well. Hence the name PIPO shift register. The concept of PIPO is
shown in figure 6.7.
In the above schematic diagram of PIPO shift register, we load the data at
D1-D3 inputs. The ‘mode’ input is used to swap between ‘parallel load’ and
‘shift’ operation. Additional control pins may be provided for changing the
direction of the data shift. Once the ‘mode’ input is set to ‘shift’ the loaded
data can be shifted upon supplying the clock signal. The shifted data can be
obtained at the outputs Q1-Q3. The ‘data in’ and ‘data out’ lines can be used
to enable serial input and serial output operation. They can also be used for
cascading additional stages. Shift register shown in figure 6.7 can also be
used to input/output data serially. So we can call this a universal shift
register.
The figure 6.8 shows the 4-bit Parallel-In Parallel-Out (PIPO) Shift Register
and table 6.4 shows its truth table.
Figure 6.9: 74LS395 Parallel-In Parallel-Out Shift Register with Tri-state output
The 74LS395 IC resembles very much like our theoretical PIPO shift
register that shifts data right. The schematic diagram shown above is
simplified version of that found in the data sheet. You may refer to the
detailed information.
LD/SH' controls the AND-OR multiplexer at the data input to the FF's. If
LD/SH'=1, the upper four AND gates are enabled allowing application of
parallel inputs DA DB DC DD to the four FF data inputs. Note the inverter
bubble at the clock input of the four FFs. This indicates that the 74LS395
clocks data on the negative going clock, which is the high to low transition.
The four bits of data will be clocked in parallel from DA DB DC DD to QA QB
QC QD at the next negative going clock. In this "real part", OC' must be low if
the data needs to be available at the actual output pins, as opposed to only
on the internal FFs.
The previously loaded data may be shifted right by one bit position if
LD/SH'=0 for the succeeding negative going clock edges. Four clocks would
shift the data entirely out of our 4-bit shift register. The data would be lost
unless our device was cascaded from QD' to SER of another device. The
figure 6.10 shows the loading and shifting of parallel data.
Right shifting of data is shown in figure 6.12 and is provided for reference to
the previous right shifter shown in figure 6.11.
The figure 6.13 serves as a reference for the hardware involved in left
shifting of data.
If we need to shift left, then the FFs need to be rewired. Compare to the
previous right shifter, SI and SO have been reversed. SI shifts to QC. QC
shifts to QB. QB shifts to QA. QA leaves on the SO connection, where it
could cascade to another shifter SI. This left shift is backwards from the
right shift sequence as shown in figure 6.14.
Above we shift the same data pattern left by one bit. The issue with the
above arrangement is that, it is not much in demand in the market. Hence it
is hardly manufactured. We can reverse the shifting direction by
appropriately wiring a physical shift register IC externally. Thus the direction
of shift loses significance in a way. However better arrangement would be to
bring the desired direction of shift under the control of an input signal as
shown in figure 6.15.
Data shifts in at SL, to QC, to QB, to QA, where it leaves at SL cascade. This
pin could drive SL of another device to the left.
The prime virtue of the above two figures 6.15 and 6.16 illustrating the "shift
left/ right register" is simplicity. The operation of the left right control L'/R=0
is easy to follow. A commercial part needs the parallel data loading implied
by the section title. This appears in the figure 6.17 shown below.
Now that we can shift both left and right via L'/R, let us add SH/LD', shift/
load, and the AND gates labeled "load" to provide for parallel loading of data
from inputs DA DB DC. When SH/LD'=0, AND gates R and L are disabled,
AND gates "load" is enabled to pass data DA DB DC to the FF data inputs.
The next clock CLK will clock the data to QA QB QC. As long as the same
data is present it will be re-loaded on succeeding clocks. However, data
present for only one clock will be lost from the outputs, when it is no longer
present on the data inputs. One solution is to load the data on one clock,
and then proceed to shift on the next four clocks. This problem is remedied
in the 74ALS299 by the addition of another AND gate to the multiplexer.
If SH/LD' is changed to SH/LD'=1, the AND gates labeled "load" are
disabled, allowing the left/ right control L'/R to set the direction of shift on the
L or R AND gates. Shifting is as in the previous figures.
The only thing needed to produce a viable integrated device is to add the
fourth AND gate to the multiplexer as alluded for the 74ALS299.
6.5 Summary
Let us recapitulate the important concepts discussed in this unit.
Shift Register is a set of binary storage elements, typically flip-flops
combined and linked together to facilitate the movement of the data bits
stored, from one to another and in and out of it, whenever desired by
activating control signals.
Four types of shift registers are: Serial Input Serial Output (SISO), Serial
Input Parallel Output (SIPO), Parallel Input Serial Output (PISO) and
Parallel Input Parallel Output (PIPO).
In SIPO, we can input the data bits into this shift register serially via
‘Data In’ input line and data can be read out in parallel from data out
lines.
In Parallel-In, Serial-Out (PISO) shift register, the data input is given in
parallel to the input line of each of the flip-flops and outputs are readout
serially from single output line.
In Parallel-In, Parallel-Out (PIPO) shift register, the data input is given in
parallel to the input line of each of the flip-flops and outputs are readout
in parallel from all the output lines.
6.7 Answers
Self-Assessment Questions
1. Flip-Flops
2. Four
3. Circular.
4. SIPO ( Serial-In Parallel-out)
5. PIPO ( Parallel-In Parallel-out)
6. 74LS395
Terminal Questions
1. Refer Section 6.3
2. Refer Section 6.3
3. Refer Section 6.3
4. Refer Section 6.4
7.1 Introduction
In the previous unit we studied about shift registers and their types. We also
studied some ICs in relation to shift registers. In electronics, a counter is a
logic device which is capable of counting the number of times an event has
occurred. It can also display the count. The counter for its operation needs a
trigger or prompt which conveys that an event has occurred. This trigger is
usually supplied to a counter in the form of a signal called ‘clock’.
Depending on whether the count value increases/decreases, we have the
following basic types of counters.
Up counters - Increase count value
Down counters - Decrease count value
In asynchronous or ripple counters, all the flip-flops are not clocked by the
same clock and all flip-flops do not change their state in exact synchronism
with the applied clock pulses. It is because, usually the clock pulse is
applied to the first flip-flop and the output of the first flip flop is connected as
a clock for the next flip-flop. Asynchronous counters are also called ripple
counters because the flip-flops change their state in a ripple fashion i.e.the
clock pulse fed into first flip-flop ripples through the other counters after
propagation delays, like a ripple on water, hence the name Ripple Counter.
In synchronous counters, all the flip-flops are clocked by the same clock and
all flip-flops change their state in exact synchronism with the applied clock
pulses. So a common clock is connected to all the clock inputs of all the flip
flops. The delay involved is equal to the propagation delay of one flip-flop
only, irrespective of the number of flip-flops used to construct the counter.
An up counter is one which counts in upward direction in ascending order.
On the other hand, a down counter counts in downward direction in
descending order.
A counter which counts in both up and down directions is called an
UP/DOWN counter.
The table 7.1 shows the truth table of 3-Bit asynchronous Up counters
Table 7.1: Truth table of 3-Bit Asynchronous Up Counter
Figure 7.1(a) shows a 3-bit counter implemented using T-flip flops. This
counter can count from 0 to 7 in upward direction (i.e. Count Increases in
ascending order). The T input of each flip-flop is 1(High), so that state of
each flip-flop will be toggled at each positive edge of its clock. The clock
input of the first flip-flop is connected to the Clock line and other two flip-
flops recieve their clock inputs driven by the Q output of the preceding flip-
flop. Therefore, they also toggle their state whenever the preceding flip-flop
changes its state from Q = 1 to Q = 0, which results in a positive edge of the
Q signal.
Figure 7.1(b) shows a timing diagram for the counter. The value of Q0
toggles once after each positive edge of the Clock signal. The second flip-
flop is clocked by Q0, the value of Q1 changes after the negative edge of
the Q0 signal. Similarly, Q2 changes its state after the negative edge of the
Q1 signal. This is also evident from the truth table shown in table 7.1.
If we look at the values Q2Q1Q0 in truth table, counting is in ascending order
in the sequence 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, and so on. This is a modulo-8
counter. Since it counts in the upward direction, it is called an up-counter.
3-Bit asynchronous Down counter
The figure 7.2 shows a 3-bit asynchronous Down counter along with timing
diagram and truth table. The difference between figure 7.1(a) and figure
7.2(a) is that only the clock inputs of the second and third flip-flops are
driven by the Q outputs of the preceding flip-flops, instead of the Q outputs.
The timing diagram shown in 7.2(b) shows how the counter counts during
clock pulse. The truth table shown in table 7.2 clearly indicates the counter
counts in down ward direction and the sequence is 7, 6, 5, 4, 3, 2, 1, 0, 7,
and so on. Since the counter counts in the downward direction, it is called
down-counter.
Synchronous Counters:
The asynchronous counters above are simple but not very fast. If a counter
with a larger number of bits is constructed in this manner, then the delays
caused by the cascaded clocking scheme may become too long to meet the
desired performance requirements. We can build a faster counter by
clocking all flip-flops at the same time as presented below.
Synchronous Up-Counter with T Flip-Flops
An example of a 3-bit synchronous up-counter is shown in figure 7.3(a) and
the timing diagram is shown in figure 7.3(b).
(a)
(b)
Figure 7.3: 3 –Bit Synchronous Up Counter
(a) Logic circuit diagram
(b) Timing diagram
The table 7.3 shows the truth table of a 3-Bit Synchronous Binary Counter.
Table: 7.3: Truth table of a 3-Bit Synchronous Binary Counter
The table 7.4 shows the contents of such a 4-bit up-counter for sixteen
consecutive clock cycles, assuming that the counter is initially 0.
Observing the pattern of bits in each row of the table, it is apparent that bit
Q0 changes on each clock cycle. Bit Q1 changes only when Q0 = 1. Bit Q2
changes only when both Q1 and Q0 are equal to 1. Bit Q3 changes only
when Q2 = Q1 = Q0 = 1. In general, for an n-bit up-counter, a give flip-flop
changes its state only when all the preceding flip-flops are in the state
Q = 1. Therefore, if we use T flip-flops to realize the 4-bit counter, then the T
inputs should be defined as
T0 = 1
T1 = Q0
T2 = Q0Q1
T3 = Q0Q1Q2
In figure 7.4, instead of using AND gates of increased size for each stage,
we use a factored arrangement. This arrangement does not slow down the
response of the counter, because all flip-flops change their states after a
propagation delay from the positive edge of the clock. Note that a change in
the value of Q0 may have to propagate through several AND gates to reach
the flip-flops in the higher stages of the counter, which requires a certain
amount of time. This time must not exceed the clock period. Actually, it must
be less than the clock period minus the setup time of the flip-flops.
Figure 7.5 shows an example timing diagram for the 4-bit synchronous up-
counter. It shows that the circuit behaves as a modulo-16 up-counter.
Because all changes take place with the same delay after the active edge of
the Clock signal, the circuit is called a synchronous counter.
Operation:
Initially all the flip-flops are cleared to zero (0) by making asynchronous
input Clear =1 so that the initial value of the outputs QA QB QC QD =0000.
Now make the clear input=0 so that it becomes inactive. Now the operation
of circuit depends only on the clock input. Also note that inverted output is
Q =1. Since the inverted output Q is connected to the input of the first flip
flop, the input D=1. Now when 1st clock pulse is applied, shifting operation
takes place and hence after the 1st clock pulse, QA QB QC QD =1000. The
complete bit patterns of this circuit for the subsequent clock pulses is 1000,
1100, 1110, 1111, 0111, 0011, 0001, 0000... . and is shown in the table
7.5.
Table 7.5: Truth Table for a 4-bit Johnson Ring Counter
From the timing diagram shown in figure 7.7, it is clear that after the 8th
pulse t8 (i.e. after second 0th pulse in the truth table 7.5), the sequence
repeats again with the initial value QA QB QC QD =0000.,
Apart from counting or rotating data around a continuous loop, ring counters
can also be used to detect or recognise various patterns or number values
within a set of data. By connecting simple logic gates such as the AND or
the OR gates to the outputs of the flip-flops the circuit can be made to detect
a set of number or value.
Standard 2, 3 or 4-stage Johnson Ring Counters can also be used to divide
the frequency of the clock signal by varying their feedback connections and
divide-by-3 or divide-by-5 outputs are also available. For example, a 3-stage
Johnson Ring Counter could be used as a 3-phase, 120 degree phase shift
square wave generator by connecting to the data outputs at A, B and NOT-
B. The standard 5-stage Johnson counter such as the commonly available
CD4017 is generally used as a synchronous decade counter/divider circuit.
7.2.2 Ring Counter
A ring counter is a circulating shift register in which the output the last flip
flop is fed back to input of the first flip-flop thus forming a loop. All but one
flip-flop in a ring counter will be in the same state which could be either 0 or
1. Usually a bit “1” for a single flip-flop will be chosen, then the valid states
of the 4 bit ring counter are 1000, 0100, 0010,0001 etc.
Figure 7.8: Ring Counter (a) Logic diagram counter (b) Timing diagram
The table 7.6 shows the truth table of 4-Bit ring counter
Table 7.6: Truth table of 4-Bit ring counter
Operation:
The operation of the circuit is straight forward. Assume that the initial output
of first flip-flop is 1 and rest of the flip-flops and ‘INPUT’ are at 0. This
means that A will be at 1 and B, C and D will be at 0. We can say that the
counter state now is 1000 i.e. The Q output of first flip-flop is also connected
to the B input of the first AND gate.
Let us apply a logic 1 to the ‘INPUT’ line which is connected to A inputs of
all the AND gates. We know that as outputs (Q) of FF2 to FF4 are low,
outputs of AND gates 2, 3, 4 will be 0. But the output of AND gate 1 is HIGH
(1) as both of its inputs are at 1. This resets Q of FF1 to 0 and sets that of
FF2 to 1. Hence B will be at logic 1 and A, C, D outputs will be at logic 0.
Please note that in this process, the original state of FF1 appears to be
shifted right by one position. The counter state now is 0100. Now if we apply
one more pulse to the ‘INPUT’ line again, the same process repeats and the
counter state would ne 0010.
Ring counter using D-flip flops:
A ring counter can also be constructed using d flip flops. The figure 7.9
shows a 4-Bit ring counter implemented using D-flip flops.
From the truth table it observed that we want the counter to count only from
000 to 101 and the count 110 is not required to be count. So the counter
should reset to 000 immediately after the count 101. Observe that count 110
corresponds to Q2=1, Q1=1 and Q0=0. So we give the Q2 and Q1 as inputs
to two input NAND gate so that whenever the value Q2=1 , Q1=1 appears
the NAND gate outputs zero(o) and this out in turn activate the
asynchronous inputs Clear (i.e. CLR) so that the counter resets back to 000
and it starts counting again. This mod-6 counter is shown in the figure 7.10.
Note that J=K=1 so that each flip-flop acts as a Toggle flip-flop (i.e. T-flip
flop).
2nd method:
We firstly draw the state diagram as shown in the figure 7.11.
We draw the truth table to represent the desired output of the combinational
circuit to reset FFs as shown in the table 7.8.
Table 7.8: The truth table for Mod 6-counter ( for 2nd method).
Note that the output is 1 for required combinations or count and is 0 for the
count 110 onwards.
Now we use k-map to get the simplified circuit as shown in the figure 7.12
The state table for the counter is given in the table 7.10 and table 7.11 gives
its excitation table.
Table 7.10: State table for the counter
The figure 7.17 shows the Karnaugh Map for Mod-5 Counter.
The figure 7.18 shows the logic circuit diagram for Mod-5 counter.
Solution: The circuit has no inputs other than the clock pulse and no
outputs other than its internal state (outputs are taken off each flip-flop in the
counter). The next state of the counter depends entirely on its present state,
and the state transition occurs every time the clock pulse occurs.
Once the sequential circuit is defined by the state diagram, the next step is
to obtain the next-state table, which is derived from the state diagram in
figure 7.19 and is shown in table 7.12.
Since there are eight states, the number of flip-flops required would be
three. Now we want to implement the counter design using JK flip-flops.
Next step is to develop an excitation table from the state table, which is
shown in table 7.13.
Table 7.13: Excitation table
Now transfer the JK states of the flip-flop inputs from the excitation table to
Karnaugh maps to derive a simplified Boolean expression for each flip-flop
input. This is shown in figure 7.20.
The 1s in the Karnaugh maps of figure 7.20 are grouped with "don't cares"
and the following expressions for the J and K inputs of each flip-flop are
obtained:
J0 = K0 = 1
J1 = K1 = Q0
J2 = K2 = Q1 * Q0
The final step is to implement the combinational logic from the equations
and connect the flip-flops to form the sequential circuit. The complete logic
of a 3-bit binary counter is shown in figure 7.21.
Now derive the excitation table from the state table, which is shown in
table 7.14.
Table 7.14: Excitation table for problem 5
7.5 Summary
Let us recapitulate the important concepts discussed in this unit:
In asynchronous or ripple counters, all the flip-flops are not clocked by
the same clock and all flip-flops do not change their state in exact
synchronism with the applied clock pulses.
Modulus of a counter is the number of different states that a counter can
go through before it comes back to initial state to repeat the count
sequence.
With ‘n’ flip-flops a mod-2n counting is possible either of ascending or of
descending type.
The Johnson counter has an even-numbered cycle length of 2N where
N is the number of stages in the register.
The ring counter continuously circulates a stream of bits, all of which
have same state except one bit. The differing bit may be 1 or 0. Hence
possible 4 bit ring counter sequences are 0001, 0010, 0100, 1000, and
the sequence is repeated.
Self Assessment Questions
1. Counters are designed using basic storage elements such as
__________________.
2. The counting range of a BCD counter is from __________ to _______.
3. The valid states of 3 bit ring counter with differing bit having a value of
logic 1 are _____ , ________ and ___________.
4. The length of a cycle of an n bit Johnson counter is _____________.
7.7 Answers
Self Assessment Questions
1. Flip-flops
2. 0 to 9
3. 001, 010 and 100
4. 2n
5. Binary
6. Mod-6
Terminal Questions
1. Refer to sub-section 7.2.1
2. Refer to sub-section 7.2.2
3. Refer to section 7.3
4. Refer to section 7.4
8.1 Introduction
In the previous unit we studied about different types of counters and design
of counters. With the advent of large and very-large-scale integration,
systems of reasonable complexity are realized on a single chip. Reductions
in the number of elements required to realize each function makes it
possible to use fewer chips or to do more on a given chip. In high-
performance systems, eliminating redundant gates not only frees up chip
area, but also reduces power dissipation, often the limiting factor. There are
of course factors that were not present in the days of discrete logic
elements, such as the value of regularity in the arrangement of elements on
a chip. But the need of powerful methods for generating efficient logic
circuits has indeed returned. A major consequence of the larger scale of
integration is the enormous size and complexity of our systems, and the
increased importance of testing. In this unit you will study some real world
logic circuits and their design.
Objectives:
By the end of Unit 8 the learners will be able to
explain traffic signal systems
explain the functions of switches
electronic tennis scoring system
discuss on temperature & weather forecast systems
Table 8.2 lists the Boolean functions for all the signal lights, in terms of
Boolean variables X, Y and Z.
Table 8.2: Boolean Functions for All the Signal conditions
From the table 8.2, we can note that both the left and right turn signals have
similar switching pattern and hence they have identical functions. Hence
these signals can be controlled by a single block of control logic.
Figure 8.2 shows the logic diagram that generates all the control signals
which can be used to activate all the signal lights according to the Boolean
functions listed in table 8.2.
The IC1 is a 555 timer and is used to generate the clock signal for the
counter IC2. Note that the timer IC is configured as an astable multivibrator.
The duration T for which the IC1 output (clock to IC2) remains HIGH is
given by,
T = 0.695 C2(R1+R2)
Hence we can vary T by varying the values of R1, R2 or C2.
The 4 bit counter IC2 works like a 3 bit counter. The connection to reset
pin 1 from the output Q3 via inverter N1 achieves this. The remaining
counter outputs Q2, Q1 and Q0 map to the variables X, Y and Z
respectively.
We can check the working of the traffic light controller by connecting the
light control outputs to red, yellow and green LED’s which represent the
actual signal lights. To limit the current through the LED’s, we can connect a
resistor (typical value 470 Ohms) in series with each. As we stated before,
only. If in a particular junction, some direction of movement is restricted,
then signals can be suitably merged with the next state.
Manipal University Jaipur B0948 Page No. 164
Logic Design Unit 8
For the manual control of the traffic lights, one can load the desired binary
state code (indicated by X, Y, Z variable values) into the counter IC. For this
purpose the counter must be wired in a pre-settable mode. We can also
reset the signal lights to the initial state (XYZ = 000), by resetting the
counter. This can be achieved by having an external switch which can feed
a LOW (0) to reset pin (pin 1) of IC2. A computer program in C language
which can simulate the traffic light controller circuit on a PC is shown in
figure 8.3. Table 8.3 shows the results of execution of the program.
(a)
(b)
The most common type of switches is the one that we use to turn our lights
on and off. Depending on the power that is switched, size and physical
nature we have a wide range of switches, ranging from sub-micron
transistors to big switches that can switch megawatts of power. Although
there are many types of switches, we are more accustomed to one-way and
two-way electrical switches. The main difference between them lies in the
number of contacts they have. A one-way switch only has two contacts and
a two-way switch has three.
A one-way switch basically operates as a make or break switch. So when it
is turned on, the two terminals are connected, and when it is turned off, the
contact between the two is broken. In contrast, a two-way switch is basically
two, one-way switches combined into one. Here one of the terminals can be
connected to either of the remaining two but not both at the same time.
When we make a connection with one terminal, the connection with the
other is broken.
A switch can be considered to be a ‘gate’ which either allows or disallows
certain entity. When such a switch can be operated using some logic, then
we can call this switch as a ‘logic gate’. Electronic hardware technology
provides us with miniature logic gates which can be put together in large
numbers (several millions) on a single chip, which can function as a system
of logic. A computer is a classic example of such an electronic system
composed of electronic logic gates.
On the other side we have mechanical arrangements that can switch the
track of a train from one to another.
A regular electric switch that can be used to control power to domestic
appliances has small metallic pieces called contacts. And these contacts
are made to physically touch each other to make a circuit, while separation
between them breaks it. The desirable properties of these metallic contacts
are low resistance, very good electrical conductivity, resistance to corrosion,
mechanical strength to name a few. To achieve the desirable properties,
sometimes the contacts may be plated with metals such a gold, copper etc.
Actuator
The mechanical or electromechanical part which helps the contacts to
physically touch and separate are called actuators. These could be a spring
loaded toggle, a rocker, electrically operated relay, a push-button etc.
Contact arrangements
A switch is said to be ‘closed’ if the contacts of the switch are in physically
touching each other, which allows electric current flow through it. When the
contacts are separated with a gap, current cannot flow through the switch.
Now the switch is said to be ‘open’.
Generally electric switches can be classified according to the number of
contacts and mechanical movements required to operate them. A SPST
switch means, single pole (contact) - single throw (movement). But electrical
power supply industry and wiring technicians also have alternate
nomenclature like ‘one-way’ switch; ‘three-way’ switch etc.
The figure 8.5 shows the some of the types of switches based on their
method of contacts.
(a) (b)
(c) (d)
A normally open (‘NO’) switch has its contacts open by default and the
contacts close only when the switch is operated. Similarly a normally closed
(‘NC’) switch has closed contacts until opened by operating the switch.
These are shown in figure 8.6. The nomenclatures are normally used in
logic and wiring diagrams to enhance the clarity of operation. This helps in
minimizing assembly line errors and troubleshooting faults. A switch with
both types of contacts is called a changeover switch or "make-before-break"
switch contact, whereas most switches have a spring loaded action which
momentarily disconnect the load and so are "break-before-make" types by
contrast.
Figure 8.6: (i) Normally Open (‘NO’) switch (ii) Normally Close (‘NO’) switch
This table 8.4 calculates the station pressure for both the minimum (28.00)
and the maximum (32.00) pressures for altitudes from sea level to 10,000
feet in 1000 foot increments. The station pressure is then converted to
MPX4115A pressure sensor volts. Looking at the table, you can see the
predominant change in altitude in the offset voltage of the pressure sensor.
The OA Offset column is the op amp offset voltage that compensates for
altitude. This will be the only calibration variable. Since the instrumentation
amplifier is a rail-to-rail device, in theory it will operate down to 0 volts.
However, to provide some margin, the offsets were chosen to allow a
minimum of 0 .2 volts at the lowest pressure. The gain of 10 was chosen to
allow maximum output voltage swing for all altitudes. The resulting op amp
output voltages are listed in OA Output column. This is the voltage applied
to the DS2438 Vad input.
Circuit Design:
The following circuit design satisfies requirements (refer figure 8.7). INA122
instrumentation amplifier was selected as it eliminated several external
resistors and it provides a very stable gain over a wide temperature. It also
provides excellent rail-to-rail operation allowing full use of the 10 volt input
range of the DS2438. The 40.2K ohm resistor sets the gain to 10. The
variable resistor allows adjustment of the offset voltage from 2.0v to 4.0v.
Calibration:
Hardware calibration is simply a matter of setting the offset voltage to the
value listed in table 8.4 for your altitude. A jumper on the input of the
DS2438 allows the use of the DS2438 to measure the offset. Put the jumper
in the A-C position and using the iButton Viewer for the DS2438, set the
voltage to the table value using the 25-turn pot. Once it is set, put the
jumper in the A-B position to read pressure.
For altitudes in between the values listed in the table, simple interpolation
will give accurate results. An Excel spreadsheet can be used to calculate
intermediate values.
Routines currently exist to measure the DS2438s Vad voltage. Once this
voltage is measured, the pressure is calculated using:
Press = slope * Vad + intercept
Where the slope and intercept are the values listed in table 8.1 for your
altitude. The prototype code had an external text file to store the slope and
intercept values. This allows the user to edit the file to fine-tune the
calibration if desired.
Fine-tuning can be accomplished by monitoring the pressure and comparing
it with a known reference source, such as a nearby airport or national
weather service. Start by adjusting the intercept. When the reference station
indicates a pressure near mid-scale (30.00 inHg), adjust the software
intercept value until your weather station matches. Now monitor the
pressure extremes to determine if the slope needs adjustment.
Future Options:
A fixed resistor could replace the variable resistor. This would eliminate any
hardware adjustments. The value would have to be calculated for a given
altitude. Another possibility is to use several DS2406 1-wire switches or a
programmable potentiometer to set the offset programmatically.
8.6 Summary
In this unit some example of real world electronic design were presented. All
the designs require clear understanding of application requirements, and
accordingly design decisions are taken. While the traffic light controller was
purely digital, temperature and weather forecast system design included use
of sensors and analog components. We also learnt about various types of
switches and the terminology associated with them.
8.8 Answers
Self-Assessment Questions
1. Actuators
2. Boolean
3. Gate
4. True
5. Motorola MPX4115A
Terminal Questions
1. Refer Section 8.2
2. Refer Section 8.3
3. Refer Section 8.4
9.1 Introduction
In the previous unit you studied about some real world logic circuits like
traffic signal systems, tennis scoring system, switches, temperature &
weather forecast systems and their design. Multiplexing equipment used by
the news services in the year 1920s are not commonly counted in the
history of modems as the modem function was incidental to the multiplexing
function. In 1940, George Stibitz connected a new Hampshire teletype to a
computer system in New York City through phone lines. In United States,
modems were part of the SAGE air-defense system in 1950s for connecting
terminals to various radar sites, airbases and command-and-control centers
to the SAGE director present all over the US and Canada. SAGE had
dedicated lines for communication, but the terminal devices at every end
were installed with a king of today’s modem.
Later, when CEO of American Airlines and a region manager of IBM had a
chance of meeting; this led to the development of “mini-SAGE” as an
automatic airline ticketing system. It worked in the lines as sage like ticket
office scattered across the nation had the terminals which are tied to the
central computer that took care of availability and scheduling. This system
known as SABRE is the primitive version of today’s Sabre system.
AT&T maintained a monopoly in the US for many years by letting only AT&T
devices to be connected to the network. AT&T introduced two digital
sub-sets in 1958 for the growing group of computers – Wideband device
and low-speed modem.
Data-phone was introduced in 1960 to replace the term digital subset. The
202 Data-phone which was market extensively in 1960 was a half-duplex
asynchronous service. The 201A operated half-duplex at 2000 bit/s over
normal phone lines, while the 201B provided full duplex 2400 bit/s service
on four-wire leased lines, they sent and received channels running on their
own set of two wires each.
In 1962, the famous 103A was introduced. Over the normal phone lines, it
provided full-duplex service up to 300 baud. Call originators transmitting at
1070 or 1270 Hz and the answering device transmitting at 2025 or 2225 Hz
used Frequency-shift keying. The readily available 103A2 gave an important
boost to the use of remote low-speed terminals such as the KSR33, the
ASR33, and the IBM 2741. By introducing the originate-only 113D and
answer-only 113B/C modems, AT&T reduced modem costs considerably.
As radio receivers and vacuum tube electronic devices became more
common in 1920s, multimeters were invented. Multimeter became more
complex or may be supplemented by more specialized equipment in
technician’s toolkit as the modern systems became more complex. A
modern technician uses a hand-held analyzer to test several parameters in
order to verify the performance of a network cable, where a general-purpose
mulitmeter can test only short-circuits, conductor resistance and measure of
insulation quality.
DVD (also known as "Digital Versatile Disc" or "Digital Video Disc") – is a
popular optical disc storage media format. Its main uses are video and data
storage. In this unit you will study about the some digital equipments. Here
you will mainly study MODEM, Digital Multi-meter and Digital Versatile Disks
Objectives:
By the end of Unit 9, the learners are able to:
explain the function of MODEM.
explain the working of Digital Multi-meter
list the uses of DVD
9.2 MODEM
MODEM stands for modulator-demodulator. It is a device which modulates
an analog carrier signal for encoding digital information and performs the
function of demodulating such a carrier signal to decipher the digital
Manipal University Jaipur B0948 Page No. 178
Logic Design Unit 9
information encoded in it. The goal is the generation of a signal that can
easily be transmitted and decoded to regenerate the actual digital data.
Modems can be used over any means of transmitting analog signals, from
light emitting diodes to radio. Voice band modem is one example that
converts digital 0s and 1s from a personal computer into sound signals
which could be transmitted over telephone lines of Plain Old Telephone
Systems (POTS) which on the other side receives the sound signal and
converts it back to the corresponding digital information.
Classification of modems is done on the basis of rate of data transmission,
normally measured in bits/second or bps. Classification can also be done
based on the rate at which the modem switches its transmission speed per
second, termed Baud. Baud is measured in symbols/sec. Based on the
modulation technique used, baud rate changes. A state change of
300 times/sec was observed in original Bell 103 modems. If a modem
transmitted 1-bit every baud, it’s a 300bit/sec modem or 300-baud modem.
Only modem whose bit rate matched with the baud rate is 300 bits/sec. A
modem that switches its state 600 times/sec and for each baud if it
transmits 4 bits, it is said to be a 2400 bit/sec modem.
Cable modems and Asymmetric digital subscriber line (ADSL) modems are
some faster modems used by internet users daily. Repeating frames of data
is transmitted at very high rates over microwave radio links in “radio
modems” used in telecommunications. There are modems that transmit
more than hundred million bits/sec. Optical modems use optical fibers to
transmit data. Undersea optical fibers are used in most of the present
intercontinental data links. Optical modems consistently have data rates in
excess of a billion bits/sec. One kilobit/sec in this context refers to
1000bits/sec and not 1024bits/sec. For example, a 48k modem transfers
data at rates up to 48,000 bits (6kB)/sec.
The Smartmodem and the rise of Bulletin Board Systems
Smartmodem introduced by Hayes Communications in 1981 is the next
major breakthrough in modems. It is a standard 103A 300-bits/sec modem,
along with a controller; because of which computer can send commands to
it and enable it use the phone line. Picking up and hanging up calls, dialing
numbers etc. can be done through commands. Most of the modern modems
still use the basic Hayes command set.
which are high speed were rare, because neither spoofing nor sysop
discounts was not offered by Hayes.
4800 and 9600 (V.27ter, V.32)
Another major advancement in the modem design was Echo cancellation. In
order to receive and send the data, same wires are used by the telephone
lines, because of which the amount of bouncing back will be small. But the
modem can get confused by this signal. Is the signal it is "hearing" a data
transmission from the remote modem, or its own transmission bouncing
back? In earlier systems, in order to originate and answer, the signal
frequencies are split into two so that modem can avoid hearing its own
originating frequencies; the speed of the modems has been limited to its half
speed because of splitting of the bandwidth.
Echo cancellation got around this problem. The modems were able to
decide whether the signal is from remote modem or from itself by measuring
the delays and magnitudes of the echo and cancel the signals if it is from
itself. By cancelling the echoes, the speed of the modems was increased
and was able to send and receive the data at full speed which led to the
development of 9600bps and 4800bps modems.
A complicated theory of communication has been used to increase the
speed of modems. PSK technique was used in 2400 bps and 1200bs
modems where 2 or 3 bits per symbol can be transmitted. Then Quadrature
Amplitude Modulation (QAM) is used to get the combination of phase and
amplitude by encoding four bits. A constellation diagram can be used for the
best visualization, this diagram has two coordinates x(real) and
y (quadrature) and the bits which are transmitted over the carrier are
mapped on to the points on the graph. The new V.27ter and V.32 standards
were able to transmit 4 bits per symbol, at a rate of 1200 or 2400 baud,
giving an effective bit rate of 4800 or 9600 bits per second. The carrier
frequency was 1650 Hz.
Error correction and compression
The limitation of the phone lines has been increased because of operations
at high speeds which resulted in high error rates. In order to reduce the
error rates, modems with inbuilt error corrections mechanism has been built
and became famous with Micorcom’s MNP systems. By minimizing
overheads, the effective data rate has been increased from 75% (in MNP1)
to 95% (MNP 4) the data rate in MNP 5 has been further increased by
introducing the data compression mechanism to the systems. Generally the
user could expect an MNP5 modem to transfer at about 130% the normal
data rate of the modem. MNP was later "opened" and became popular on a
series of 2400-bit/s modems, and ultimately led to the development of
V.42 and V.42bis ITU standards. V.42 and V.42bis were non-compatible
with MNP but were similar in concept: Error correction and compression.
In high speed modems, the concept of fallback is the used very commonly.
Because of this concept high speed modem can speak to a modem which is
less capable. At the time of call initiation, modem would wait for the
response from remote modem once after sending a series of signals into the
telephone line. During this process, till the modem hears from remote
modem, it would reduce its speed progressively. Because of above method
at a speed of 9600bps 2 USR modems were able to communicate, but the
2400bps modem would fall back to its normal speed. As the HST and
V.32 modems used different standard at 9600bps, they also fall back to its
normal standard (2400 bps), if the above method is employed. The same
applies to V.32bis and 14400 bit/s HST modem.
Breaking the 9.6k barrier
In 1980 Gottfried Ungerboeck from IBM Zurich Research Laboratory applied
powerful channel coding techniques to search for new ways to increase the
speed of modems. His results were astonishing but only conveyed to a few
colleagues. Finally in 1982, he agreed to publish what is now a landmark
paper in the theory of information coding. By applying powerful parity check
coding to the bits in each symbol, and mapping the encoded bits into a two
dimensional "diamond pattern", Ungerboeck showed that it was possible to
increase the speed by a factor of two with the same error rate. The new
technique was called "mapping by set partitions" (now known as trellis
modulation).
The industry was galvanized into new research and development. More
powerful coding techniques were developed, commercial firms rolled out
new product lines, and the standards organizations rapidly adopted to new
technology. The "tipping point" occurred with the introduction of the
SupraFAXModem 14400 in 1991. Rockwell had introduced a new chipset
supporting not only V.32 and MNP, but the newer 14,400 bit/s V.32bis and
the higher-compression V.42bis as well and even included 9600 bit/s fax
capability. Supra, then known primarily for their hard drive systems, used
this chip set to build a low-priced 14,400 bit/s modem which cost the same
as a 2400 bit/s modem from a year or two earlier (about US$300). The
product was a runaway best-seller, and it was months before the company
could keep up with demand.
V.32bis was so successful that the older high-speed standards had little to
recommend them. USR fought back with a 16,800 bit/s version of HST,
while AT&T introduced a one-off 19,200 bit/s method they referred to as
V.32ter (also known as V.32 terbo), but neither non-standard modem sold
well.
V.34 / 28.8k and 33.6k
An ISA modem manufactured to conform to the V.34 protocol. Any interest
in these systems was destroyed during the lengthy introduction of the
28,800 bit/s V.34 standard. While waiting, several companies decided to
"jump the gun" and introduced modems they referred to as "V.FAST". In
order to guarantee compatibility with V.34 modems once the standard was
ratified (1994), the manufacturers were forced to use more "flexible" parts,
generally a DSP and microcontroller, as opposed to purpose-designed
"modem chips".
Today the ITU standard V.34 represents the culmination of the joint efforts.
The most powerful coding techniques are employed including channel
encoding and shape encoding. From 4 bits per symbol (9.6 kbit/s), the new
standards used the functional equivalent of 6 to 10 bits per symbol, plus
increasing baud rates from 2400 to 3429, to create 14.4, 28.8, and
33.8 kbit/s modems. This rate is near the theoretical Shannon limit.
When calculated, the Shannon capacity of a narrowband line is
Bandwidth * log2(1 + Pu / Pn), with Pu / Pn the signal-to-noise ratio.
Narrowband phone lines have a bandwidth from 300-3100 Hz, so using
Pu / Pn = 100,000: capacity is approximately 35 kbit/s.
Without the discovery and eventual application of trellis modulation,
maximum telephone rates would have been limited to
3429 baud * 4 bits/symbol = approximately 14 kilobits per second using
traditional QAM.
becomes necessary to tell the computer to pause the data stream. This is
accomplished through hardware flow control using extra lines on the
modem–computer connection. The computer is then set to supply the
modem at some higher rate, such as 320 kbit/s, and the modem will tell the
computer when to start or stop sending data.
Compression by the ISP
As telephone-based 56k modems began losing popularity, some Internet
Service Providers (ISPs) such as Netzero and Juno started using
pre-compression to increase the throughput & maintain their customer base.
As an example, the Netscape ISP uses a compression program that
squeezes images, text, and other objects at the server, just prior to sending
them across the phone line. The server-side compression operates much
more efficiently than the "on-the-fly" compression of V.44-enabled modems.
Typically website text is compacted to 4% thus increasing effective
throughput to approximately 1300 kbit/s. The accelerator also
precompresses Flash executables and images to approximately 30% and
12%, respectively.
The drawback of this approach is a loss in quality, where the graphics
become heavily compacted and smeared, but the speed is dramatically
improved such that web pages load in less than 5 seconds, and the user
can manually choose to view the uncompressed images at any time. The
ISPs employing this approach advertise it as "DSL speeds over regular
phone lines" or simply "high speed dial-up".
List of dialup speeds
Note that the values given are maximum values, and actual values may be
slower under certain conditions (for example, noisy phone lines). For a
complete list see the companion article List of device bandwidths.
Connection Bitrate
Modem 110 baud 0.1 kbit/s
Modem 300 (300 baud) (Bell 103 or V.21) 0.3 kbit/s
Modem 1200 (600 baud) (Bell 212A or V.22) 1.2 kbit/s
Modem 2400 (600 baud) (V.22bis) 2.4 kbit/s
Modem 2400 (1200 baud) (V.26bis) 2.4 kbit/s
Modem 4800 (1600 baud) (V.27ter) 4.8 kbit/s
Modem 9600 (2400 baud) (V.32) 9.6 kbit/s
Broadband
ADSL modem
ADSL (asymmetric digital subscriber line) modems, a more recent
development, are not limited to the telephone's "voiceband" audio
frequencies. Some ADSL modems used discrete multi-tone(DMT) also
called coded orthogonal frequency division modulation (COFDM)
A range of frequencies which are intended to carry radio frequency
TV channels can be used by cable modems. The same frequency band can
be used by many cable modems which are connected to a single cable, in
order to allow multiple cable modems to work together within the channel, a
low level media access protocol can be used. By using FDMA, up and down
signal are kept apart.
Power line modems and double way satellite modems are new types of
latest broadband modems.
As the broadband modems uses complex waveform to carry the data, they
are still called as modems. When compared to the normal dial up modems,
these broadband modems are more advanced. Broadband modems can
modulate or demodulate 100s of channels. Many functions of a router and
features like DHCP, firewall features and NAT are included in broadband
modems.
Since consumers were unfamiliar with routers and networking when the
technology of broadband was introduced manufacturers instead of selling
broadband devices as adapter or transceivers, they started selling with the
term modem. Before a broadband modem using a router, they should be
configured in a bridge mode.
Deep-space telecommunications
Many modern modems have their origin in deep space telecommunications
systems from the 1960s. Differences between deep space telecom modems
and landline modems digital modulation include:
digital modulation formats that have high doppler immunity are typically
used
waveform complexity tends to be low-typically binary phase shift keying
error correction varies mission to mission, but is typically much stronger
than most landline modems
Voice modem
The recording or playing audio over the telephone line can be done using a
voice modem and are used in telephony applications. This type of modem
can be used as FXO card for Private branch exchange systems.
Analog multimeters and digital multimeters are the two categories of the
multimeters. Digital multimeters are abbreviated as DMM or DVOM.
A multimeter can be used to find the faults, field work service with high
accuracy and for troubleshooting of both household and industrial devices.
Quantities measured
Many of the following quantities can be measured using multimeters. The
common ones are:
Voltage (both Alternating and Direct) in Volts.
Current( both Alternating and Direct) in amperes
Resistance in ohms
Capacitance in farads.
Conductance in siemens.
Decibels for audio signal levels
Duty cycle as a percentage.
Frequency in hertz.
Inductance in henrys.
Digital multimeters may also include circuits for:
Continuity that beeps when a circuit conducts.
Diodes and Transistors
Various sensors can be attached to multimeters to take measurements such
as:
light level
Acidity/Alkalinity(pH)
Wind speed
Relative humidity
Resolution
The resolution of a multimeter is the smallest part of the scale which can be
shown and is a scale dependent.
Digital
The resolution of a multimeter is often specified in the number of decimal
digits resolved and displayed. For example, the term 5½ digit refers to the
number of digits displayed on the readout of a multimeter.
A number greater than 1 and less than 9 can be displayed using 3 quarters
digit and only zero or one can be displayed by a half digit. Maximum value
of 3 or 5 can be referred to a three quarters digit. The most significant digit
in the display is always the fractional digit. In a 5½ digit multimeter values
from 0 to 9 can be represented using 5 full digits, and only zero or one can
be displayed using half digit. Thus a 5½ digit multimeter can have range
from 0 to 199999 to show the positive or negative values. Depending the
manufacturing company, values from 0 to 3999 or 5999 can be displayed
using a 3¾ digit meter. If the analog portion of the multimeter is not
designed with proper care and calibration, the extra digits which are used to
extend the precision will not have any value. A good traceability of the
calibration, good controllability of the measurement conditions, and goof
limitations on precision and reading accuracy. The figure 9.2 shows the
analog multimeter with galvanometer needle display.
or more, and the upper limit for general purpose, portable and non-amplified
meters is 50,000 ohms/v.
An amplifier is inserted between the meter movement and the measuring
circuit in order to minimize the current drawn for meter movement and avoid
loading on the circuit. But the adding of an amplifier increased the
complexity and cost of the meter and power supply which is required by the
amplifier., Independent of the current required to meter movement, the input
resistance can be made high by using vaccum tubes and Field Effect
Transistors. Such amplified multimeters are called VTVM (vacuum tube
voltmeters) TVM (transistor volt meter), FET-VOM, and similar names.
Probes
In order to connect the circuit to a multimeter, different kinds of probes can
be used. The most 3 commons probes used are pointed probes, crocodile
clips, and retractable hook clips. The connectors are attached to flexible,
thickly-insulated leads that are terminated with connectors appropriate for
the meter. Shrouded or recessed banana jacks are used for handheld
multimeters, but BNC connectors or banana jacks can be used for benchtop
meters. Occasionally binding posts and 2mm plugs are also used.
For accuracy and for safety, non-contact attachment mechanism is used in
meter which measures high currents or high voltages. To determine the
current flowing through the conductor, a coil that clamps around it is
provided by the clamp multimeters.
Safety
In order to prevent the damage to the multimeter when it is overloaded, a
fuse is provided by few multimeters. But fuses usually protect only high
current range on the meter. During the operations, setting the meter to
measure the current or resistance and then connecting to a voltage source
which has low impedance would damage the meter and sometimes it can
explode the device.
Depending upon the intended application of the digital meters DMM are
categorized into 4 types:
Category I: used where current levels are low.
Category II: used on residential branch circuits.
DVD was never defined in the original DVD specification. Now-a-days the
most common usages are “DVD”, “Digital Versatile Disc”, and “Digital Video
Disc”. A DVD can store video’s, audio and other data and access all on one
disc. Variations of the term DVD often describe the way data is stored on
the discs: For example in DVD-ROM, data can only be read and not written,
DVD-R and DVD+R can only record data once and then function as a
DVD-ROM. DVD-RW, DVD+RW and DVD-RAM can both record and erase
data multiple times. The wavelength used by standard DVD lasers is
650 nm, and thus has a red color. The types of DVD are referred by its
storage capacity. The table 9.1 shows the capacity of DVD along with
nomenclature.
Table 9.1: Capacity of DVD and nomenclature
Designation Sides Layers (total) Diameter Capacity
(cm) (GB) (GiB)
DVD-1 SS SL 1 1 8 1.46 1.36
DVD-2 SS DL 1 2 8 2.66 2.47
DVD-3 DS SL 2 2 8 2.92 2.72
DVD-4 DS DL 2 4 8 5.32 4.95
DVD-5 SS SL 1 1 12 4.70 4.37
DVD-9 SS DL 1 2 12 8.54 7.95
DVD-10 DS SL 2 2 12 9.40 8.74
DVD-14DS DL/SL 2 3 12 13.24 12.32
DVD-18DS DL 2 4 12 17.08 15.90
SS = single-sided, DS = double-sided, SL = single-layer, DL = dual-layer
Standard DVD is of 12cm and mini DVD is of 8cm. These are the same
sizes as a standard CD and a mini-CD, respectively. The capacity by
surface (MiB/cm²) differs from 6.92MiB/cm² in the DVD-1 to 18.0 MiB/cm² in
the DVD-18.
Note: The capacity of DVD is represented by symbol GB (gigabyte). In
order to show the distinction, Kilobyte, Megabyte and Gigabyte are the
labels used to represent the files sizes in present day computers.
Among 2418 bytes of data that is contained in a sector of DVD, the user
data will be 2048 bytes. There is a small difference in storage space
between ‘+’ and ‘-’ formats. Capacity differences of writable DVD formats is
shown in table 9.2.
Technology
Internal mechanism of a DVD-ROM Drive.
CD’s uses 780nm wavelength laser diode light, HD-DVD uses 405nm
wavelength laser diode light and DVD uses 650nm wavelength laser diode
light. As DVD uses lesser wavelength laser diode light than CD, on the
media surface it is possible to etch a smaller pit.
The writing speed of the first media and the drive model was 1x (1318
KiBps) and the recent models have the speed of 18x or 20x. The writing
speed of CD is 1x (153.6 KiBps) and it is 9 times slower than DVD.
DVD drive speeds
Drive speed Data rate ~Write time (min)
(Mibit/s) (MB/s) SL DL
1× 10.55 1.35 61 107
2× 21.09 2.70 30 54
2.6× 27.43 3.51 24 42
4× 42.19 5.40 15 27
6× 63.30 8.10 11 18
8× 84.38 10.80 8 14
12× 126.60 16.20 6 11
16× 168.75 21.60 4 7
18× 189.90 24.30 3 5
20× 211.00 27.00 3 4
DVD-Audio
In order to deliver high quality audio content, DVD audio format is used. At
various frequencies (up to 192 kHz), many channel configuration options
are offered. Higher audio quality and more music can be included in the
higher capacity DVD audio when compared with CD.
Despite DVD-Audio's superior technical specifications, there is debate as to
whether the resulting audio enhancements are distinguishable in typical
listening environments. DVD-Audio currently forms a niche market, probably
due to the very sort of format war with rival standard SACD that DVD-Video
avoided.
Security
DVD-Audio discs employ a copy prevention mechanism, called Content
Protection for Prerecorded Media (CPPM) developed by the 4C group (IBM,
Intel, Matsushita, and Toshiba).
To date, CPPM has not been "broken" in the sense that DVD-Video's CSS
has been broken, but ways to circumvent it have been developed. By
modifying commercial DVD(-Audio) playback software to write the decrypted
and decoded audio streams to the hard disk, users can, essentially, extract
content from DVD-Audio discs much in the same way they can from DVD-
Video discs.
Self Assessment Questions
1. ___________was introduced in 1960 to replace the term digital subset.
2. _________________ is a device which modulates an analog carrier
signal for encoding digital information and performs the function of
demodulating such a carrier signal to decipher the digital information
encoded in it.
3. POTS stands for________________________.
4. The WiFi and WiMax standards use wireless mobile broadband
modems operating at __________________frequencies.
5. ADSL stands for ________________________.
6. ________________is a measuring device which combines multiple
functions in one unit.
7. The resolution of a multimeter is often specified in the number of
decimal digits resolved and displayed (True or False).
8. The unit for sensitivity of an analog meter is_______________.
9.5 Summary
Let us recapitulate the important concepts discussed in this unit.
Modem which stands for modulator-demodulator. It is a device which
modulates an analog carrier signal for encoding digital information.
Cable modems and Asymmetric digital subscriber line (ADSL) modems
are some faster modems used by internet users daily.
Softmodem or winmodem is a stripped-down modem that takes up
most of the tasks in to software, which was traditionally performed in
hardware.
In order to send the data using 300bps modems, frequency shift keying
is used.
Modern telecommunications and data networks also make extensive
use of radio modems where long distance data links are required.
Digital cable television and cable Internet services use radio frequency
modems to provide the increasing bandwidth needs of modern
households.
Mobile modems are the modems which use mobile phone lines like
GPRS, UMTS, EVDO, etc.
Digital multi meter (DMM) or multitester is a measuring device which
combines multiple functions in one unit. It is also known as VOM (Volt-
Ohm meter).
The resolution of a multimeter is the smallest part of the scale which
can be shown and is a scale dependent.
When compared to DMM the analog multimeters are less susceptible to
radio frequency interference.
A DVD can store video’s, audio and other data and access all on one
disc.
The recordable DVD’s are used for the purpose of video and audio
recording.
DVD-RAM, DVD-R/RW (minus), and DVD+R/RW (plus) are the three
formats for recording purpose.
9.7 Answers
Self Assessment Questions
1. Data-phone
2. MODEM
3. Plain Old Telephone Systems
4. Microwave
5. Asymmetric digital subscriber line
6. Digital multi meter (DMM)
7. True
8. Ohms/v
9. False
10. DVD
11. IDVD-Video
12. Content Protection for Prerecorded Media
Terminal Questions
1. Refer to section 9.2
2. Refer to section 9.2
3. Refer to section 9.3
4. Refer to section 9.4
Structure:
10.1 Introduction
Objectives
10.2 Working Principle & Circuits of Analog to Digital Converters
10.3 Digital to Analog Converters
10.4 Summary
10.5 Terminal Questions
10.6 Answers
10.1 Introduction
In the previous unit, we studied about the MODEM, digital multimeter and
digital versatile disks. An electronic circuit that transforms a continuous
analog signal into digital samples is termed an analog-to-digital converter
(ADC). The other-way conversion is done by the circuit named digital-to-
analog converter (DAC). An ADC takes in analog continuous signal and
converts it into corresponding digital signal. DAC’s convert digital sampled
values to a continuous physical entity, mostly an analogue voltage. In this
unit we will study about the working principles of analog-to-digital converter
and digital-to-analog converter.
Objectives:
By the end of Unit 10, the learners are able to:
explain the working principle of ADCs.
explain the working of DACs
define monotonicity and resolution of DAC
Resolution
The resolution of the converter is the number of discrete values it can
produce over the range of analog values. In other words, the count of
samples that the circuit can generate over a range of analog values is
indicated by the measure called resolution. The sampled values are usually
shown in bits as it is stored in binary format electronically. The count of the
samples available is normally a power of two. For example, an 8-bit
resolution ADC can sample an input signal into 28 = 256 distinct levels. The
values can represent the ranges from 0 to 255.
Resolution is often specified electrically and represented in volts. In this
term, resolution can be defined as voltage range divided by the count of
distinct intervals as mentioned in the formula below:
E FSR E FSR
Q
M N
2
Where,
Q stands for resolution (volts per output code or step)
EFSR is the reference voltage range, which is equal to VRefHi – VrefLo and M is
the resolution of the circuit in bits.
Count of the distinct intervals is depended number of levels available, which
is N = 2M.
Examples below illustrates better:
Example 1:
Reference voltage measurement range = 0 to 5 volts
Resolution of the ADC: 10 bits (Quantization levels: 210 = 1024)
Voltage resolution of the ADC is: (5v - 0v)/1024 levels = 5/1024 = 0.00488
volts /code or 4.88mV/code.
Example 2:
Reference voltage measurement range = -5 to 5 volts
Resolution of the ADC: 12 bits (Quantization levels: 212 = 4096)
Voltage resolution of the ADC is: (5v – (-5v))/4096 levels = 10/4096 =
0.00244 volts /code or 2.44mV/code
Manipal University Jaipur B0948 Page No. 206
Logic Design Unit 10
Example 3:
Reference voltage measurement range = 0 to 8 volts
Resolution of the ADC: 3 bits (Quantization levels: 23= 8)
Voltage resolution of the ADC is: (8v – 0v))/8 levels = 8/8 = 1 volts /code or
1000mV/code.
In practice, the smallest output code ("0" in an unsigned system) represents
a voltage range which is 0.5X (half-wide) of the ADC voltage resolution (Q)
and the largest output code represents a voltage range which is 1.5X (50%
wider) of the ADC voltage resolution. The other N-2 codes are all equal in
width and represent the ADC voltage resolution (Q) calculated above. Doing
this centers the code on an input voltage that represents the Mth division of
the input voltage range. For example, with the 3-bit ADC for an 8V range,
each of the N divisions represent 1V, except the 1st ("0" code) which is 0.5V
wide, and the last ("7" code) which is 1.5V wide. Doing this the "1" code
spans a voltage range from 0.5 to 1.5V, the "2" code spans a voltage range
from 1.5 to 2.5V, etc. Thus, if the input signal is at 3/8ths of the full-scale
voltage, then the ADC outputs the "3" code, and will do so as long as the
voltage stays within the range of 2.5/8ths and 3.5/8ths. This is called "Mid-
Tread" operation. This type of ADC can be modeled mathematically as:
Response type:
Linear Analog-to-Digital converters
Even though analog-to-digital conversion process is a non-linear process,
majority of the conversion circuits are known as of the type linear. The
reason why the processor is non-linear is because sampling and mapping of
continuous space into discrete digital space is a piecewise operation. Linear
as used here to refer the type of the ADC, stands for the linear relationship
between the output values to the corresponding input value. In other words,
an output value p is supposed to be from a range of input values:
n(p+b) to n(p+1+b),
where, n and b are constants. Here b is typically 0 or −0.5. When b = 0, the
ADC is referred to as mid-rise, and when b = −0.5 it is referred to as mid-
tread
Non-linear Analog-to-Digital Converters
Signal-to-noise ratio with respect to quantization noise takes the best value
in case the probability density function (PDF) of a signal is uniform. Hence,
normally, the signal is made to pass through the cumulative distribution
function (CDF) of it before quantization. As a result, regions which are more
relevant get better resolution quantization. An inverse CDF will be required
in the dequantisation process. This concept is the same that is employed in
companders used in communication systems and tape recorders and is
related to maximization of entropy.
For example, a voice signal having Laplacian distribution denotes that the
region around 0 carries more information than the regions with higher
amplitudes. Because of the same reason, voice communication systems
widely uses logarithmic ADCs to boost the dynamic range of value that can
be represented by keeping the fine-fidelity in the regions with low amplitude.
An 8 bit a-law or the μ-law logarithmic ADC covers the wide dynamic range
and has a high resolution in the critical low-amplitude region that would
otherwise require a 12-bit linear ADC.
Accuracy
ADC’s are vulnerable to various kinds of errors. Quantization error and non-
linearity comes with very nature of any ADC. Clock jitter causing errors
called aperture error comes in light when digitizing a signal. The unit called
least significant bit (LSB) used to measure these errors. In a 10-bit ADC,
one LSB error is 1/1024 of the full reference signal range, which is about
0.097%.
Quantization error
Quantization error is due to the finite resolution of the ADC, and is an
unavoidable imperfection in all types of ADC. Quantization error ranges
from 0 to half of one LSB. Generally, actual signal is larger than one LSB.
During this, quantization error is not correlated and has a consistent
distribution. Standard deviation of the distribution gives the RMS value as
mentioned below:
For the 10-bit ADC discussed above, this represents 0.0282% of the signal.
Quantization error becomes more dependent on the input signal in lower
levels causing disturbances. This distortion is created after the anti-aliasing
filter, and if these distortions are above 1/2 the sample rate they will alias
back into the audio band. A noise with an amplitude 1 quantization step is
included to the signal in order to make the quantization error independent of
the input signal. This reduces signal-to-noise ratio slightly and eliminates the
distortion completely. It is also known as Dither.
Non-linearity
Physical implementation imperfections cause all the ADCs to suffer from
non-linearity errors resulting in deviation of the output from the linear
relationship (or whatever relationship in case of non-linear type) with the
corresponding input. Alleviation and prevention of these errors can be done
by calibration and testing. Integral non-linearity (INL) and differential non-
linearity (DNL) are important arguments for linearity.
Imagine that we are digitizing a sine wave x(t) = Asin2πf0t. Provided that the
actual sampling time uncertainty due to the clock jitter is Δt, the error
caused by this phenomenon can be estimated as
One can see that the error is relatively small at low frequencies, but can
become significant at high frequencies. This effect can be ignored if it is
aliases are produced at the output analog signal of a DAC. In this case,
frequency of the output analog signal (aliased signal) will be difference
between the input signal frequency and the sampling frequency. For
example, a 5kHz sine wave sampled at 4kHz may be reconstructed as 1kHz
sine wave. This is what is known as aliasing.
Aliasing is better resolved by making the input signal low pass filtered
before passing it into the ADC so that the high frequency components
above half of the sampling rate are filtered out. Because of this functionality,
the filter is called anti-aliasing filter. This is an essential component for a real
time ADC especially the ones that work on high frequency signals.
Aliasing, an undesired phenomenon in most of the systems may be used to
provide down-mixing of a band limited high frequency signal.
Oversampling
As the quantization introduces white noise which is spread all over the pass
band of the converter, signals are sampled at the minimum required rate. If
the input signal is sampled at frequency higher than the Nyquist frequency
and then filtered to limit it to the bandwidth of the signal, three main
advantages results:
Digital filters can have better properties like sharper roll off, phase etc.
than analogue filters, so a sharper anti-aliasing filter can be implemented
and the signal can be down sampled to give a better result
A 20-bit ADC can be made to act as a 24bit ADC with 256x oversampling
The signal-to-noise ratio due to quantization noise will be higher than if
the whole available band had been used. So effective resolution larger
than what is provided by ADC can be achieved with this technique.
Dither
You can increase the ADCs, performance by using dither. This is a very
small amount of random noise (white noise), which is added to the input
before conversion. Amplitude of the noise is set to be about half of the LSB.
This mainly cause oscillating the state of LSB to switch between 0 and 1 in
case of very low levels of input, rather than sticking at one constant value. It
improves the effective range of signals that the ADC can convert rather than
signal getting cut off at the low level with the trade-off of slight increase in
noise – essentially, quantization error is included in across a series of noise
values which far more bearable than a cutoff. More accurate representation
of the signal over time is possible with this. A filter at the output tuned
properly can recover the small variations caused.
Without dither, a sampled audio signal of low level becomes unpleasant and
disturbed. Low level always yields a ’1’ from the analog to digital if done
without dithering. With dithering, the true level of the audio may be
calculated by averaging the actual quantized sample with a series of other
samples that are recorded over time. A process similar to dithering is often
employed in photographic image quantization to a lesser number of bits per
pixel. Even though the image becomes noisier, eye fails in recognizing
those and hence sees the original realistic picture which is otherwise
banded. Similar effect is what is happening in case of analogue audio that is
converted to digital.
Integrating systems like electricity meters also makes use of dithering. Since
the values are added together, the dithering produces more reliable results
than the LSB of ADC.
Dither improves only the resolution of the sampler, it doesn’t affect linearity
and hence accuracy doesn’t seem to improve.
ADC structures
Most common ADC implementation ways are the following:
Flash ADCs or Direct conversion ADCs has a bank of comparators each
firing for their decoded voltage range. A logic circuit follows this
comparator bank which generates a code for each voltage range created.
These converters are faster, but normally have only 8-bits resolution (i.e.
255 comparators as 2n-1 is the number of comparators required) or lesser
since it needs a big and expensive circuit. This type demands a large die
size, high input capacitance and are prone to have glitches in the output
(as outputting is out of sequence). As device mismatch is a dominant
design limitation, scaling to newer submicron technologies doesn’t do any
better. Direct conversion ADCs are mainly employed in applications like
video, wideband communications and other fast signals.
Successive approximation ADCs makes use of comparators to eliminate
the ranges of voltages, gradually settling on a final voltage range.
Successive approximation continuously compares the input voltage to the
analog output voltage of the inbuilt DAC (working on the current value of
approximation) until the right approximation is obtained. In every single
step in the process, approximation is stored in a successive
approximation register (SAR) in binary format. A reference voltage is
used by the SAR for the comparison. For example, if the input voltage is
6V and the reference voltage is 10v, during the first cycle the comparison
of the input voltage is done with the value 5V, (i.e. the half the value of
the reference voltage: This is the voltage at the output of the inbuilt DAC
when the input is a ‘1’ followed by zeros) and the voltage output from the
comparator is positive as 6V is greater than 5V. The first binary digit is set
to ‘1’ at this point. In the next clock cycle, the input voltage is compared
with 7.5V (which is half value between 5V and 10V: This is the output of
the inbuilt DAC when its input is ‘11’ followed by zeros) and as 6V is
lesser than 7.5V, the comparator output becomes negative. Second
binary digit is therefore set to ‘0’. In the next clock cycle, input voltage is
compared with 6.25V (half value between 5V and 7.5V: This is the output
voltage of the inbuilt DAC when its input is ‘101’ followed by zeros). Now
the output of the comparator becomes negative as 6V is less than 6.25V
and the third bit is set to ‘0’.So on, next clock cycle comparison happens
with 5.625, and the fourth bit goes to ‘1’ as 6V is greater than 5.625.
Hence the result in the binary form would be 1001. This process is also
termed as bit-weighting conversion. This is kind of rounding an analog
signal into a binary form. As the approximations are not successive, each
bit resolution will require one clock cycle. Hence clock frequency will have
to be same as the value obtained by multiplying the number of bits of
resolution and sampling frequency. For example, to sample audio at 44.1
kHz with 32 bit resolution, a clock frequency of over 1.4 MHz would be
required. This type of ADC has better resolution and wide ranges. But it is
more complex than other implementations.
Ramp-compare ADC which is also known as dual-slope or integrating or
multi-slope ADC produces a saw-tooth signal. A counter starts counting
as the ramp starts. When the ramping voltage matches with the input
voltage, comparator flags and the timer value is recorded. Timed ramp
converters demands least number of transistors. The ramp time is
sensitive to temperature because the circuit generating the ramp is often
just some simple oscillator. There are two solutions for this: using a
clocked counter for DAC and then a comparator to store the counter
value or improving the timed ramp. For the comparison of a second
signal, just another comparator is what is required and another register
to store the voltage value. This is one major advantage of the ramp-
compare system. Implementation of ramp-converter can be as simple as
a combination of a microcontroller, a resistor and a capacitor. A filled
capacitor can be taken from an integrator, time-amplitude converter,
sample and hold circuit or peak and hold circuit and discharged. As slow
comparator cannot be disturbed by fast input changed, this is the major
advantage of this system.
Delta encoded ADC employs an up-down counter that feeds a DAC.
Both the input signal and the DAC go to the comparator and then it is
this comparator that controls the counter. This converter has a wide
ranges and high resolution. Conversion time often depends on the input
signal and hence it will have a guaranteed worst-case. This type of
converter is a good option to deal with real-world signals. Signals in
physical systems don’t change abruptly. Delta and successive
approximation properties are combined in some kind of converters and
can very well be employed when high frequencies are known to be small
in magnitude.
Pipeline ADC make use of subranging in two or more steps. Primarily a
rough conversion is performed. Then the difference from the input signal
is determined using a DAC. The difference obtained is used for finer
conversion and the results are combined at the end. This is a kind of
refined successive approximation ADC where, interim conversion of a
whole range of bits is contained in the feedback reference signal, rather
than next MSB. Due to the combined merit of both the converters, this
converter is faster, has got higher resolution and only requires a little die
size.
Sigma delta ADC which is also termed as Delta-Sigma ADC samples
the input signal by a large factor and filters out only the required signal
band. A flash ADC is placed after the filter which is used to convert
smaller number of bits than that is actually required. The output signal
which contains the error generated by the Flash is fed back and
subtracted from the input. Due to the negative feedback, noise shaping
of the error due to Flash happens and hence it doesn’t appear in the
Manipal University Jaipur B0948 Page No. 214
Logic Design Unit 10
The fact that DACs output a sequence of piecewise constant values (known
as zero-order hold) or rectangular pulses causes multiple harmonics above
the Nyquist frequency. So a low pass filter placed at the output removes this
and hence it acts as a reconstruction filter. This filter indicates that there is
an inbuilt effect of the zero-order hold over the overall frequency response
of the DAC causing mild roll-off of gain at the higher frequencies and
depending on the phase distortion and filter. High frequency roll-off is not
the property of the sampled data but the output characteristic of DAC.
Applications
Audio
Presently audio signals are stored in digital form and it has to be converted
to analog signal in order to hear it through speakers. Hence DAC’s are
employed in digital music player, PC sound cards and CD players.
The figure 10.2 shows the Top-loading CD player and external digital-to-
analog converter.
output that can then be fed to the pre-amplifier to drive speakers. Such kind
of DACs can be found in USB speakers and in sound cards.
Video
Before a video signal that is stored in a digital storage such as computer is
to be displayed, it has to be converted back to analog form. Until the year
2007, analog inputs were more widely used than digital, but as flat panel
displays with DVI and HDMI port came up digital inputs started dominating.
Device called RAMDAC combines DAC with a memory (RAM) which stores
the conversion tables for contrast, brightness and gamma corrections.
Digitally controlled potentiometer which is used to digitally control an analog
signal is one device that is similar to DAC
DAC types
The most common types of electronic DACs are:
Pulse Width Modulator is the simplest type of DAC. A stable current or
voltage is switched into a low-pass analog filter and duration is
determined by the digital input code. This is a commonly used technique
in speed control of electric motor and is now commonly used in high
fidelity audio applications.
Oversampling DACs or Interpolating DACs such as the Delta-Sigma
DAC, use a technique termed pulse density conversion. Use of lower
resolution DAC is allowed because of the usage of the oversampling
technique. As the oversampled result is inherently linear, a simple 1-bit
DAC is often selected. In a technique named delta-sigma modulation,
DAC is driven with a pulse density modulated signal which is created
with step non-linearity, negative feedback loop and a low pass filter. In
effect, quantization noise gets high pass filtered and thus driving the
noise out of the low frequencies in to the high frequency which is of little
interest. This technique is called noise shaping. An analog low-pass
filter at the output removes the quantization noise at the high
frequencies. Due to high linearity and low cost, most of the very high
resolution DACs is of this type. Increased oversampling rate can reduce
the specification overhead on the low pass filter and support further
reduction of the quantization noise. Delta sigma DACs make resolution
of 24-bits and speed greater than 100 thousand samples per second is
achievable.
10.4 Summary
Let us recapitulate the important concepts discussed in this unit:
An analog-to-digital converter is a device that converts a continuous
physical quantity (usually voltage) to a digital number that represents the
quantity's amplitude.
The resolution of an ADC is the number of discrete values it can
produce over the range of analog values.
Even though analog-to-digital conversion process is a non-linear
process, majority of the conversion circuits are known as of the type
linear.
Due to finite amount of delay that an ADC takes in converting a signal,
the input is expected to remain constant over the time of conversion
Aliasing, an undesired phenomenon in most of the systems may be
used to provide down-mixing of a band limited high frequency signal.
Dither is a very small amount of random noise (white noise), which is
added to the input before conversion.
Ramp-compare ADC which is also known as dual-slope or integrating or
multi-slope ADC produces a saw-tooth signal.
A digital-to-analog convert converts digital data (usually binary) into an
analog signal (current, voltage, or electric charge).
Oversampling DACs or Interpolating DACs such as the Delta-Sigma
DAC, use a technique termed pulse density conversion.
R-2R Ladder ADC is a binary weighted DAC in which resisters of values
R and 2R are repeatedly cascaded.
Resolution of a DAC is number of possible output levels the DAC is
designed to reproduce.
Monotonicity is the ability of the analog output of DAC to increase with
increase in digital code or vice versa.
10.6 Answers
Self Assessment Questions
1. Nonlinearity
2. Clock jitter
3. Up-down
4. Pulse density conversion
5. Binary weighted DAC
6. ENOB
7. False
8. Spurious Free Dynamic Range
Terminal Question
1. Refer to section 10.2
2. Refer to section 10.3
3. Refer to section 10.3
References:
Mano M. Morris. “Digital Logic and Computer Design”. PHI Private
Limited.
Unger H Stephen. “The Essence of Logic Circuits” Second Edition, S.
Chand & Company.
Roth Jr H. Charles. “Fundamentals of Logic Design. Fifth Edition,
Thomson India Edition,.
Malvino and Leach. “Digital Principles and Applications”. Fifth Edition,
Tata McGraw-Hill.
____________________