Dueck R.Digital design with CPLD applications and VHDL.2000
.pdf
566 |
C H A P T E R 1 2 • Interfacing Analog and Digital Circuits |
Electronic circuits and signals can be divided into two main categories: analog and digital. Analog signals can vary continuously throughout a defined range. Digital signals
take on specific values only, each usually described by a binary number.
Many phenomena in the world around us are analog in nature. Sound, light, heat, position, velocity, acceleration, time, weight, and volume are all analog quantities. Each of these can be represented by a voltage or current in an electronic circuit. This voltage or current is a copy, or analog, of the sound, velocity, or whatever.
We can also represent these physical properties digitally, that is, as a series of numbers, each describing an aspect of the property, such as its magnitude at a particular time. To translate between the physical world and a digital circuit, we must be able to convert analog signals to digital and vice versa.
We will begin by examining some of the factors involved in the conversion between analog and digital signals, including sampling rate, resolution, range, and quantization.
We will then examine circuits for converting digital signals to analog, since these have a fairly standard form. Analog-to-digital conversion has no standard method. We will study several of the most popular: simultaneous (flash) conversion, successive approximation, and dual slope (integrating) conversion.
12.1 Analog and Digital Signals
K E Y T E R M S
Continuous Smoothly connected. An unbroken series of consecutive values with no instantaneous changes.
Discrete Separated into distinct segments or pieces. A series of discontinuous values.
Analog A way of representing some physical quantity, such as temperature or velocity, by a proportional continuous voltage or current. An analog voltage or current can have any value within a defined range.
Digital A way of representing a physical quantity by a series of binary numbers.
A digital representation can have only specific discrete values.
Analog-to-digital converter A circuit that converts an analog signal at its input to a digital code. (Also called an A-to-D converter, A/D converter, or ADC.)
Digital-to-analog converter A circuit that converts a digital code at its input to an analog voltage or current. (Also called a D-to-A converter, D/A converter, or DAC.)
Electronic circuits are tools to measure and change our environment. Measurement instruments tell us about the physical properties of objects around us. They answer questions such as “How hot is this water?”, “How fast is this car going?”, and “How many electrons are flowing past this point per second?” These data can correspond to voltages and currents in electronic instruments.
If the internal voltage of an instrument is directly proportional to the quantity being measured, with no breaks in the proportional function, we say that it is an analog voltage. Like the property being measured, the voltage can vary continuously throughout a defined range.
For example, sound waves are continuous movements in the air. We can plot these movements mathematically as a sum of sine waves of various frequencies. The patterns of magnetic domains on an audio tape are analogous to the sound waves that produce them and electromagnetically represent the same mathematical functions. When the tape is played, the playback head produces a voltage that is also proportional to the original sound waves. This analog audio voltage can be any value between the maximum and minimum voltages of the audio system amplifier.
12.1 • Analog and Digital Signals |
567 |
If an instrument represents a measured quantity as a series of binary numbers, the representation is digital. Since the binary numbers in a circuit necessarily have a fixed number of bits, the instrument can represent the measured quantities only as having specific discrete values.
A compact disc stores a record of sound waves as a series of binary numbers. Each number represents the amplitude of the sound at a particular time. These numbers are decoded and translated into analog sound waves upon playback. The values of the stored numbers (the encoded sound information) are limited by the number of bits in each stored digital “word.”
The main advantage of a digital representation is that it is not subject to the same distortions as an analog signal. Nonideal properties of analog circuits, such as stray inductance and capacitance, amplification limits, and unwanted phase shifts, all degrade an analog signal. Storage techniques, such as magnetic tape, can also introduce distortion due to the nonlinearity of the recording medium.
Digital signals, on the other hand, do not depend on the shape of a waveform to preserve the encoded information. All that is required is to maintain the integrity of the logic HIGHs and LOWs of the digital signal. Digital information can be easily moved around in a circuit and stored in a latch or on some magnetic or optical medium. When the information is required in analog form, the analog quantity is reproduced as a new copy every time it is needed. Each copy is as good as any previous one. Distortions are not introduced between copy generations, as is the case with analog copying techniques, unless the constituent bits themselves are changed.
Digital circuits give us a good way of measuring and evaluating the physical world, with many advantages over analog methods. However, most properties of the physical world are analog. How do we bridge the gap?
We can make these translations with two classes of circuits. An analog-to-digital converter accepts an analog voltage or current at its input and produces a corresponding digital code. A digital-to-analog converter generates a unique analog voltage or current for every combination of bits at its inputs.
Sampling an Analog Voltage
K E Y T E R M S
Sample An instantaneous measurement of an analog voltage, taken at regular intervals.
Sampling frequency The number of samples taken per unit time of an analog signal.
Quantization The number of bits used to represent an analog voltage as a digital number.
Resolution The difference in analog voltage corresponding to two adjacent digital codes. Analog step size.
Before we examine actual D/A and A/D converter circuits, we need to look at some of the theoretical issues behind the conversion process. We will look at the concept of sampling an analog signal and discover how the sampling frequency affects the accuracy of the digital representation. We will also examine quantization, or the number of bits in the digital representation of the analog sample, and its effect on the quality of a digital signal.
Figure 12.1 shows a circuit that converts an analog signal (a sine pulse) to a series of 4-bit digital codes, then back to an analog output. The analog input and output voltages are shown on the two graphs.
There are two main reasons why the output is not a very good copy of the input. First, the number of bits in the digital representation is too low. Second, the input signal is not
568 |
C H A P T E R 1 2 • Interfacing Analog and Digital Circuits |
|
|
|
|
|
|
|
FIGURE 12.1
Analog Input and Output Signals
sampled frequently enough. To help us understand the effect of each of these factors, let us examine the conversion process in more detail.
The analog input signal varies between 0 and 8 volts. This is evenly divided into 16 ranges, each corresponding to a 4-bit digital code (0000 to 1111). We say that the signal is quantized into 4 bits. The resolution, or analog step size, for a 4-bit quantization is 8 V/16 steps 0.5 V/step. Table 12.1 shows the codes for each analog range.
Table 12.1 4-bit Digital Codes for 0 to 8 V Analog Range
Analog Voltage |
Digital Code |
|
|
0.00–0.25 |
0000 |
0.25–0.75 |
0001 |
0.75–1.25 |
0010 |
1.25–1.75 |
0011 |
1.75–2.25 |
0100 |
2.25–2.75 |
0101 |
2.75–3.25 |
0110 |
3.25–3.75 |
0111 |
3.75–4.25 |
1000 |
4.25–4.75 |
1001 |
4.75–5.25 |
1010 |
5.25–5.75 |
1011 |
5.75–6.25 |
1100 |
6.25–6.75 |
1101 |
6.75–7.25 |
1110 |
7.25–8.00 |
1111 |
|
|
