B.SC Electronics - Digital Principles and Applications (.PDF) - Course Syllabus & Material - All Units (Bharathiar University)
B.SC Electronics - Digital Principles and Applications (.PDF) - Course Syllabus & Material - All Units (Bharathiar University)
B.SC Electronics - Digital Principles and Applications (.PDF) - Course Syllabus & Material - All Units (Bharathiar University)
DEPARTMENT OF ELECTRONICS
Prepared By
Dr. S. KUMAR M.Sc., M.Phil., PGDCA., Ph.D.,
Assistant Professor of Electronics,
Sri Vasavi College (SF Wing),
Erode - 638 316.
SYLLABUS
DIGITAL PRINCIPLES AND APPLICATIONS
DIGITAL PRINCIPLES AND
Course code L T P C
APPLICATIONS
Core/Elective/Supportive Core Paper IV 4 0 0 4
Syllabus
Pre-requisite Basic Physics 2021-22
Version
Course Objectives:
The main objectives of this course are to:
To acquire the basic knowledge of Number system, Digital logic circuits and its application
To outline the formal procedures for the analysis and design of combinational and
sequential circuits
To learn the concepts of A/D, D/A conversions and their types
Boolean logic operations – Boolean functions – Truth Tables – Basic Laws – DeMorgans
Theorem – Sum of Products and Products of Sums – Karnaugh map – Logic Gates – OR, AND,
NOT, NAND, NOR, EX-OR and EX-NOR Gates – Code Conversion – VHDL Coding for Logic
Gates
Reference Books
1 Floyd and Jain, Digital Fundamentals, Prentice Hall 2010
2 M. Morris Mano Charles Kime, Digital Logic and Computer Design Fundamentals, Pearson
Education Limited, 2014
Course Designed By: R.Archana, Assistant professor, Nehru Arts and Science College,
Coimbatore & Dr.N Om Muruga, Assistant Professor, Government Arts College, Ooty.
UNIT - I
NUMBER SYSTEM AND CODES
NUMBER SYSTEM:
The number system or the numeral system is the system of naming or representing numbers.
We know that a number is a mathematical value that helps to count or measure objects and it
helps in performing various mathematical calculations. There are different types of number
systems in Maths like Decimal number system, Binary number system, Octal number system,
and Hexadecimal number system.
There are various types of number systems in mathematics. The four most common number
system types are:
Binary number system (Base - 2)
Octal number system (Base - 8)
Decimal number system (Base - 10)
Hexadecimal number system (Base - 16)
The table below summaries the characteristics of the above mentioned number representation
systems.
Binary:
A binary number is defined as a number that is expressed in the binary system or base 2
numeral system. It describes numeric values by two separate symbols; 1 (one) and 0 (zero).
The base-2 system is the positional notation with 2 as a radix.
A single binary digit is called a “Bit”. A binary number consists of several bits. Examples are:
101 is a three-bit binary number
10101 is a five-bit binary number
100001 is a six-bit binary number
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 1
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Step 1: Divide the obtained decimal number by 2 and write down the remainder.
Step 2: Now, divide the quotient that is obtained in the above steps by 2, and note the
remainder again.
Step 3: Repeat the above two steps until you get 0 as the quotient.
Step 4: Now, list down the remainder in such a way that the last remainder is written
first, followed by the rest in the reverse order.
This process can also be understood in another way which states that the Least Significant Bit
(LSB) of the binary number will be placed at the top and the Most Significant Bit (MSB) will
be placed at the bottom. This number obtained will be the binary value of the given decimal
number.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 2
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Example:
118 (divide by 2) = 59 plus remainder 0 (LSB)
59 (divide by 2) = 29 plus remainder 1 (↑)
29 (divide by 2) = 14 plus remainder 1 (↑)
14 (divide by 2) = 7 plus remainder 0 (↑)
7 (divide by 2) = 3 plus remainder 1 (↑)
3 (divide by 2) = 1 plus remainder 1 (↑)
1 (divide by 2) = 0 plus remainder 1 (MSB)
Then the binary equivalent of 11810 is therefore: 11101102 ← (LSB)
Example 1:
Find the binary fraction equivalent of the decimal fraction: 0.812510
0.8125 (multiply by 2) = 1.625 = 0.625 carry 1 (MSB)
0.625 (multiply by 2) = 1.25 = 0.25 carry 1 (↓)
0.25 (multiply by 2) = 0.50 = 0.5 carry 0 (↓)
0.5 (multiply by 2) = 1.00 = 0.0 carry 1 (LSB)
Thus the binary equivalent of 0.812510 is therefore: 0.11012 ← (LSB)
Example 2:
Find the binary fraction equivalent of the following decimal number: 54.6875
First we convert the integer 54 to a binary number in the normal way using successive division
from above.
54 (divide by 2) = 27 remainder 0 (LSB)
27 (divide by 2) = 13 remainder 1 (↑)
13 (divide by 2) = 6 remainder 1 (↑)
6 (divide by 2) = 3 remainder 0 (↑)
3 (divide by 2) = 1 remainder 1 (↑)
1 (divide by 2) = 0 remainder 1 (MSB)
Thus the binary equivalent of 5410 is therefore: 1101102
Next we convert the decimal fraction 0.6875 to a binary fraction using successive
multiplication.
0.6875 (multiply by 2) = 1.375 = 0.375 carry 1 (MSB)
0.375 (multiply by 2) = 0.75 = 0.75 carry 0 (↓)
0.75 (multiply by 2) = 1.50 = 0.5 carry 1 (↓)
0.5 (multiply by 2) = 1.00 = 0.0 carry 1 (LSB)
Thus the binary equivalent of 0.687510 is therefore: 0.10112 ← (LSB)
Hence the binary equivalent of the decimal number: 54.687510 is 110110.10112
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 3
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
When converting from Hexadecimal to binary number pick a single hexadecimal digit and
convert it to equivalent binary number. One thing you have to keep in mind that binary number
should be represent in 4 bit format. For example
Example 1:
03: 3333.E38)16 = ? )2
Hexadecimal number 3 3 3 3 . E 3 8
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 4
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Octal:
Octal Number System has a base of eight and uses the numbers from 0 to 7. The octal
numbers, in the number system, are usually represented by binary numbers when they are
grouped in pairs of three. For example, an octal number 128 is expressed as 0010102 in the
binary system, where 1 is equivalent to 001 and 2 is equivalent to 010.
Follow the steps given below to learn the decimal to octal conversion:
Write the given decimal number
If the given decimal number is less than 8 the octal number is the same.
If the decimal number is greater than 7 then divide the number by 8.
Note the remainder, we get after division
Repeat step 3 and 4 with the quotient till it is less than 8
Now, write the remainders in reverse order (bottom to top)
The resultant is the equivalent octal number to the given decimal number.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 5
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 6
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Decimal:
Decimal is a term that describes the base-10 number system, probably the most commonly
used number system. The decimal number system consists of ten single-digit numbers: 0, 1, 2,
3, 4, 5, 6, 7, 8 and 9. The number after 9 is 10. The number after 19 is 20 and so forth.
Additional powers of 10 require the addition of another positional digit.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 7
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 8
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 9
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Hexa Decimal:
Hexadecimal Number System is one the type of Number Representation techniques, in which
there value of base is 16. That means there are only 16 symbols or possible digit values, there
are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. Where A, B, C, D, E and F are single bit
representations of decimal value 10, 11, 12, 13, 14 and 15 respectively. It requires only 4 bits
to represent value of any digit.
Hex to Binary
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 10
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 11
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Conversion:
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 12
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 13
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Binary numbers can also be expressed in exponential form. The representation of binary
integers in exponential form is known as floating point representation. The floating point
representation divides the number into two parts: the left side is a signed, fixed-point integer
known as a mantissa, and the right side is the exponent.
Sign bit -The fixed-point numbers in binary uses a sign bit. A positive number has a sign bit 0,
while a negative number has a sign bit 1.
Integral Part – The integral part is of different lengths at different places. It depends on the
register's size, like in an 8-bit register, integral part is 4 bits.
Fractional part – Fractional part is also of different lengths at different places. It depends on
the register's size, like in an 8-bit register, integral part is of 3 bits.
8 bits = 1Sign bit + 4 bits(integral) + 3bits (fractional part)
16 bits = 1Sign bit + 9 bits(integral) +6 bits (fractional part)
32 bits = 1Sign bit + 15 bits(integral) + 9 bits (fractional part)
Example:
Step 1:- Convert the number into binary form.
4.5 = 100.1
Step 2:- Represent binary number in Fixed point notation
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 14
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Binary Addition:
Binary addition is the sum of two or more binary numbers. Binary addition is much similar to
decimal addition, even a bit easier. In the decimal addition, if the sum of two numbers results
in two digits, we carry the digit in the ten‟s place to the next column to the left. Similarly in
binary addition, if the sum of two numbers is greater than 1, we carry the 2‟s digit over to the
next column to the left For example, 1+ 1 = 10₂. In this case, we write 1‟s digit (0) and carry
the 2‟s digit i.e. 1 of the result to the next column to the left. For this reason, the bit that is
carried to the next column is known as the carry bit.
Example (Addition):
Binary Subtraction:
Binary subtraction is the process of subtracting binary numbers. Binary numbers include only
0 and 1. The process of binary subtraction is the same as the arithmetic operation of
subtraction that we do with numbers. Since only 0 and 1 are involved here, we may sometimes
need to subtract 0 from 1. In such cases, we use the concept of borrowing as we do in an
arithmetic subtraction.
0–0 0
1–0 1
–1 0
Example (Subtraction):
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 15
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Binary Multiplication:
Binary multiplication is similar to decimal multiplication. It is simpler than decimal
multiplication because only 0s and 1s are involved. There are four rules of binary
multiplication.
Example (Multiplication):
Binary Division:
Binary division is similar to decimal division. It is called as the long division procedure.
Example (Devision):
Examples:
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 16
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Examples:
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 17
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
… … …
… … …
Weighted Codes
Non-Weighted Codes
Alphanumeric Codes
Error Detecting Codes
Error Correcting Codes In an isolated
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 18
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Weighted Codes:
Weighted binary codes are those binary codes which obey the positional weight principle.
Each position of the number represents a specific weight. Several systems of the codes are
used to express the decimal digits 0 through 9. In these codes each decimal digit is represented
by a group of four bits.
Non-Weighted Codes:
In this type of binary codes, the positional weights are not assigned. The examples of non-
weighted codes are Excess-3 code and Gray code.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 19
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Grey Code:
It is the non-weighted code and it is not arithmetic codes. That means there are no specific
weights assigned to the bit position. It has a very special feature that, only one bit will change
each time the decimal number is incremented as shown in fig. As only one bit changes at a
time, the gray code is called as a unit distance code. The gray code is a cyclic code. Gray code
cannot be used for arithmetic operation.
Gray code to binary conversion is again a very simple and easy process. Following steps can
make your idea clear on this type of conversions.
The MSB of the binary number will be equal to the MSB of the given gray code.
Now if the second gray bit is 0, then the second binary bit will be the same as the
previous or the first bit. If the gray bit is 1 the second binary bit will alter. If it was 1 it
will be 0 and if it was 0 it will be 1.
This step is continued for all the bits to do Gray code to binary conversion.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 20
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
The codes which are used for both error detecting and error correction are called as “Error
Correction Codes”. The error correction techniques are of two types. They are,
Single bit error correction
Burst error correction
The process or method of correcting single bit errors is called “single bit error correction”. The
method of detecting and correcting burst errors in the data sequence is called “Burst error
correction”.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 21
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Hamming Codes:
This error detecting and correcting code technique is developed by R.W.Hamming . This code
not only identifies the error bit, in the whole data sequence and it also corrects it. This code
uses a number of parity bits located at certain positions in the codeword. The number of parity
bits depends upon the number of information bits. The hamming code uses the relation
between redundancy bits and the data bits and this code can be applied to any number of data
bits.
These codes can represent all types of data including alphabets, numbers, punctuation marks
and mathematical symbols in the acceptable form by computers. These codes are implemented
in I/O devices like key boards, monitors, printers etc. In earlier days, punch cards are used to
represent the alphanumeric codes. They are
MORSE code
BAUDOT code
HOLLERITH code
ASCII code
EBCDI code
UNICODE
ASCII Codes:
ASCII means American Standard Code for Information Interchange. It is the world‟s most
popular and widely used alphanumeric code. This code was developed and first published in
1967. ASCII code is a 7 bit code that means this code uses 27 = 128 characters. This includes
26 lower case letters (a – z), 26 upper case letters (A – Z), 33 special characters and symbols
(like ! @ # $ etc), 33 control characters (* – + / and % etc) and 10 digits (0 – 9). In this 7 bit
code we have two parts, the leftmost 3 bits and right side 4 bits. The left most 3 bits are known
“ZONE bits” and the right side 4 bits are known as “NUMERIC bits”.
EBCDIC Codes:
EBCDI stands for Extended Binary Coded Decimal Interchange code. This code is developed
by IBM Inc Company. It is an 8 bit code, so we can represent 28 = 256 characters by using
EBCDI code. This include all the letters and symbols like 26 lower case letters (a – z), 26
upper case letters (A – Z), 33 special characters and symbols (like ! @ # $ etc), 33 control
characters (* – + / and % etc) and 10 digits (0 – 9). In the EBCDI code, the 8 bit code the
numbers are represented by 8421 BCD code preceded by 1111.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 22
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Hollerith Code:
This code is developed by a company founded by Herman Hollerith in 1896. The 12 bit code
used to punch cards according to the transmitting information is called “Hollerith code”.
Parity Advantages:
Blocks of data from the source are subjected to a check bit or parity bit generator form, where
a parity of :
This scheme makes the total number of 1‟s even, that is why it is called even parity checking.
The two types of parity checking are
Even Parity − Here the total number of bits in the message is made even.
Odd Parity − Here the total number of bits in the message is made odd.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 23
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
UNIT - II
BOOLEAN ALGEBRA AND LOGIC GATES
Boolean algebra is the category of algebra in which the variable‟s values are the truth values,
true and false, ordinarily denoted 1 and 0 respectively. It is used to analyze and simplify
digital circuits or digital gates. It is also called Binary Algebra or logical Algebra. It has been
fundamental in the development of digital electronics and is provided for in all modern
programming languages. It is also used in set theory and statistics.
The important operations performed in Boolean algebra are conjunction (∧), disjunction (∨)
and negation (¬). Hence, this algebra is far way different from elementary algebra where the
values of variables are numerical and arithmetic operations like addition, subtraction is been
performed on them. The basic operations of Boolean algebra are as follows:
Boolean functions:
A Boolean Function is described by an algebraic expression called Boolean expression which
consists of binary variables, the constants 0 and 1, and the logic operation symbols. The
rudimentary symmetric Boolean functions (logical connectives or logic gates) are:
NOT, negation or complement - which receives one input and returns true when that
input is false ("not")
AND or conjunction - true when all inputs are true ("both")
OR or disjunction - true when any input is true ("either")
XOR or exclusive disjunction - true when one of its inputs is true and the other is false
("not equal")
NAND or Sheffer stroke - true when it is not the case that all inputs are true ("not both")
NOR or logical nor - true when none of the inputs are true ("neither")
XNOR or logical equality - true when both inputs are the same ("equal")
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 24
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Truth Tables:
A truth table is a breakdown of a logic function by listing all possible values the function can
attain. Such a table typically contains several rows and columns, with the top row representing
the logical variables and combinations, in increasing complexity leading up to the final
function.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 25
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Basic Laws:
Commutative Law
Any binary operation which satisfies the following expression is referred to as commutative
operation. Commutative law states that changing the sequence of the variables does not have
any effect on the output of a logic circuit.
Associative Law
This law states that the order in which the logic operations are performed is irrelevant as their
effect is the same.
Distributive Law
Distributive law states the following condition.
AND Law
These laws use the AND operation. Therefore they are called as AND laws.
OR Law
These laws use the OR operation. Therefore they are called as OR laws.
INVERSION Law
This law uses the NOT operation. The inversion law states that double inversion of a variable
results in the original variable itself.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 26
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
DeMorgans Theorem:
In an isolated
DEMORGAN’S FIRST THEOREM
According to DeMorgan‟s First Theorem, the resultant of two (or more) variables AND‟ed and
inverted (NOT) as a whole is equivalent to the OR of the complements of individual variables.
Thus, AND + NOT (NAND) operation on variables is equivalent to the sum (OR) of the
individual complement of each variable. In Boolean expression, it is stated as follow:
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 27
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 28
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Which means that the function is true for the min terms {1, 2, 3, 5}.
Canonical form contains all inputs either complemented or non-complemented in its product
terms.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 29
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
F = ABC AB ABC
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 30
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Max Term
Maxterm means the term or expression that is true for a maximum number of input
combinations or that is false for only one combination of inputs. Since OR gate also gives false
for only one input combination. So Maxterm is OR of either complemented or non-
complemented inputs. Max terms for 3 input variables are given below.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 31
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
It is also known as Product of Max term or Canonical conjunctive normal form (CCNF).
Canonical means standard and conjunctive means intersection. In this form, Maxterms are
AND together for which output is false. Canonical POS expression is represented by ∏ and
Maxterms for which output is false in brackets as shown in the example given below.
The canonical form contains all inputs either complemented or non-complemented in its each
Sum term.
The product of sum expression that is not in standard form is called non-canonical form. Let‟s
take the above-given function as an example.
F = (B C) (A B C)(A B C)
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 32
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Same but inverted terms eliminates from two Max terms and form a single term to prove it
here is an example.
= (A B C) (A B C)
= AA AB AC AB BB BC AC BC CC
= 0 AB AC AB AC B BC C
= (B C)(A A) B(1) C
= (B+C)(0)+B+C
= B+C
The expression achieved is still in Product of Sum form but it is non-canonical form.
This is the most simplified and optimized form of a POS expression which is non-canonical.
Minimal Product of Sum form can be achieved using Boolean algebraic theorems like in the
non-canonical example given above. Another method of achieving minimal POS form is by
using Karnaugh map which is comparatively easier than using Boolean algebraic theorems.
Minimal POS form uses less number of inputs and logic gates during its implementation, that‟s
why they are being preferred over canonical form for their compact,fast and low-cost
implementation.
The expression of the product of the sum executes two levels OR- AND design and this design
requires a collection of OR gates and one AND gate. Each expression of the product of the
sum has similar designing.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 33
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Karnaugh map:
Karnaugh Maps or K-maps is one among such simplification technique, introduced by Maurice
Karnaugh in 1953, which is graphical in nature. This method of minimizing the logical
expressions is most suitable when the number of variables involved is less than or equal to
four. This is because, a K-map employs the use of two-dimensional tables to simplify the
expressions, whose size increases at a very high rate with the increase in the number of
variables. This fact is further established by Figure which shows the K-maps for two, three and
four variables in order.
Disadvantages of K-map
Complexity of K-map simplification process increases with the increase in the number
of variables
The minimum expression obtained might not be uniqueIn an isolated
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 34
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
F = BC AB
Product of Sum (POS)
Logic Gates – AND, OR, NOT, NAND, NOR, EX-OR and EX-NOR
Gates:
A logic gate is a device that acts as a building block for digital circuits. They perform basic
logical functions that are fundamental to digital circuits. In a circuit, logic gates will make
decisions based on a combination of digital signals coming from its inputs. Most logic gates
have two inputs and one output. Logic gates are based on Boolean algebra. At any given
moment, every terminal is in one of the two binary conditions, false or true. False represents 0,
and true represents 1.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 35
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
OR Gate: (IC7432)
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 36
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 37
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
The Exclusive-OR or „Ex-OR‟ gate is a digital logic gate that accepts more than two
inputs but only outputs one value.
If any of the inputs is „High,‟ the output of the XOR Gate is „High.‟ If both inputs are
„High,‟ the output is „Low.‟ If both inputs are „Low,‟ the output is „Low.‟
The Boolean equation for the XOR gate is Y=A’.B A.B’ if there are two inputs A and
B.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 38
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
The Exclusive-NOR or „EX-NOR‟ gate is a digital logic gate that accepts more than
two inputs but only outputs one.
If both inputs are „High,‟ the output of the XNOR Gate is „High.‟ If both inputs are
„Low,‟ the output is „High.‟ If one of the inputs is „Low,‟ the output is „Low.‟
If there are two inputs A and B, then the XNOR gate‟s Boolean equation is:
Y=A.B A’B’.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 39
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 40
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Code Conversion:
The Code converter is used to convert one type of binary code to another. There are different
types of binary codes like BCD code, gray code, excess-3 code, etc. Different codes are used
for different types of digital applications.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 41
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Dataflow Modelling
Behavioral Modelling
Structural Modelling
Describing a Design
In VHDL an entity is used to describe a hardware module. An entity can be described using,
Entity declaration
Architecture
Configuration
Package declaration
Package body
Simulator Softwares
Xilinx Simulator
Active-HDL
Quartus II Simulator (Qsim)
ModelSim
MPSim
Verilog-XL Etc…,
LIBRARY DECLARATION
Library IEEE;
Use IEEE.std_logic_1164.all;
ENTITY DECLARATION
Entity andgate is
Port (A, B: in std_logic;
C: out std_logic);
End andgate;
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 42
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
ARCHITECTURE DECLARATION
Architecture dataflow of andgate is
Begin
C<=A AND B;
End dataflow;
OR LOGIC:
LIBRARY DECLARATION
Library IEEE;
Use IEEE.std_logic_1164.all;
ENTITY DECLARATION
Entity orgate is
Port (A, B: in std_logic;
C: out std_logic);
End orgate;
ARCHITECTURE DECLARATION
Architecture dataflow of orgate is
Begin
C<= A OR B;
End dataflow;
NOT LOGIC:
LIBRARY DECLARATION
Library IEEE;
Use IEEE.std_logic_1164.all;
ENTITY DECLARATION
Entity notgate is
Port (A: in std_logic;
C: out std_logic);
End notgate;
ARCHITECTURE DECLARATION
Architecture dataflow of notgate is
Begin
C<=NOT A;
End dataflow;
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 43
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
NAND LOGIC
LIBRARY DECLARATION
Library IEEE;
Use IEEE.std_logic_1164.all;
ENTITY DECLARATION
Entity nandgate is
Port (A, B: in std_logic;
C: out std_logic);
End nandgate;
ARCHITECTURE DECLARATION
Architecture dataflow of nandgate is
Begin
C<=A NAND B;
End dataflow;
NOR LOGIC
LIBRARY DECLARATION
Library IEEE;
Use IEEE.std_logic_1164.all;
ENTITY DECLARATION
Entity norgate is
Port (A, B: in std_logic;
C: out std_logic);
End norgate;
ARCHITECTURE DECLARATION
Architecture dataflow of norgate is
Begin
C<=A NOR B;
End dataflow;
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 44
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
EX-OR LOGIC
LIBRARY DECLARATION
Library IEEE;
Use IEEE.std_logic_1164.all;
ENTITY DECLARATION
Entity xorgate is
Port (A, B: in std_logic;
C: out std_logic);
End xorgate;
ARCHITECTURE DECLARATION
Architecture dataflow of xorgate is
Begin
C<=A XOR B;
End dataflow;
EX-NOR LOGIC
LIBRARY DECLARATION
Library IEEE;
Use IEEE.std_logic_1164.all;
ENTITY DECLARATION
Entity xnorgate is
Port (A, B: in std_logic;
C: out std_logic);
End xnorgate;
ARCHITECTURE DECLARATION
Architecture dataflow of xnorgate is
Begin
C<=A XNOR B;
End dataflow;
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 45
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Library IEEE;
Use IEEE.std_logic_1164.all;
ENTITY DECLARATION
Entity logicgate is
End logicgate;
ARCHITECTURE DECLARATION
Begin
Y0<= A AND B;
Y1 <=A OR B;
Y2 <=NOT A;
Y3 <=A NAND B;
Y4 <=A NOR B;
Y5 <=A XOR B;
End dataflow;
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 46
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
UNIT - III
COMBINATIONAL LOGIC CIRCUITS
Half Adder:
A half adder is a type of adder, an digital circuit that performs the addition of numbers. The
half adder is able to add two single binary digits and provide the output plus a carry value. It
has two inputs, called A and B, and two outputs S (sum) and C (carry). The common
representation uses a XOR logic gate and an AND logic gate.
Block diagram
Full Adder:
A full adder is a digital circuit that performs addition. Full adders are implemented with logic
gates in hardware. A full adder adds three one-bit binary numbers, two operands and a carry
bit. The adder outputs two numbers, a sum and a carry bit. The term is contrasted with a half
adder, which adds two binary digits.
Block diagram
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 47
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
The above block diagram describes the construction of the Full adder circuit. In the above
circuit, there are two half adder circuits that are combined using the OR gate. The first half
adder has two single-bit binary inputs A and B. As we know that, the half adder produces two
outputs, i.e., Sum and Carry. The 'Sum' output of the first adder will be the first input of the
second half adder, and the 'Carry' output of the first adder will be the second input of the
second half adder. The second half adder will again provide 'Sum' and 'Carry'. The final
outcome of the Full adder circuit is the 'Sum' bit. In order to find the final output of the 'Carry',
we provide the 'Carry' output of the first and the second adder into the OR gate. The outcome
of the OR gate will be the final carry out of the full adder circuit. The MSB is represented by
the final 'Carry' bit.
Truth Table
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 48
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Half Subtractor:
The half subtractor is also a building block for subtracting two binary numbers. It has two
inputs and two outputs. This circuit is used to subtract two single bit binary numbers A and B.
The 'difference' and 'borrow' are two output states of the half subtractor.
Block diagram
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 49
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Full Subtractor:
A full subtractor is an arithmetic circuit that performs a subtraction between two bits,
considering that a lower significant stage may have borrowed a '1'. Thus a full subtractor has
three inputs and two outputs.
Block diagram
The above block diagram describes the construction of the Full subtractor circuit. In the above
circuit, there are two half adder circuits that are combined using the OR gate. The first half
subtractor has two single-bit binary inputs A and B.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 50
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
As we know that, the half subtractor produces two outputs, i.e., 'Diff' and 'Borrow'. The 'Diff'
output of the first subtractor will be the first input of the second half subtractor, and the
'Borrow' output of the first subtractor will be the second input of the second half subtractor.
The second half subtractor will again provide 'Diff' and 'Borrow'. The final outcome of the Full
subtractor circuit is the 'Diff' bit. In order to find the final output of the 'Borrow', we provide
the 'Borrow' of the first and the second subtractor into the OR gate. The outcome of the OR
gate will be the final carry 'Borrow' of full subtractor circuit. The MSB is represented by the
final 'Borrow' bit.
Truth Table
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 51
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
For example, if you want to add two 4-bit binary numbers, you have to connect 4 number of
full adders in parallel. The below block diagram shows „n‟ number of full adders cascaded
with one another to design a n-bit parallel adder.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 52
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
The 'A' and 'B' are the augend, and addend bits are defined by the subscript numbers.
The subscripts start from right to left, and the lower-order bit is defined by subscript '0'.
The C0, C1, C2, and C3 are the carry inputs which are connected together as a chain
using Full Adder. The C4 is the carry output produced by the last Full-Adder.
The Cout of the first Adder is connected as the Cin of the next Full-Adder.
The S0, S1, S2, and S3 are the sum outputs that produce the sum of augend and addend
bits.
The inputs for the input variable 'A' and 'B' are fetched from different source registers.
For example, the bit for the input variable 'A' comes from register 'R1', and a bit for the
input variable 'B' comes from register 'R2'.
The outcome produced by adding both input variables is stored into either third register
or to one of the source registers.
Advantages
Computation is fast.
Bits are added simultaneously.
They are economical.
Disadvantages
The major drawback of this Adder is the Propagation Delay.
The delay is directly proportional to the length of binary numbers that are to be added.
Parallel 4-bit Binary Adder, which has three full adders and one half adder. The two binary
numbers to be added are „A3 A2 A1 A0„ and „B3 B2 B1 B0„ , which are applied to the
corresponding inputs of the Full Adders. This parallel adder produces their result as „C4 S3 S2
S1 S0„ , where C4 is the final carry.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 53
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
In this subtractor, 4 bit minuend „A3 A2 A1 A0„ is subtracted by 4 bit subtrahend „B3 B2 B1
B0„ and the result is the difference output „D3 D2 D1 D0„ . The borrow output of each
subtractor is connected as the borrow input to the next subtractor.
BCD adder:
The digital systems handles the decimal number in the form of binary coded decimal numbers
(BCD). A BCD Adder Circuit that adds two BCD digits and produces a sum digit also in BCD.
BCD numbers use 10 digits, 0 to 9 which are represented in the binary form 0 0 0 0 to 1 0 0 1,
i.e. each BCD digit is represented as a 4-bit binary number. When we write BCD number say
526, it can be represented as
Here, we should note that BCD cannot be greater than 9. The addition of two BCD numbers
can be best understood by considering the three cases that occur when two BCD digits are
added.
Let us consider additions of 3 and 6 in BCD. The addition is carried out as in normal binary
addition and the sum is 1 0 0 1, which is BCD code for 9.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 54
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
The sum 1 1 1 0 is an invalid BCD number. This has occurred because the sum of the two
digits exceeds 9. Whenever this occurs the sum has to be corrected by the addition of six
(0110) in the invalid BCD number, as shown below
In this, case, result (0001 0001) is valid BCD number, but it is incorrect. To get the correct
BCD result correction factor of 6 has to be added to the least significant digit sum, as shown
below
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 55
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Going through these three cases of BCD addition we can summarise the BCD addition
procedure as follows :
Add two BCD numbers using ordinay binary addition.
If four-bit sum is equal to or less than 9, no correction is needed. The sum is in proper
BCD form.
If the four-bit sum is greater than 9 or if a carry is generated from the four-bit sum, the
sum is invalid.
To correct the invalid sum, add 01102 to the four-bit sum. If a carry results from this
addition, add it to the next higher-order BCD digit.
Multiplexer:
What are Multiplexer and Demultiplexer?
In-network transmission, both the multiplexer and demultiplexer are combinational circuits. A
multiplexer selects an input from several inputs then it is transmitted in the form of a single
line. An alternative name of the multiplexer is MUX or data selector. A demultiplexer uses one
input signal and generates many. So it is known as Demux or data distributor.
What is a Multiplexer?
The multiplexer is a device that has multiple inputs and single line output. The select lines
determine which input is connected to the output, and also increase the amount of data that can
be sent over a network within a certain time. It is also called a data selector. Multiplexer is
also called as Mux.
ONE into MANY
Multiplexer Types
2-1 multiplexer ( 1select line)
4-1 multiplexer (2 select lines)
8-1 multiplexer(3 select lines)
16-1 multiplexer (4 select lines) Etc…,
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 56
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
2x1 Multiplexer
In 2×1 multiplexer, there are only two inputs, i.e., A0 and A1, 1 selection line, i.e., S0 and
single outputs, i.e., Y. On the basis of the combination of inputs which are present at the
selection line S0, one of these 2 inputs will be connected to the output. The block diagram and
the truth table of the 2×1 multiplexer are given below.
4x1 Multiplexer
4x1 Multiplexer has four data inputs I3, I2, I1 & I0, two selection lines s1 & s0 and one output
Y. The block diagram of 4x1 Multiplexer is shown in the following figure.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 57
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
One of these 4 inputs will be connected to the output based on the combination of inputs
present at these two selection lines.
8 to 1 Multiplexer
In the 8 to 1 multiplexer, there are total eight inputs, i.e., A0, A1, A2, A3, A4, A5, A6, and A7,
3 selection lines, i.e., S0, S1and S2 and single output, i.e., Y. On the basis of the combination
of inputs that are present at the selection lines S0, S1, and S2, one of these 8 inputs are
connected to the output. The block diagram and the truth table of the 8×1 multiplexer are given
below.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 58
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
16 to 1 Multiplexer
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 59
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Advantages
In multiplexer, the usage of a number of wires can be decreased
It reduces the cost as well as the complexity of the circuit
The implementation of a number of combination circuits can be possible by using a
multiplexer
The multiplexer can make the transmission circuit less complex & economical
The multiplexer ability can be extended to switch audio signals, video signals, etc.
The digital system reliability can be improved using a MUX as it decreases the number
of exterior wired connections.
MUX is used to implement several combinational circuits
The logic design can be simplified through MUX
Disadvantages
Additional delays required within switching ports & I/O signals which propagate
throughout the multiplexer.
The ports which can be utilized at the same time have limitations
Switching ports can be handled by adding the complexity of firmware
The controlling of multiplexer can be done by using additional I/O ports.
Demultiplexer:
What is Demultiplexer?
Demultiplexer or Demux is a combinational circuit that distributes the single input data to a
specific output line. The control inputs or selection lines are used to select a specific output
line from the possible output lines. Demultiplexer works opposite to that of the multiplexer.
Demux has one output, 2n possible outputs and n control or selection lines. It is also called a
data distributor.
MANY into ONE
Types of Demultiplexer
1-2 demultiplexer (1 select line)
1-4 demultiplexer (2 select lines)
1-8 demultiplexer (3 select lines)
1-16 demultiplexer (4 select lines) Etc…,
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 60
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
1×2 De-multiplexer:
In the 1 to 2 De-multiplexer, there are only two outputs, i.e., Y0, and Y1, 1 selection lines, i.e.,
S0, and single input, i.e., A. On the basis of the selection value, the input will be connected to
one of the outputs. The block diagram and the truth table of the 1×2 multiplexer are given
below.
Logic Circuit
1×4 De-multiplexer:
In 1 to 4 De-multiplexer, there are total of four outputs, i.e., Y0, Y1, Y2, and Y3, 2 selection
lines, i.e., S0 and S1 and single input, i.e., A. On the basis of the combination of inputs which
are present at the selection lines S0 and S1, the input be connected to one of the outputs. The
block diagram and the truth table of the 1×4 multiplexer are given below.
Block Diagram and Truth Table
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 61
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Logic Circuit
1×8 De-multiplexer
In 1 to 8 De-multiplexer, there are total of eight outputs, i.e., Y0, Y1, Y2, Y3, Y4, Y5, Y6, and
Y7, 3 selection lines, i.e., S0, S1and S2 and single input, i.e., A. On the basis of the
combination of inputs which are present at the selection lines S0, S1 and S2, the input will be
connected to one of these outputs. The block diagram and the truth table of the 1×8 de-
multiplexer are given below.
Block Diagram
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 62
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Truth Table
Logic Circuit
1 x 16 De-multiplexer
In 1×16 de-multiplexer, there are total of 16 outputs, i.e., Y0, Y1, …, Y16, 4 selection lines,
i.e., S0, S1, S2, and S3 and single input, i.e., A. On the basis of the combination of inputs
which are present at the selection lines S0, S1, and S2, the input will be connected to one of
these outputs. The block diagram and the truth table of the 1×16 de-multiplexer are given
below.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 63
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Logic Circuit
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 64
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Advantages
A demultiplexer or Demux is used to divide the mutual signals back into separate
streams.
The function of Demux is quite opposite to MUX.
The Audio or Video signals transmission needs a combination of Mux and Demux.
Demux is used as a decoder within the security systems of banking sectors.
The communication system efficiency can be enhanced through the combination of
Mux & Demux.
Disadvantages
Bandwidth wastage might happen
Because of the synchronization of the signals, delays might take place
Multiplexer Demultiplexer
It has multiple inputs and a single output. It has a single input and multiple outputs.
Encoders:
The combinational circuits that change the binary information into N output lines are known as
Encoders. The binary information is passed in the form of 2N input lines. The output lines
define the N-bit code for the binary information. In simple words, the Encoder performs the
reverse operation of the Decoder. At a time, only one input line is activated for simplicity. The
produced N-bit output code is equivalent to the binary information.
Types of Encoder
2-1 Encoder (1 select line)
4-1 Encoder (2 select lines)
8-1 Encoder (3 select lines)
16-1 Encoder (4 select lines) Etc…,
4-1 Encoder
In 4 to 2 line encoder, there are total of four inputs, i.e., Y0, Y1, Y2, and Y3, and two outputs,
i.e., A0 and A1. In 4-input lines, one input-line is set to true at a time to get the respective
binary code in the output side. Below are the block diagram and the truth table of the 4 to 2
line encoder.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 65
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Block Diagram
Truth Table
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 66
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Logic Circuit
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 67
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Decoders:
Basically, Decoder is a combinational logic circuit that converts coded input to coded outputs
provided both of these are different from one another. The name decoder means translating of
coded information from one format into another.
A decoder is a multiple input, multiple output logic circuit that changes codes i/ps into coded
o/ps, where both the inputs and outputs are dissimilar for instance n-to-2n, and binary coded
decimal decoders.
Types of Decoders
1-2 decoder (1 select line)
1-4 decoder (2 select lines)
1-8 decoder (3 select lines)
1-16 decoder (4 select lines) Etc…,
2 to 4 Line Decoder:
In the 2 to 4 line decoder, there is a total of three inputs, i.e., A0, and A1 and E and four
outputs, i.e., Y0, Y1, Y2, and Y3. For each combination of inputs, when the enable 'E' is set to
1, one of these four outputs will be 1. The block diagram and the truth table of the 2 to 4 line
decoder are given below.
Block Diagram:
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 68
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Truth Table:
Logic Circuit
3 to 8 Line Decoder:
The 3 to 8 line decoder is also known as Binary to Octal Decoder. In a 3 to 8 line decoder,
there is a total of eight outputs, i.e., Y0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7 and three outputs,
i.e., A0, A1, and A2. This circuit has an enable input 'E'. Just like 2 to 4 line decoder, when
enable 'E' is set to 1, one of these four outputs will be 1. The block diagram and the truth table
of the 3 to 8 line encoder are given below.
Block Diagram:
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 69
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Truth Table:
Logic Circuit
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 70
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
4 to 16 Line Decoder:
In the 4 to 16 line decoder, there is a total of 16 outputs, i.e., Y0, Y1, Y2,……, Y16 and four
inputs, i.e., A0, A1, A2, and A3. The 3 to 16 line decoder can be constructed using either 2 to
4 decoder or 3 to 8 decoder. There is the following formula used to find the required number of
lower-order decoders. Required number of lower order decoders=m2/m1
Block Diagram:
Truth Table:
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 71
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Logic Circuit
In odd parity bit, the code must be in an odd number of 1‟s, for example, we are taking 6-bit
code 100011, this code is said to be odd parity because there is three number of 1‟s in the code
which we have taken. In even parity bit the code must be in even number of 1‟s, for example,
we are taking 6-bit code 101101, this code is said to be even parity because there are four
number of 1‟s in the code which we have taken.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 72
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Definition: The parity generator is a combination circuit at the transmitter, it takes an original
message as input and generates the parity bit for that message and the transmitter in this
generator transmits messages along with its parity bit. Types of Parity generator,
Logic Circuit
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 73
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Logic Circuit
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 74
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Definition: The combinational circuit at the receiver is the parity checker. This checker takes
the received message including the parity bit as input. It gives output „1‟ if there is some error
found and gives output „0‟ if no error is found in the message including the parity bit. Types of
Parity Checker,
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 75
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Logic Circuit
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 76
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Magnitude Comparators:
A magnitude digital Comparator is a combinational circuit that compares two digital or binary
numbers in order to find out whether one binary number is equal, less than, or greater than the
other binary number. We logically design a circuit for which we will have two inputs one for A
and the other for B and have three output terminals, one for A > B condition, one for A = B
condition, and one for A < B condition.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 77
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Logic Circuit
Block Diagram
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 78
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Truth Table
Logic Circuit
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 79
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
LIBRARY DECLARATION
Library IEEE;
Use IEEE.std_logic_1164.all;
ENTITY DECLARATION
Entity halfadder is
Port (A, B: in std_logic;
Sum, Carry: out std_logic);
End halfadder;
ARCHITECTURE DECLARATION
Architecture behavioral of halfadder is
Begin
Process (A, B)
Begin
Sum <= A XOR B;
Carry <= A AND B;
End process;
End behavioral;
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 80
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
HALF SUBTRACTOR:
LIBRARY DECLARATION
Library IEEE;
Use IEEE.std_logic_1164.all;
ENTITY DECLARATION
Entity halfsubtractor is
Port (A, B: in std_logic;
Difference, Borrow: out std_logic);
End halfsubtractor;
ARCHITECTURE DECLARATION
Architecture behavioral of halfsubtractor is
Begin
Process (A, B)
Begin
Difference <= A XOR B;
Borrow <= (NOT A) AND B;
End process;
End behavioral;
LIBRARY DECLARATION
Library IEEE;
Use IEEE.std_logic_1164.all;
ENTITY DECLARATION
Entity fullsubtractor is
Port (A, B, C: in std_logic;
Difference, Borrow: out std_logic);
End fullsubtractor;
ARCHITECTURE DECLARATION
Architecture behavioral of fullsubtractor is
Begin
Process (A, B, C)
Begin
Difference <= A XOR B XOR C;
Borrow <= (NOT (A XOR B) AND C) OR (NOT A AND B);
End process;
End behavioral;
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 81
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 82
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 83
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
UNIT - IV
SEQUENTIAL LOGIC CIRCUITS
Flip Flops – RS, Clocked RS, JK, JK Master Slave, D and T Flip Flops:
What is Flip-Flop?
A flip flop is a binary storage device. It can store binary bit either 0 or 1. It has two stable
states HIGH and LOW i.e. 1 and 0. It has the property to remain in one state indefinitely until
it is directed by an input signal to switch over to the other state. We can construct a basic flip-
flop using four-NOR and four-NAND gates.
Types of Flip-Flops
RS / SR Flip Flop
The S-R flip flop is the most common flip flop used in the digital system. In SR flip flop, when
the set input "S" is true, the output Y will be high, and Y' will be low. It is required that the
wiring of the circuit is maintained when the outputs are established. We maintain the wiring
until set or reset input goes high, or power is shutdown.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 84
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
JK Flip Flop
The JK flip flop is used to remove the drawback of the S-R flip flop, i.e., undefined states. The
JK flip flop is formed by doing modification in the SR flip flop. The S-R flip flop is improved
in order to construct the J-K flip flop. When S and R input is set to true, the SR flip flop gives
an inaccurate result. But in the case of JK flip flop, it gives the correct output.
In J-K flip flop, if both of its inputs are different, the value of J at the next clock edge is taken
by the output Y. If both of its input is low, then no change occurs, and if high at the clock
edge, then from one state to the other, the output will be toggled. The JK Flip Flop is a Set or
Reset Flip flop in the digital system.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 85
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
D Flip Flop
D flip flop is a widely used flip flop in digital systems. The D flip flop is mostly used in shift-
registers, counters, and input synchronization.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 86
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
T Flip Flop:
Just like JK flip-flop, T flip flop is used. Unlike JK flip flop, in T flip flop, there is only single
input with the clock input. The T flip flop is constructed by connecting both of the inputs of JK
flip flop together as a single input.
Applications of Flip-Flops:
These are the various types of flip-flops being used in digital electronic circuits and the
applications of Flip-flops are as specified below.
Counters
Frequency Dividers
Shift Registers
Storage Registers
Bounce elimination switch
Data storage
Data transfer
Latch
Registers
Memory
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 87
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Here, the data is inserted at the input bit by bit. For each clock pulse, the data bit is shifted
from one flip-flop to the next flip-flop. At the output side, the inserted data will be received bit
by bit for each clock pulse. Since the inserted data and the received data are done in a bit-by-
bit fashion, this register is known as the Serial in Serial out shift register.
During the clock pulse, the D input of each flip-flop is shifted to the Q output. The Q outputs
of all the flip-flops are tapped separately. Thus the parallel output data(QAQBQCQD) will
have the bit from each individual register. The Serial-in Parallel-out shift register is mainly
used for communication purposes where the serial input data in converted into parallel output
data.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 88
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
D flip-flop is used for the construction of the Parallel-in Parallel-out shift register. The four-bit
data is loaded at the input of four flip-flops. When a clock pulse is applied, the loaded data is
shifted to the output of the flip-flop, which is tapped out for measurements. A single clock
pulse will load the data and unload the data.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 89
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Ring Counters:
A ring counter is a special type of application of the Serial IN Serial OUT Shift register. The
only difference between the shift register and the ring counter is that the last flip flop outcome
is taken as the output in the shift register. But in the ring counter, this outcome is passed to the
first flip flop as an input. All of the remaining things in the ring counter are the same as the
shift register.
In this diagram, we can see that the clock pulse (CLK) is applied to all the flip-flops
simultaneously. Therefore, it is a Synchronous Counter. Also, here we use Overriding input
(ORI) for each flip-flop. Preset (PR) and Clear (CLR) are used as ORI. When PR is 0, then the
output is 1. And when CLR is 0, then the output is 0. Both PR and CLR are active low signal
that always works in value 0.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 90
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
In the circuit shown in the above figure, Q0(LSB) will toggle for every clock pulse because JK
flip-flop works in toggle mode when both J and K are applied 1, 1, or high input. The
following counter will toggle when the previous one changes from 1 to 0.
Timing diagram: Let us assume that the clock is negative edge triggered so the above the
counter will act as an up counter because the clock is negative edge triggered and output is
taken from Q.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 91
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Synchronous Counter:
Definition: The synchronous counter is a type of counter in which the clock signal is
simultaneously provided to each flip-flop present in the counter circuit. More specifically, we
can say that each flip-flop is triggered in synchronism with the clock input.
The circuit is composed of 3 J-K flip-flops and 2 AND gates. And the clock signal to trigger
the flip-flop is provided at the same time. It is noteworthy here that only the input terminal of
flip-flop A is provided with active high signal and therefore it toggles at the falling edge of
each clock input. Furthermore, the input to flip-flop B will be provided through an AND gate
whose output will depend on the input and output of previous flip-flop i.e., B in this case. And
the gate turns on and causes flip-flop B to toggle only when the output of flip-flop A will be
high. In a similar way, the input to flip-flop C will be the output of 2nd AND gate. Therefore,
flip-flop C toggles only when gate A2 will be on. And A2 will be on only in case when the
output of A1, as well as flip-flop B, will be high.
It is noteworthy in case of synchronous counters that the resetting of all the flip-flops in the
circuit occurs at the same time. Thus the settling time of the counter is equivalent to the
propagation delay time of each flip-flop in the circuit. Thus the synchronous counter can be
operated with a clock signal of high frequency.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 92
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Up Down counter:
What is an Up/Down Counter?
The up/Down counter is also known as the bidirectional counter which is used to count in any
direction based on the condition of the input control pin. These are used in different
applications to count up from zero to provide a change within the output condition on attaining
a fixed value & others count down from a fixed value to zero to give an output condition
change. There are some types of counters like TTL 74LS190 & 75LS191 which can function
in both up & down count mode based on the condition of an input pin of up/down count mode.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 93
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Modulo 5 Counter
A MOD-5 counter would produce a 3-bit binary count sequence from 0 to 4, as 000 is a valid
count state, giving us a binary count sequency of: 000, 001, 010, 011, 100. Therefore we need
the counter circuit to reset itself on the next counting state as the count of six (the next count)
would produce an output condition of: QA = 1, QB = 0, and QC = 1 in binary as shown in the
following state diagram.
MOD-5 Count Sequence
While it appears that the counter counts up to the 101 state, when the asynchronous count
sequence reaches the next binary state of 101 (5), the combinational logic decoding circuit will
detect this 101 condition, so the AND gate will produce a logic level “1” (HIGH) output
resetting the counter back to its initial zero state. Thus the counter only remains in this 101
temporary state for only a few nanoseconds before it resets back to 000.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 94
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Therefore we can use the input decoding of the AND gate to reset the counter back to zero
after its output of 5 (decimal) count giving us the required MOD-5 counter. When the output
from the decoding circuit is LOW, it has no effect on the counting sequence.
A 4 bit binary counter will act as decade counter by skipping any six outputs out of the 16 (24)
outputs. There are some available ICs for decade counters which we can readily use in our
circuit, like 74LS90. It is an asynchronous decade counter.
The above figure shows a decade counter constructed with JK flip flop. The J output and K
outputs are connected to logic 1. The clock input of every flip flop is connected to the output
of next flip flop, except the last one.
The output of the NAND gate is connected in parallel to the clear input „CLR‟ to all the flip
flops. This ripple counter can count up to 16 i.e. 24.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 95
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
The above table describes the counting operation of Decade counter. It represents the count of
circuit for decimal count of input pulses. The NAND gate output is zero when the count
reaches 10 (1010). The count is decoded by the inputs of NAND gate X1 and X3. After count
10, the logic gate NAND will trigger its output from 1 to 0, and it resets all flip flops.
Applications:
They are widely used in lots of other designs as well such as processors, calculators, real time
clock etc. Some common uses and application of synchronous counters are follow:
Alarm Clock, Set AC Timer, Set time in camera to take the picture, flashing light
indicator in automobiles, car parking control etc.
Counting the time allotted for special process or event by the scheduler.
The UP/DOWN counter can be used as a self-reversing counter.
It is also used as clock divider circuit.
The parallel load feature can be used to preset the counter for some initial count.
Commons used in home appliances like washing machine, microwave own, Time
schedule led indicator, key board controller etc.
They are also used in machine moving control.
Mostly used in digital clocks and multiplexing circuits.
They are used to generate saw-tooth waveform (Stair case voltage)
It is also used in digital to analog converters.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 96
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 97
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
UNIT - V
D/A AND A/D CONVERTERS
Types of DACs
There are two types of DACs
Weighted Resistor DAC
R-2R Ladder DAC
Recall that the bits of a binary number can have only one of the two values. i.e., either 0 or 1.
Let the 3-bit binary input is b2b1b0. Here, the bits b2 and b0 denote the Most Significant Bit
(MSB) and Least Significant Bit (LSB) respectively.
The digital switches shown in the above figure will be connected to ground, when the
corresponding input bits are equal to „0‟. Similarly, the digital switches shown in the above
figure will be connected to the negative reference voltage, −VR when the corresponding input
bits are equal to „1‟.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 98
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
In the above circuit, the non-inverting input terminal of an op-amp is connected to ground.
That means zero volts is applied at the non-inverting input terminal of op-amp. According to
the virtual short concept, the voltage at the inverting input terminal of opamp is same as that of
the voltage present at its non-inverting input terminal. So, the voltage at the inverting input
terminal‟s node will be zero volts. The nodal equation at the inverting input terminal‟s node is:
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 99
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
The above equation represents the output voltage equation of a 3-bit binary weighted resistor
DAC. Since the number of bits are three in the binary (digital) input, we will get seven
possible values of output voltage by varying the binary input from 000 to 111 for a fixed
reference voltage, VR. We can write the generalized output voltage equation of an N-bit binary
weighted resistor DAC as shown below based on the output voltage equation of a 3-bit binary
weighted resistor DAC.
The difference between the resistance values corresponding to LSB & MSB will
increase as the number of bits present in the digital input increases.
It is difficult to design more accurate resistors as the number of bits present in the
digital input increases.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 100
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Recall that the bits of a binary number can have only one of the two values. i.e., either 0 or 1.
Let the 3-bit binary input is b2b1b0. Here, the bits b2 and b0 denote the Most Significant Bit
(MSB) and Least Significant Bit (LSB) respectively.
The digital switches shown in the above figure will be connected to ground, when the
corresponding input bits are equal to „0‟. Similarly, the digital switches shown in above figure
will be connected to the negative reference voltage, −VR when the corresponding input bits are
equal to „1‟. It is difficult to get the generalized output voltage equation of a R-2R Ladder
DAC. But, we can find the analog output voltage values of R-2R Ladder DAC for individual
binary input combinations easily.
Advantages of a R-2R Ladder DAC
R-2R Ladder DAC contains only two values of resistor: R and 2R. So, it is easy to
select and design more accurate resistors.
If more number of bits are present in the digital input, then we have to include required
number of R-2R sections additionally.
Absolute accuracy is the maximum deviation between the actual converter output and the
ideal converter output. Relative accuracy is the maximum deviation after gain and offset
errors have been removed.
For a DAC, resolution describes the number of bits available in the digital domain to
represent the analog output signal. With the resolution, we can calculate the number of
codes, or total number of possible outputs, that we can write to the converter.
Two very important aspects of the D/A converter are the resolution and the accuracy of the
conversion. There is a definite distinction between the two, and you should clearly understand
the differences. The accuracy of the D/A converter is primarily a function of the accuracy of
the precision resistors used in the ladder and the precision of the reference voltage supply used.
Accuracy is a measure of how close the actual output voltage is to the theoretical output value.
For example, suppose that the theoretical output voltage for a particular input should be+ 10
V.An accuracy of l0 percent means that the actual output voltage must be somewhere between
+9 and + 11 V. Similarly, if the actual output voltage were somewhere between +9.9 and+ 10.1
V, this would imply an accuracy of 1 percent.
Resolution, on the other hand, defines the smallest increment in voltage that can be discerned.
Resolution is primarily a function of the number ofbits in the digital input signal; that is, the
smallest increment in output voltage is determined by the LSB.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 101
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Counter:
The counter type ADC is constructed using a binary counter, DAC and a comparator. The
output voltage of a DAC is VD which is equivalent to corresponding digital input to DAC.
The following figure shows the n-bit counter type ADC.
Operation:
The n-bit binary counter is initially set to 0 by using reset command. Therefore the
digital output is zero and the equivalent voltage VD is also 0V. When the reset command is
removed, the clock pulses are allowed to go through AND gate and are counted by the binary
counter. The D to A converter (DAC) converts the digital output to an analog voltage and
applied as the inverting input to the comparator.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 102
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
The output of the comparator enables the AND gate to pass the clock. The number of
clock pulses increases with time and the analog input voltage VD is a rising staircase
waveform as shown in figure below. The counting will continue until the DAC output VD,
equals and just rises more than unknown analog input voltage VA. Then the comparator output
becomes low and this disables the AND gate from passing the clock. The counting stops at the
instance VA< VD, and at that instant the counter stops its progress and the conversion is said
to be complete.
The numbers stored in the n-bit counter is the equivalent n-bit digital data for the given
analog input voltage.
Advantages:
Simple construction.
Easy to design and less expensive.
Speed can be adjusted by adjusting the clock frequency.
Faster than dual slope type ADC.
Ramp Type:
A ramp-type analog-to-digital converter (also known as ramp-compare or time-base ADC)
comprises five basic circuits: a ramp generator, a counter, a comparator circuit, a clock pulse
generator, and a gate circuit, which are simultaneously operated to provide analog-to-digital
conversion. The block diagram of a typical ramp-type ADC is shown in the figure below.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 103
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Two inputs are applied to the comparator in the figure above. These are: (1) the analog input,
and (2) a linear ramp (sawtooth) voltage from the ramp generator. The generator output is
initiated each time a start signal is applied. The start signal also resets the counter to zero and
enables the gate circuit. As long as the analog and ramp generator inputs to the comparator
differ in magnitude, the clock pulse generator will be permitted to transmit pulses at a constant
repetition rate through the gate into the counter. When the two inputs to the comparator
become equal (as a result of the linearly rising sawtooth) the comparator will generate a stop
signal which disables the gate circuit and ends the comparison time interval. The disabled gate
circuit blocks the flow of pulses from the clock pulse generator to the counter. The number of
pulses accumulated in the counter during the comparison time interval is proportional to the
amplitude of the analog input voltage. The counter indication is the desired digital
representation of the input signal.
Simultaneous Conversion
This ADC converter IC is also called parallel ADC, which is the most widely used efficient
ADC in terms of its speed. This flash analog to digital converter circuit consists of a series of
comparators where each one compares the input signal with a unique reference voltage. At
each comparator, the output will be a high state when the analog input voltage exceeds the
reference voltage. This output is further given to the priority encoder for generating binary
code based on higher-order input activity by ignoring other active inputs. This flash type is a
high-cost and high-speed device.
Advantages:
1)It is the fastest type of ADC because the conversion is performed simultaneously
through a set of comparators, hence referred as flash type ADC. Typical conversion
time is 100ns or less.
2)The construction is simple and easier to design.
Disadvantages:
1)It is not suitable for higher number of bits.
2)To convert the analog input voltage into a digital signal of n-bit output, (2n – 1)
comparators are required. The number of comparators required doubles for each added
bit.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 104
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
When the input voltage Vin equal to the voltage of the waveform, then the control
circuit captures the counter value which is the digital value of the corresponding analog input
value. This Dual slope ADC is a relatively medium cost and slow speed device.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 105
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
At the start, SAR is reset and as the LOW to HIGH transition is introduced, the MSB of
the SAR is set. Then this output is given to the D/A converter that produces an analog
equivalent of the MSB, further it is compared with the analog input Vin. If comparator output
is LOW, then MSB will be cleared by the SAR, otherwise, the MSB will be set to the next
position. This process continues till all the bits are tried and after Q0, the SAR makes the
parallel output lines to contain valid data.
Advantages:
1 Conversion time is very small.
2 Conversion time is constant and independent of the amplitude of the analog
input signal VA.
Disadvantages:
1 Circuit is complex.
2 The conversion time is more compared to flash type ADC.
For converters, resolution is the number of bits per conversion cycle that the converter is
capable of processing. For example, a converter with 12 bits of resolution is often referred to
as “12 bits wide,” since 12 bits get processed in each conversion cycle. Higher resolution
correlates to a slower conversion rate.
Resolution
The accuracy of a converter refers to how many bits, from conversion to conversion, are
repeatable. That is, accuracy reflects how true the ADC‟s output reflects the actual input.
Accuracy is determined by the DC specifications for gain, offset, and linearity (integral
nonlinearity and differential nonlinearity). The accuracy as stated in the datasheet will always
be equal to or less than the resolution of the converter, with most experiences in the “less than”
category. A common experience is to see a solid conversion of several bits wide with an
unpredictable, nonsensical behavior from the last, or least significant bits (LSB). The ADC
still has a resolution as advertised, but accuracy suffers with the LSBs.
Resolution determines the precision of conversion at each interval. The precision of conversion
is, in turn, determined by the accuracy or fineness of quantization in the A/D conversion
process. If a signal value is quantized by 7 bits (binary digits) the precision of conversion
would be 1/27=1/128; and if a signal value is quantized by 10 bits, the precision of conversion
would be 1/210=1/1024. Thus, resolution is a function of the number of bits in the binary code
which is used in the conversion device. For instance, a resolution of one part in 1000 would
require 10 bits in the binary code.
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 106
DIGITAL PRINCIPLES AND APPLICATIONS Dr. S. KUMAR
Kilo (K)
2^10 = 1,024
Mega (M)
2^20 = 1,048,576
Giga (G)
2^30 = 1,073,741,824
Tera (T)
2^40 = 1,099,511,627,776
Peta (P)
2^50 = 1,125,899,906,842,624
Exa (E)
2^60 = 1,152,921,504,606,846,976
Zetta (Z)
2^70 = 1,180,591,620,717,411,303,424
Yotta (Y)
2^80 = 1,208,925,819,614,629,174,706,176
[Dr.S.KUMAR, Assistant Professor of Electronics, Sri Vasavi College (SF Wing), Erode] Page 107