Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
108 views

Class14 Data Conversion

The document discusses data conversion between analog and digital formats. It aims to understand A/D and D/A conversion. It explains that analog quantities are continuous while digital quantities are discrete. It then compares analog and digital signals, representations, technologies, applications and limitations. It discusses sampling and filtering of analog signals to convert them to digital, including the need for anti-aliasing filters and sample-and-hold circuits.

Uploaded by

Hussain Yawari
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views

Class14 Data Conversion

The document discusses data conversion between analog and digital formats. It aims to understand A/D and D/A conversion. It explains that analog quantities are continuous while digital quantities are discrete. It then compares analog and digital signals, representations, technologies, applications and limitations. It discusses sampling and filtering of analog signals to convert them to digital, including the need for anti-aliasing filters and sample-and-hold circuits.

Uploaded by

Hussain Yawari
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 59

Data Conversion

Objectives
• Know the difference between analogue and digital data

• Understand the operation of A to D Convertors

• Understand the operation of D to A convertors


Digital and Analog Quantities

• Analogue quantities have continuous values

• Digital quantities have discrete sets of values

3
Digital and Analogue
Quantities

Analogue quantities have


continuous values
Most natural quantities that we Digital quantities have
see are analogue and vary discrete sets of values
continuously. Analogue systems Digital systems can
can generally handle higher process, store, and
power than digital systems. transmit data more
efficiently but can only
assign discrete values to
each point 4
Comparisons Analogue Digital

Analogue signal is a continuous signal which represents Digital signals are discrete time signals generated by digital
Signal physical measurements. modulation.

Waves Denoted by sine waves Denoted by square waves

Uses discrete or discontinuous values to represent


Representation Uses continuous range of values to represent information information

Example Human voice in air, analogue electronic devices. Computers, CDs, DVDs, and other digital electronic devices.

Samples analogue waveforms into a limited set of numbers


Technology Analogue technology records waveforms as they are.
and records them.

Data transmissions Subjected to deterioration by noise during transmission and Can be noise-immune without deterioration during
write/read cycle. transmission and write/read cycle.

Response to Noise More likely to get affected reducing accuracy Less affected since noise response are analogue in nature

Flexibility Analog hardware is not flexible. Digital hardware is flexible in implementation.

Uses Can be used in analog devices only. Best suited for audio Best suited for Computing and digital electronics.
and video transmission.
Comparisons
Applications Thermometer PCs, PDAs

There is no guarantee that digital signal processing


Bandwidth Analogue signal processing can be done in real time can be done in real time and consumes more
and consumes less bandwidth.
bandwidth to carry out the same information.

Memory Stored in the form of wave signal Stored in the form of binary bit

Power Analogue instrument draws large power Digital instrument draws only negligible power

Cost Cost is high and not easily portable Low cost and portable
Impedance Low High order of 100 MΩ

Analogue instruments usually have a scale which is Digital instruments are free from observational
Errors cramped at lower end and give considerable
errors like parallax and approximation errors.
observational errors. (Log Scale)
Digital and Analog Systems
Many systems use a mix of analog and digital electronics to take advantage of each
technology. A typical CD player accepts digital data from the CD drive and converts
it to an analog signal for amplification.

CD drive

10110011101 Digital-to-analog Linear amplifier


Digital data converter Analog
reproduction
of music audio Speaker
signal
Sound
waves

7
Advantage of Digital Techniques

• Digital systems are easier to design


• Information storage more compact
• Accuracy and precision are greater
• Operation can be programmed
• Digital circuits are less affected by noise
• Groups of numbers can be compressed by finding patterns

8
Limitations of Digital Systems
• The real world is mainly analogue

• Have no natural representation of time

• All continuous variables must be represented by a finite string of


discrete symbols
• Quantisation errors

• Single bit errors can corrupt entire data stream


9
Digital Systems
To take advantage of digital techniques when dealing with
analogue inputs and outputs, 3 steps must be followed:

• Convert the “real-world” analogue inputs to digital form


• Process (operate on) the digital information
• Convert the digital outputs back to real-world analogue
form

10
Sampling and Filtering
• The two main circuits concerned with
sampling are:
• Anti-Aliasing Analog
input Sampling
signal circuit
• Sample-and-Hold
Sampling
pulses

• Sampling is the process of taking a


sufficient number of points to be able
to recreate the original waveform Sampled
version of
input signal
Sampling
• Most input signals into an electronic
system start out as analogue signals Analog
input Sampling
circuit
signal

• For processing the signal is normally


Sampling

converted to a digital signal by sampling pulses

• This is done by taking sufficient number


of discrete values at points on a
waveform sufficient to be able to define Sampled
version of
input signal
the waveform
• This is determined by the Nyquist The sampling frequency should be at least twice the
Theorem highest frequency contained in the signal
Example
• Consider a signal, a sine wave at 1Hz

• If we sample the waveform at 2Hz we can


recreate the waveform
Example
• If, however, we capture at a rate less
than 2Hz, say 1.5Hz, then we do not
have enough samples to accurately
capture the waveform

• In this case, not only do we lose


information, but we get the wrong
information giving us a different
waveform
Harmonics
• What is an harmonic?

• Any waveform, other than a perfect sine wave,


contain energy at the fundamental frequency
and at integer multiples of this frequency
(Fourier Theorem)

• If the fundamental frequency of a signal is f Hz


• This signal also contains frequencies at 2f Hz, 3f
Hz, 4f Hz……..
Aliasing
• These harmonics can ‘bleed’ into the sampling of the fundamental signal and
cause unwanted sampling errors.

• An alias signal has a frequency less than the highest frequency being sampled
and so will fall into the spectrum of the input signal

• This signal is ‘posing’ as a part of the input analogue signal, so called an alias

• Very common on film where a propeller will rotate faster than the Nyquist
rate for the film (your brain interprets this as the propeller moving backwards)
Anti-Aliasing Filter
• To avoid aliasing, two methods can be used:
• Increase sampling rate
• There is a physical limit to how much this can
be done and is defined by the ADC

• Cut off all frequencies above the minimum


sampling frequency
• Anti-Aliasing Filter

• This is performed, on its simplest level, by using


a LPF with a cut-off less than half the sample
rate
Example
• A CD normally samples signals at 44.1kHz. What should the cut off
frequency of the anti aliasing filter be?

• Solution

• This is above the 20kHz limitation of the human ear


Holding the sampled value
• The second part of the sample-
and hold circuitry

• After filtering and sampling, the


sample level must be held
constant until the next sample
occurs

• This is necessary to allow the ADC


time to process the sampled value
ADC – Analogue to Digital
Conversion
• This is the process of converting the output of the sample-and-hold
circuit to a series of binary codes
Samples held for
one clock pulse

0100 0101 1100 1010


ADC

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Basic sample and
hold circuit
Quantisation
• The process of converting an analogue value to a digital code is called
quantisation

• During the quantisation process the ADC converts each sampled value
to a binary code

• The more bits used, the more accurate the representation


Example
Quantisation using 4 Sample Interval Quantisation
Level
Code

levels (2-bits) 1 0 00
Sample and Hold Output waveform 2 1 01
3 2 10
4 1 01
5 1 01
6 1 01
7 1 01
8 2 10
9 3 11
10 3 11
11 3 11
12 3 11
13 3 11
Example Quantisation using 4 levels
(2-bits)
Sample and Hold Output waveform Reconstructed waveform
Example
Quantisation using 16 Sample Interval Quantisation
Level
Code

level (4-bits) 1 0 0000


Sample and Hold Output waveform 2 5 0101
3 8 1000
4 7 0111
5 5 0101
6 4 0100
7 6 0110
8 10 1010
9 14 1110
10 15 1111
11 15 1111
12 15 1111
13 14 1110
Example Quantisation using 16level
(4-bits)
Sample and Hold Output waveform Reconstructed waveform
Quantisation Error
•• This is the difference between the digitised signal step and the original signal

• This error can be reduced by increasing the number of steps so increasing the resolution
• The smallest change in analogue signal that will result in a change in digital output

• ΔV is the resolution, Vr the reference voltage range, N the number of bits and 2N the number of states

• Often it is measured as a percentage


• Example
• A 4-bit convertor has 24 or 16 steps
• This gives a quantisation error of
Staircase A/D convertor

• This is the simplest of all the ADCs and is based on a binary counter

• Counter counts up to a value that just exceeds the input signal value

• Uses a DAC to provide a comparison voltage

• Uses an Op-Amp as a comparator which issues a signal telling the


counter to stop
How it works
• Conversion starts with the counter cleared
• Output of DAC is 0 so comparator issues signal to enable the counter
• Count continues while the analogue input is greater than the voltage
at negative input
• Counter increments each clock cycle
• When the output of the DAC is greater than the input signal
• Comparator issues a signal to stop the counter and the binary code is read
How it works
• This method of A/D conversion is
slow

• Takes 2n clock cycles for an n-bit


converter
• The counter always starts from 0 and
counts up to the input voltage level
Example
•• A ramp convertor has the following values

• Whereis the clock frequency and is comparator threshold

• Find
a. The digital equivalent obtained for
b. The conversion time
c. The resolution of the convertor
Solution
•• DAC has a 10-bit input and a full scale output
• Total number of steps is
• Step size is

• so the output from the DAC has to go to before the comparator switches LOW and stop counting
• Requires

• The binary equivalent of


• Conversion time

• Resolution is the step size of the


• As a percentage =
Successive Approximation Converter
- SAC
• This convertor is faster than the Ramp converter

• It operates by comparing the input to the output from the DAC

• Has a fixed conversion time regardless of the value of the input voltage

• The circuit consists of a comparator, a DAC and a programmable


register called a SAR
• Shift Approximation Register
How it works Vout
DAC

• The inputs to the DAC are enabled (made equal D0


D1 Parallel
to 1) one at a time starting with the MSB Comparator D2
binary
– output
• This is half full scale, i.e. if the full scale is 15V MSBInput
= + D3
signal (MSB) (LSB)
23
D Serial
SAR
• The DAC output is compared to the input binary
output
C
voltage
• If it is greater than the input voltage the bit is RESET
• If it is less, the bit is kept
• The next most significant bit is then checked
How it works
Example
• Consider a 4-bit SAC arranged to digitise inputs in the range 0-15V
• What is the binary value of 11.2V
Solution
• On the first clock cycle
• MSB B3 is set to 1. This provides an output voltage of 8V
• This is less than Vin so B3 is kept; B3=1

• The next bit B2 is SET; this corresponds to 4V


• Vout is now 12V
• This is greater than Vin so B2 is RESET; B2=0

• B1 is SET; this corresponds to 2V


• Vout = 10V
• This is less than Vin so B1 is kept; B1=1

• B0 is SET; this corresponds to 1V


• Vout = 11V
• This is less than Vin so B0 is kept; B0=1

• The binary code is 1011


Question Vin
Vax
• The block diagram for a 6-bit 1.92V
SAC is shown with a step size
of 40mV during a complete Vax
1.28V
conversion cycle.
• Examine the waveform and
describe what is occurring at
times t0 to t5.
0V
• Determine the output code
and the value of Vax at the t0 t1 t2 t3 t4 t5

end of the conversion Vax


Solution
•• 6-bit DAC so bits are B5 to B0
• This is less than Vin so MSB is kept;
• This is half the full scale so the full scale is 1.28*2=2.56V

• ; This corresponds to 0.64V; ; This is greater than Vin; is RESET;


• is SET; This corresponds to 0.32V; ; This is greater than Vin; is RESET;
• ; This corresponds to 0.16V; ; This is less than Vin; is kept;
• is SET; This corresponds to 0.08V; ; This is greater than Vin; is RESET;
• is SET; This corresponds to 0.04V; ; This is less than Vin; is kept;

• The output code is 1001012


• This equals 3710
Flash Converter
• The last ADC to be looked at is the flash converter R
+VREF
Op-amp
comparators

• This uses high speed comparators to compare the Input from


sample-
and-hold
+

reference voltages with the analogue input voltages R +



Priority
encoder

• It uses an individual comparator for each conversion


R +
6

5

step
R 1 D0 Parallel
+ 4
2 D 1 binary
– 3 output
4 D2
2
R

• This form of ADC is very fast but requires 2n-1


+ 1
– 0 EN

comparators
R
+

R
+
Enable
– pulses

• A 16-bit comparator would require 65535


comparators
DAC
• The DAC performs the opposite operation to an ADC
• It takes a digital input and provides an analogue output

• One method of achieving this is to use a resistor network

• This uses a number of binary weighted resistors; resistance values


that represent the binary weights of the input values
Binary weighted input DAC LSB
D0
8R
Rf
+ –
I0
4R If
• This requires very accurate resistors D1
I1 –
2R
• The input current in each resistor is proportional to D 2 I=0
+
I2 Analog
the binary weight D
R output
3

• Each resistor will have current or no current MSB I3

depending on the input voltage level


• If the input is a logic 0 there will be no current
• If the input is a logic 1 current will flow through the
resistor.

• It requires an identical HIGH on each resistor


How it works
• The summing amp has a transfer function of

• Since there is no current drop into the op amp, all the input currents
are summed together and flow through
• As the ‘–ve’ input is at virtual ground

• The resistor values are chosen to be inversely proportional to the


binary weights of the input bits
• The lowest value resistor corresponds to the MSB
How it works
• As a result the input currents are proportional to the binary weights

• The output voltage is now proportional to the sum of the binary


weights

• Disadvantage of the type of DAC is


• The number of resistors required
• The voltage levels must be exactly the same for each input
• The resistors must have very low tolerances ~ 0.5%
Example
• The DAC shown has a binary input of 1101. If a HIGH=+3.0V and a
LOW=0V, what is Vout? 120 kW
R
+3.0 V f

60 kW 10 kW
0V
• Solution 30 kW

+3.0 V Vout
+
15 kW
+3.0 V
Example
• The reference voltage of a DAC is 10V. If the DAC has 8 input bits
calculate the voltages represented by

• Solution
Inputs
D0 D1 D2 D3

R/2R DAC R1
2R
R3
2R
R5
2R
R7
2R
Rf = 2R

R2 R4 R6 R8

2R R R R Vout
+

•• The previous DAC requires the use of many precise value resistors
• This is difficult and expensive to build
• An alternative is to build a ladder circuit using only two value resistors
• By calculating the Thevenin equivalent circuit for each input you can show that the
output is proportional to the binary weights of the inputs that are HIGH

• Vs is the input voltage level


• n the number of bits
• i the bit number
Thevenin Theorem
• Thevenin’s Theorem states:
• Any combination of batteries and resistances can be replaced by a single
voltage source e and a single resistance r.
• The value of e is the open circuit voltage at the terminals and the value of r is
e divided
R2 does not affect the by the short circuit current
voltage and R1 and R3
form a voltage divider
How it works
• When D3 is HIGH (+5V) representing 1000
• • No current flows through
• All the current () flows through and the output voltage

• When D2 is HIGH representing 0100


• From Thevenin – we get a source in series with
• The current is now ();

• When D1 is HIGH representing 0010


• From Thevenin – we get a source in series with
• The current is now ();

• When D0 is HIGH representing 0001


• From Thevenin – we get a source in series with
• The current is now ();
• Each successive step drops the output voltage by half – Vout is proportional to the binary weight of the input bits
R/2R DAC
R/2R DAC
Question
• An R-2R ladder has a binary output of 1011. If a HIGH =+5V and a
LOW=0V, What is Vout
Solution
• Apply to all HIGH inputs and sum the result
DAC Jargon
•• Full scale Output
• Max current or voltage that can be outputted by a device
• A DAC produces a full scale output voltage when the digital input is all 1’s

• Resolution
• The number of discrete steps in the output
• This is dependant on the number of inputs; a 4-bit DAC will have a resolution of

• Conversion Time
• The time that elapses from the ‘start conversion’ command to the analogue voltage
appearing at the output
DAC Jargon
• Linearity
• Specified as the maximum deviation of the DAC output from a straight line
output passing through zero and the full scale output

• Absolute Accuracy
• This is the largest difference between the actual output voltage and the
ideal output voltage predicted
• Quoted as a percentage of the full scale range or as a percentage of the LSB

• Differential Linearity Error


• The step size is more or less than is the ideal step size
DAC Jargon
•• Monotonicity
• This is the relationship between the analogue signal and
the digital number
• A DAC is monotonic if an increase in the input digital
word always results in an increase in the output

• Settling Time
• When an input is applied to the DAC it can take from ns
to μs to produce a correct output
• Defined as the time taken for the convertor output to
stabilise to within
• This puts a limit on how fast the digital input can change
DAC Jargon
• Relative Accuracy
• How close each output level is to its ideal fraction of the full
scale output

• Gain Error
• This is an amplitude mismatch between the analogue signal
and the DAC
• Too high and the DAC saturates for high codes
• Too low and DAC accuracy is compromised
• Adjusted by a gain control during calibration
Testing a DAC
Additional Circuitry
• The DACs shown are called free running DACs
• As soon as the digital input changes the analogue output is converted
• Additional circuitry can be added to make it more flexible
• Latch
• Addition of a data latch on the input could allow the digital data to be chosen
from a shared bus
• This is typical of a DAC in a microprocessor controlled system
• The D FFs would not be edge triggered – this allows the DAC to be in free
running mode
Additional Circuitry
• Level Amplifier
• The output of a latch is not
predictable enough to use
directly for a DAC
• HIGH can be anywhere from
2.4V to 5V and a LOW is
anything less than 0.8V

• The addition of a level amplifier


ensures that the data inputs to
the DAC are at precise voltages

You might also like