0% found this document useful (0 votes)
21 views34 pages

Ch-2 - Module1 - Signal Processing Elements - Final

The document discusses various aspects of signal processing elements, focusing on analog-to-digital converters (ADC) and digital-to-analog converters (DAC), including their types and operational principles. It covers the processes of sampling, quantization, and encoding in A/D conversion, as well as the architecture of computer and microcontroller systems. Additionally, it highlights the programming of microcontrollers using assembly language and the advantages and disadvantages of using high-level languages for programming.

Uploaded by

ece.22bech83
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views34 pages

Ch-2 - Module1 - Signal Processing Elements - Final

The document discusses various aspects of signal processing elements, focusing on analog-to-digital converters (ADC) and digital-to-analog converters (DAC), including their types and operational principles. It covers the processes of sampling, quantization, and encoding in A/D conversion, as well as the architecture of computer and microcontroller systems. Additionally, it highlights the programming of microcontrollers using assembly language and the advantages and disadvantages of using high-level languages for programming.

Uploaded by

ece.22bech83
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Module-IV

Signal Processing Element


BY ANITA MOHANTY
CONTENTS
ADC
Successive approximation
Dual slope
Ramp type
Flash type
DAC
R-R type
R-2R ladder type
Sensitivity and resolutions of ADC and DAC
Computer and microcontroller systems
Microcontroller and Computer Software
ANALOG TO DIGITAL CONVERSION
A/D conversion involves three operations:
sampling : performed by a sample-and-hold device
Quantisation
Encoding
the second and third are combined in an analogue-to-digital converter
Sampling:
A continuous signal y(t) could be represented by a set of
samples yi , i = 1, . . . , N, taken at discrete intervals of time
∆T (sampling interval) as shown in Figure below. Here the
switch is closed fS times per second, where sampling
frequency fS = 1/(∆T ).
NYQUIST SAMPLING THEOREM
For the sampled signal yS(t) to be an
adequate representation of y(t), fS should
satisfy the conditions of the Nyquist
sampling theorem:
A continuous signal can be represented by,
and reconstituted from, a set of sample values
provided that the number of samples per second
is at least twice the highest frequency present in
the signal. Mathematically,

where fMAX is the maximum frequency component of the


input signal
ALIASING

If f = 2fMAX, it is just possible to filter out the sampling components and


reconstitute the signal. If f < 2fMAX, the sampling components occupy the same
frequency range as the original signal and it is impossible to filter them out and
reconstitute the signal.
The phenomenon of two different signals being
constructed from a given set of sample values is
referred to as aliasing.
SAMPLE-HOLD CIRCUIT
The operation of
analogue-to-digital
conversion can take
up to a few
milliseconds;
it is necessary
therefore to hold
the output of the
sampler constant at
the sampled value
while the
conversion takes
place. This is done
using a
sample-and-hold
device as shown in
QUANTISATION
• In quantisation, the sample
voltages are rounded either up
or down to one of Q quantisation
values or levels Vq, where q = 0,
1, 2, . . . , Q−1.

• These quantum levels


correspond to the Q decimal
numbers 0, 1, 2,..., Q−1.

• If V0 = yMIN and VQ−1 = yMAX, then


there are (Q− 1) spacing
occupying a span of yMAX − yMIN.

The maximum quantisation • The spacing width or


error is quantisation interval ∆V is
therefore:
∆V =[yMAX − yMIN] /(Q − 1)
ENCODING
The encoder converts the quantisation values Vq into a
parallel digital signal corresponding to a binary coded version
of the decimal numbers 0, 1, 2, . . . , Q−1.
The commonly used decimal or denary number system uses a
base or radix of 10, so that any positive integer is expressed
as a series of powers of 10 (decades):
dn × 10n + dn−1 × 10n−1 + . . . + di × 10i + ... + d1 × 101 + d0 × 100
where the di are the respective weights or digits, which take
the values 0 to 9.
In digital computers the binary number system is used.
This has a base of 2 so that any positive integer can be
expressed as a series of powers of 2:
bn × 2n + bn−1 × 2n−1 + ... + bi × 2i + ... + b1 × 21 + b0 × 20
↑ MSB ↑ LSB
ANALOG TO DIGITAL CONVERTER
A. Successive Approximation Type:
•This method is widely used
because
1. It is fast in operation.
2. It has high resolution.
3. It is less expensive.

• The “clock” generates a


voltage, emitting a regular
sequence of pulses which
are counted, in a binary
manner and the resulting
binary word is converted
into an analog voltage by a
DAC.
•This voltage rises in steps
and is compared with the
analog input voltage from
ANALOG TO DIGITAL CONVERTER

When the clock generated voltage passes the


input analog voltage the pulses from the clock
are stopped from being counted by a “gate” being
closed. The output from the counter at that time
is then a digital representation of the analog
voltage.
If the frequency of the clock is f, the time taken
between the pulses is 1/f.
Then the conversion time is n/f.
Here ‘n’ is the number pulses to generate the word.
ANALOG TO DIGITAL CONVERTER
B. Ramp type:
Internally generated ramp voltage is
fed to two voltage comparators as
shown in the fig.
The ramp voltage may have a negative
or a positive going slope.
Let us consider a ramp voltage with
positive going slope.
When the input voltage is equal to the
ground voltage, the ground
comparator emits a start signal to a
gate which opens and permits the
passage of a clock from a crystal
oscillator to a digital counter.
When the ramp voltage is equal to the
level of the input voltage of the second
comparator it produces a signal to
close the gate and thus further count is
prevented.
The count, with suitable scaling, may
be made equal to magnitude of the
difference in the two input voltage
ANALOG TO DIGITAL CONVERTER
C. Dual slope type:

(a conversion cycle)
ANALOG TO DIGITAL CONVERTER
the reference voltage and the input analog voltage are sequentially
connected to the integrator with the help of a switch and must be of
opposite polarity.
The input voltage is integrated for a fixed input sample time. The
integrated value is then discharged at a fixed rate and the time to do
this is measured by a counter.
Two types of commands are given by the logic control to the counter
and they are:
1. Reset
2. Convert
When a convert command is received by the counter, it resets to all
zeros and the switch connects the input voltage to the integrator.
The output from the comparator is designed such that at this time it
will permit the counter to count up for a output from the integrator
will be steadily increasing in value.
On the next count after the converter has counted all the way upto all
1s , the switch changes position. The input voltage is disconnected
and the switch connects the reference voltage to the integrator.
Therefore the integrator now integrates the opposite polarity
voltage, which causes the output to decrease towards zero voltage.
ANALOG TO DIGITAL CONVERTER
When the output of the integrator goes to
zero, it causes the comparator to switch its
output, thereby stopping the counter via
control logic.
The binary number in the counter at this time
is proportional to the amount of time that it
took the integrator to integrate down from its
starting point to zero. Therefore the binary
count is proportional to input voltage.
Suppose T1=counts when the input voltage is
applied.
T2= counts when the reference voltage
is applied.
ANALOG TO DIGITAL CONVERTER
D. Flash or Parallel ADC:
• In any n-digit binary ADC there are Q
quantisation voltage levels V0 to VQ−1, where
Q = 2n .
• In a flash ADC there are Q − 1 comparators in
parallel and Q − 1 corresponding voltage
levels V1 to VQ−1.
• There is no need to provide the V0 voltage
level.
• In each comparator , the input sample value yi
is compared with the corresponding voltage
level Vq.
• If yi is less than or equal to Vq , the output is
zero corresponding to 0. If yi is greater than
Vq , the output is non-zero corresponding to a
1, i.e.
ANALOG TO DIGITAL CONVERTER

The comparators provide a Q − 1 digit parallel input


code to a priority encoder which generates an n-digit
binary parallel output code corresponding to the
value of q.
The main advantage of the flash converter is the
short conversion time;
The main disadvantage is that the large number of
comparators required to give acceptable resolution
mean that it is relatively expensive.
DIGITAL TO ANALOG CONVERTER

A DAC gives an analogue output voltage which is


proportional to an input parallel digital signal, e.g. an
8-bit binary signal b7 b6 ... b1b0.
Here we are using two methods to convert digital
signal to a proportional analog signal.
A. Binary weighted resistor network
B. R-2R ladder network
DIGITAL TO ANALOG CONVERTER
A. Binary weighted resistor
network

In this type of D/A converter, we have


to give LSB the least weight and MSB
the highest weight. (How)
V0(LSB)= - (RF/27R) Vi (less value)
V0(MSB)= - (RF/20R) Vi (high value)
WHY?
Because if digital number is 1101,
Disadvantage of this technique is, here a V0=20x1+21x0+22X1+23X1
very large range of resistance value is Here less weight is given to LSB and
required . That’s why R-2R ladder network high weight is given to MSB.
DIGITAL TO ANALOG CONVERTER
B. R-2R ladder
network

In this circuit, the required current


distribution is with only two values of
resistance R and 2R.
COMPUTER AND MICROCONTROLLER
SYSTEMS
A. The general computer system
COMPUTER AND MICROCONTROLLER
SYSTEMS
The system is made up of the following elements.
A. The microprocessor consists of three main parts. The control unit controls the
processing of instructions by providing the necessary control and timing signals.
The arithmetic logic unit carries out arithmetic operations such as addition and
subtraction and logic operations such as NOT, AND, OR. The register array is a
collection of registers required to temporarily store instructions, addresses and
data during the execution of an instruction.
• The read only memory (ROM) consists of a large number of permanent storage
elements, each specified by a unique address. Information can only be read from
ROM; no information can be written into ROM.
• Reading is an operation whereby a copy of a data word or instruction is
transferred from a given storage location to another device without changing the
contents of the store. Writing is an operation whereby a data word or instruction is
placed in a given storage location. Instructions are normally stored in ROM.
• The random access memory (RAM) consists of a large number of non permanent
storage elements, each specified by a unique address. Information can both be
read from and written into RAM. Both instructions and data can be stored in RAM..
COMPUTER AND MICROCONTROLLER
SYSTEMS
• The input/output interface consists of a number of
ports to which external devices can be physically
connected. The ports can be configured to accept input
data in parallel and/or serial format and output data in
parallel and/or serial format.
For example, data from an ADC can be received at the
parallel input port and data transmitted to a display or
printer at the parallel output port.
• The address bus has a one-way flow of information; the
microprocessor sends out address codes to memory
locations and input/output ports.
• The data bus has a two-way flow of information. Here,
for example, data is transferred from the input port or
RAM to the microprocessor, and instructions are
transferred from the ROM to the microprocessor. The
results of calculations or operations are transferred from
the microprocessor to RAM or the output port.
COMPUTER AND MICROCONTROLLER
SYSTEMS
• The control bus also has a two-way flow of information.
The microprocessor sends out enable and clock signals
to all elements in the system to achieve the coordination
and synchronization necessary for the above
information transfers to take place. It receives
information back on the status of each element.
• A small-scale computer system based on an 8-bit
microprocessor will correspondingly have an 8-bit data
bus. A 16-bit address bus will enable 216 = 65536
different locations to be addressed. A typical system
would have two 4 K ROMs, each capable of storing 4096
8-bit bytes, and two RAMs, each capable of storing 128
8-bit bytes.
COMPUTER AND MICROCONTROLLER
SYSTEMS
• The computer operates sequentially by executing a
series of steps. The timing of these steps is
determined by the clock. Each step is performed as
a result of an instruction. The sequence of
instructions is called a program.
• The first step in the execution of an instruction is for
the CPU to address the memory location in which the
instruction is stored. The instruction is then fetched
and decoded; any data required by the instruction is
also fetched.
• The instruction is then executed and the results of the
instruction are transferred to memory or an output
port.
• After completing the instruction the CPU moves on to
the next one.
COMPUTER AND MICROCONTROLLER
SYSTEMS
In a microcontroller the processor, memory and
input/output are all combined on a single chip.
Microcontrollers are widely used for signal processing
in measurement systems.
MICROCONTROLLER AND COMPUTER
SOFTWARE
A. Assembly language
for microcontrollers:
Microcontrollers are programmed in
assembly language. Here each
instruction is of the form
operator operand
The operator specifies the instruction
to be carried out and is defined by a
three to six-letter mnemonic called an
opcode. A typical microcontroller has
a set of about 35 instructions, which
are stored in EEPROM.

(Typical microcontroller instruction)


MICROCONTROLLER AND COMPUTER
SOFTWARE
The working register W is at the heart of the microcontroller CPU.
It is used to perform arithmetic and logic operations. This means that
data must first be transferred from a file register to W; the operation is
then performed in W and the result transferred from W to another
register.
The operand is either data or an address location. In an 8-bit
microcontroller the basic data or address word is eight bits or one byte
long; this is referred to as a file.
A single file can therefore cover the range of numbers 0 to 255 decimal,
0000 0000 to 1111 1111 binary or 00 to FF hexadecimal.
Typically there are 16 special-purpose registers, specified by the hex
addresses 00 to 0F. These include, for example, timer/counter, program
counter, status, file select, input and output port registers.
In addition there are typically 70 general-purpose registers, specified by
the hex addresses 10 to 55. These are within the RAM and are used to
store user data files; they are referred to as file registers or simply files.
To accommodate data numbers greater than 255, two 8-bit data files are
(Typical microcontroller program)

• A typical assembler program for a microcontroller is written above


•. The contents of file register 2C are transferred to the W register, the hex
number 1A is added to W, and the contents of W are then subtracted from the
contents of file register 2D. The final result is then transferred from W to a
reserved register with the name ‘result’
HIGHER-LEVEL LANGUAGES
Disadvantage of Assembly Language Programming:

Assembly language programs generally take less time


to execute and require less memory than those written
in other languages; they also support any type of input,
output and peripheral device
assembly programming is more difficult and several
lines of code are necessary to perform a simple
arithmetic operation.
Several types of error are possible in assembly
programming which are much less likely in a high-level
language
It is specific to one type of processor and is therefore
not portable to other microprocessors or
microcontrollers.
High-level languages have the following characteristics:
1. They include procedures: a procedure is a sequence of operations which defines
exactly how a task is to be performed.
2. The control of program flow is determined by the way the program is structured,
i.e. by the sequential ordering of operations or by explicit linkages between
them.
3. They include assignment statements; an assignment statement assigns a new
value to a variable, usually by computing the numerical value of an algebraic
expression specified in the statement. Examples are:
A=B+C
Y = 5.0 * sin T
Y = exp(−7.2 * X)
4. Several data types are possible; examples are integer, real and Boolean.
5. High-level languages are processor-independent and use a compiler to translate
the complete high-level language program into the assembly code for a given
processor.
6. They therefore require more memory (the compiler is itself a large program) and
take more time to execute.
7. However, high-level programs are easier to write and correct
BASIC is a very popular, easy-to-learn language. It began as an
interpreted rather than a compiled language. This means that it is
translated and executed statement by-statement, using a
program called an interpreter, instead of being fully translated
into machine code before execution.
IMPORTANT QUESTIONS
Long Answer
1. The binary-weighted digital-to-analog converter is required to give an output
voltage in the range of 0 to 2.55V, corresponding to an 8-bit digital input signal
00000000 to 11111111.
(a) Assuming Vref = -12V, R=2.2kΩ, calculate the value of Rf required.
(b) Find the output voltage corresponding to an input signal of 11010111.
An analogue-to-digital converter has an input range of 0 to 5 V and incorporates a
12-bit encoder.
(a) Assuming a binary encoder, find:
(i) the maximum percentage quantisation error;
(ii) the digital output signals corresponding to input voltages of 0.68 V
and 2.85V.
(b) Convert the binary codes of (a) (ii) into hexadecimal form.
(c) Repeat (a) assuming a three-decade, 8:4:2:1 binary-coded decimal (b.c.d.)
encoder.
2. An analogue-to-digital converter has an input range of 0 to 5 V and incorporates a
10-bit encoder.
(a) Assuming a binary encoder, find:
(i) the maximum percentage quantisation error;
(ii) the digital output signals corresponding to input voltages of 0.8 V
and 3.25V.
(b) Convert the binary codes of (a) (ii) into hexadecimal form.
(c) Repeat (a) assuming a three-decade, 8:4:2:1 binary-coded decimal (b.c.d.)
encoder.
Medium Answer:
1. Explain briefly the working of Successive Approximation A/D
Converter.
2. Explain briefly the working principle of Flash A/D Converter.

Short Answer:
1. Determine the Full-scale output in an 8-bit DAC for the 0-15v
range.
2. Why successive approximation method is widely used?
3. What is the necessity of an encoder in the A/D conversion
process?
4. What is quantisation? Explain.
5. Why sample hold circuit is required during A/D conversion?
6. Write down the reasons for the occurrence of aliasing.
7. What is aliasing? Explain.
8. Explain Nyquist Sampling Theorem.
Medium Answer
Short Answer

You might also like