Signal Operation Conversion - Course + Exercise
Signal Operation Conversion - Course + Exercise
Chapter 7
1
Chapter 6: Analog-to-Digital and Digital-to-Analog
• Sampling concept
• Shannon theorem
• Time to frequency domain analysis: Fourier Transform
• Quantization
• Analog to digital conversion
• Digital to Analog conversion
2 Electronics
Introduction
• Octal and Hex Numbers: It has become common to use either the
octal (base 8) or hexadecimal (base 16, called hex) representations.
3 Electronics
Introduction
• Boolean Algebra:
■ Let us consider a simple example of how a Boolean equation
may result from a practical problem
4 Electronics
Introduction
5 Electronics
Analog Signals versus Digital Signals
• Analog signals:
• Continuous with time
• Noise sensitive
• Cannot be manipulated by the computer
• Digital signals:
• Discrete with time
• Generally free from noise
• Can be manipulated by the computer.
• Cannot exactly represent or reconstruct analog signals
6 Electronics
Sampling
• The analog signal is converted to digital data at regular time
intervals and the digitized data are presented to the computer
• There are two processes involved in this conversion:
• Amplitude quantization
• Discrete-time sampling
• Quantizing the amplitude of continuous signal to digital data at
discrete times is referred to as sampling
Amplitude
Analog signal
quantization
8 Electronics
Shannon sampling theorem
• The Shannon sampling theorem relates the sampling rate and the
maximum frequency component present in the signal to completely
recover the original signal from its sampled data without the loss of
information: fs>2fmax
9 Electronics
Frequency Domain Signal Representation
• General description
• Aperiodic signal has Fourier transform
• Time domain: unrepeated ! Frequency domain: continuous
frequency components
• Periodic signal has Fourier series representation
• Time domain: repeated ! Frequency domain: discrete
frequency components
• Fourier transform and Fourier series both give
spectrum of the signal
10 Electronics
Review: Fourier transform
• Define:
| G ( f ) |: magnitude spectrum of g (t )
ang{G ( f )}: phase spectrum of g (t )
•
11 Electronics
Review: Fourier transform
1
FT {cos(2π f c t )} = [δ ( f − f c ) + δ ( f + f c ) ]
2
•
12 Electronics
Review: Impulse (Dirac Delta) function
⎧⎪δ (t ) = 0, for t ≠ 0
⎨ ∞
⎪⎩ ∫−∞ δ (t )dt = 1
13 Electronics
Frequency spectrum
• The frequency spectrum of the signals x(t), p(t) and xp(t) are
represented is the next slide
14 Electronics
Frequency spectrum
• The frequency spectrum of the signals x(t), p(t) and xp(t)
• From the spectrum frequency, the sampling frequency fs should be
greater than 2fH
fs − fH
−fs + fH
15 Electronics
Shannon theorem
16 Electronics
Analog-to-Digital Conversion
17 Electronics
Step 1: Quantizing
Output States Discrete Voltage Ranges (V)
0 0.00-1.25
Example: 1 1.25-2.50
You have 0-10V signals.
2 2.50-3.75
Separate them into a set
of discrete states with 3 3.75-5.00
1.25V increments. (How
did we get 1.25V? See 4 5.00-6.25
next slide…)
5 6.25-7.50
6 7.50-8.75
7 8.75-10.0
18 Electronics
Quantizing
• Example (cont.):
19 Electronics
Encoding
Output States Output Binary Equivalent
0 000
• Example (cont.): 1 001
6 110
7 111
20 Electronics
Accuracy of A/D Conversion
21 Electronics
Resolution
22 Electronics
Sampling Rate
23 Electronics
Example
24 Electronics
Analog to digital conversion
25 Electronics
Analog-to-Digital Converter Types
• Converters
• Flash ADC
• Successive Approximation ADC
26 Electronics
Flash ADC
27 Electronics
Flash ADC Circuit
• Flash ADCs are made by cascading high-speed
comparators.
• For an N-bit converter, the circuit employs 2N -1
comparators.
• A resistive-divider with 2N resistors provides the
reference voltage.
• Each comparator produces a 1 when its analog
input voltage is higher than the reference voltage
applied to it. Otherwise, the comparator output is 0. 3R
V3 = Vref = 3V1
∑R
• Thus, if the analog input is between VX4 and VX5, 2R
comparators X1 through X4 produce 1s and the V2 = Vref = 2V1
∑R
remaining comparators produce 0s. The point R
where the code changes from ones to zeros is the V1 = V
∑ R ref
point at which the input signal becomes smaller
than the respective comparator reference-voltage
levels.
28 Electronics
Flash ADC
• Advantages:
• Disadvantages:
• Lower resolution
• Expensive
• For each additional output bit, the number of comparators is doubled
• i.e. for 8 bits, 256 comparators needed
29 Electronics
Successive Approximation ADC
• A Successive Approximation Register (SAR) is added to the circuit
• Instead of counting up in binary sequence, this register counts by trying all
values of bits starting with the MSB (most significant bit) and finishing at the
LSB (least significant bit).
• The successive approximation Analog to digital converter circuit typically
consists of four chief subcircuits:
• A sample and hold circuit to acquire the input voltage (Vin).
• An analog voltage comparator that compares Vin to the output of the
internal DAC and outputs the result of the comparison to the successive
approximation register (SAR).
• A successive approximation register subcircuit designed to supply an approximate
digital code of Vin to the internal DAC.
• An internal reference DAC that, for comparison with V REF , supplies
the comparator with an analog voltage equal to the digital code output of the
SARin.
• The register monitors the comparators output to see if the binary count is
greater or less than the analog signal input and adjusts the bits accordingly
30 Electronics
Successive Approximation ADC Circuit
31 Electronics
Successive Approximation
• Advantages
• Disadvantages
32 Electronics
Digital-to-Analog converters
• Both data in the physical world and control signals sent to interact
with the physical world are typically "analog" or continuously
varying quantities.
33 Electronics
Data Collection and Control
34 Electronics
Digital-to-Analog converters
• In an electronic circuit, a combination of high voltage (+5V)
and low voltage (0V) is usually used to represent a binary
number. For example, a binary number 1010 is represented by
Weighting 23 22 21 20
Binary Digit 1 0 1 0
DACs are electronic circuits that convert digital, (usually binary) signals (for example,
1000100) to analog electrical quantities (usually voltage) directly related to the digitally
encoded input number.
35 Electronics
Digital-to-Analog converters
• DACs are used in many other applications, such as voice synthesizers,
automatic test system, and process control actuator. In addition, they allow
computers to communicate with the real (analog) world.
Input Binary
Number
Analog Voltage
Output
Resistive
Register
Summing Amplifier
Voltage Network
Switch
36 Electronics
Digital-to-Analog converters
37 Electronics
Digital-to-Analog Converter Types
38 Electronics
Weighted Sum DAC
39 Electronics
Binary Weighted Resistor
40 Electronics
Binary Weighted Resistor
Vref
2R I Rf
• Assume Ideal Op-amp
4R
- Vout
• No current into op-amp
+
2nR
• Vout= -IRf
41 Electronics
Binary Weighted Resistor
Vref
▪ Voltages V1 through Vn are either V1
R
Vref if corresponding bit is high or
ground if corresponding bit is low V2 2R I Rf
V3 4R
▪ V1 is most significant bit
- Vout
▪ Vn is least significant bit +
Vn 2n-1R
MSB
LSB
⎛ V1 V2 V3 Vn ⎞
Vout = − IRf = − Rf ⎜ + + + n -1 ⎟
⎝ R 2R 4R 2 R⎠
42 Electronics
Binary Weighted Resistor
If Rf=R/2
⎛ V1 V2 V3 Vn ⎞
Vout = − IRf = −⎜ + + + n ⎟
⎝2 4 8 2 ⎠
For example, a 4-Bit converter yields
⎛ 1 1 1 1⎞
Vout = −Vref ⎜ b3 + b2 + b1 + b0 ⎟
⎝ 2 4 8 16 ⎠
Where b3 corresponds to Bit-3, b2 to Bit-2, etc.
43 Electronics
Binary Weighted Resistor
• Advantages
• Simple Construction/Analysis
• Fast Conversion
• Disadvantages
• Requires large range of resistors (2000:1 for 12-bit
DAC) with necessary high precision for low
resistors
• Requires low switch resistances in transistors
• Can be expensive. Therefore, usually limited to 8-
bit resolution.
44 Electronics
R-2R Ladder
45 Electronics
R-2R Ladder
V3
Vref V1 V2 V3
Ideal Op-amp
2R 2R
Req =
(2 R )(2 R )
=R
(2 R + 2 R )
46 Electronics
R-2R Ladder
Vref V1 V2 V3 V2 V3
R R
⎛ R ⎞ 1
V3 = ⎜ ⎟V2 = V2
⎝ R+R⎠ 2
I
Likewise,
1
V2 = V1
Vout 2
1
V1 = Vref
2
Vout = − IR
47 Electronics
R-2R Ladder
Results:
Vref V1 V2 V3 1 1 1
V3 = Vref , V2 = Vref , V1 = Vref
8 4 2
48 Electronics
R-2R Ladder
⎛ 1 1 1 1⎞
Vout = −Vref ⎜ b3 + b2 + b1 + b0 ⎟
⎝ 2 4 8 16 ⎠
For general n-Bit R-2R Ladder or Binary Weighted Resister DAC
n
1
Vout = −Vref ∑ bn −i i
i =1 2
49 Electronics
R-2R Ladder
• Advantages
• Only two resistor values (R and 2R)
• Does not require high precision resistors
• Disadvantage
• Lower conversion speed than binary weighted DAC
50 Electronics
Some terms
51 Electronics
Successive Approximation Example
• 10 bit 1000000000
• Vin= 0.6 volts
• Vref=1volts
• Find the digital value of Vin
Vin=0.6V > Vout=Vref/2=0.5
b9=1
1100000000
Vin=0.6V < Vout=Vref/2+Vref/4=0.7
n
1 b8=0
V52out = −Vref ∑b n −i i Electronics
i =1 2
Successive Approximation
n
1
Vout = −Vref ∑b n −i i
i =1 2
• MSB (bit 9)
• Divided Vref by 2
• Compare Vref /2 with Vin
• If Vin is greater than Vref /2 , turn MSB on (1)
• If Vin is less than Vref /2 , turn MSB off (0)
• Vin =0.6V and V=0.5
• Since Vin>V, MSB = 1 (on)
53 Electronics
Successive Approximation
54 Electronics
Successive Approximation
55 Electronics
Successive Approximation
56 Electronics
V4 = 4.375V
Exercise 1
V7
V5 = 5.625V
• For the full range of analog
i n p u t o f 3 - b i t fl a s h V6 V6 = 6.875V
converter find comparator
and encoder outputs. The V5 V7 = 8.125V
range of operation is given
as 0-10 V.
V4
Vref R/2
V1 = = 0.625V V3
8R
Vref 3R/2 V2
V2 = = 1.875V
8R
V1
Vref 5R/2
V3 = = 3.125V
8R
57 Electronics
Exercise 1: solution
• For the full range of analog input of 3-bit flash converter find
comparator and encoder outputs. The range of operation is given
as 0-10 V.
Vin Range C1 C2 C3 C4 C5 C6 C7 D0 D1 D2
0-0.625 0 0 0 0 0 0 0 0 0 0
0.625-1.875 1 0 0 0 0 0 0 0 0 1
1.875-3.125 1 1 0 0 0 0 0 0 1 0
3.125-4.375 1 1 1 0 0 0 0 0 1 1
4.375-5.625 1 1 1 1 0 0 0 1 0 0
5.625-6.875 1 1 1 1 1 0 0 1 0 1
6.875-8.125 1 1 1 1 1 1 0 1 1 0
8.125-10 1 1 1 1 1 1 1 1 1 1
58 Electronics
Exercise 2
• Show the waveform of DAC output of a 3-bit successive
approximation ADC for an analog input of 6.5 V. the input range is
0-10 V Vref=10V
7.5
6.25
5
Electronics
Exercise 2
• Show the waveform of DAC output of a 3-bit successive
approximation ADC for an analog input of 6,5 V. the input range is
0-10 V
1 0 Electronics
1 Workbench Models
b2 b1 b0 4bitDAC.ewb
Vout = − RI
Vout = − Vref (1/2 + 1/8 + 1/16) = − 6.875V
I = 0.6875mA
62 Electronics
Exercise 5
• A 12-bit SAR ADC outputs binary code 1111 1111 1111 for an analog input of
10 V. Find its resolution.
range 12
res = = 10/2
2N
63 Electronics