Class14 Data Conversion
Class14 Data Conversion
Objectives
• Know the difference between analogue and digital data
3
Digital and Analogue
Quantities
Analogue signal is a continuous signal which represents Digital signals are discrete time signals generated by digital
Signal physical measurements. modulation.
Example Human voice in air, analogue electronic devices. Computers, CDs, DVDs, and other digital electronic devices.
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
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
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
7
Advantage of Digital Techniques
8
Limitations of Digital Systems
• The real world is mainly analogue
10
Sampling and Filtering
• The two main circuits concerned with
sampling are:
• Anti-Aliasing Analog
input Sampling
signal circuit
• Sample-and-Hold
Sampling
pulses
• 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
• Solution
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
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
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
• 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
• 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
• 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
• Has a fixed conversion time regardless of the value of the input voltage
step
R 1 D0 Parallel
+ 4
2 D 1 binary
– 3 output
4 D2
2
R
comparators
R
+
–
R
+
Enable
– pulses
• 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
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
• 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
• 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