Файл: Digital design with CPLD applications and VHDL (R. Dueck, 2000).pdf
ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 13.06.2025
Просмотров: 8185
Скачиваний: 6
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 |
570 |
C H A P T E R 1 2 • Interfacing Analog and Digital Circuits |
||||
FIGURE 12.2
Effect of Quantization
codes and back to analog, as in Figure 12.1. The graphs show the analog input and three analog outputs, each of which has been sampled 28 times per cycle, but with different quantizations. The corresponding digital codes range from a maximum negative value of n 0s to a maximum positive value of n 1s for an n-bit quantization (e.g., for a 4-bit quantization, maximum negative 0000, maximum positive 1111).
The first output signal has an infinite number of bits in its quantization. Even the smallest analog change between samples has a unique code. This ideal case is not attainable, since a digital circuit always has a finite number of bits. We can see from the codes in Table 12.3 that an 8-bit quantization is sufficient to give unique codes for this waveform. An infinite quantization implies that the resolution is small enough that each sampled voltage can be represented, not only by a unique code, but as its exact value rather than a point within a range.
The 4-bit and 3-bit quantizations in the next two graphs show progressively worse representation of the original signal, especially at the peaks. The change in analog voltage is too small for each sample to have a unique code at these low quantizations.
Figure 12.3 shows how the digital representation of a signal can be improved by increasing its sampling frequency. It shows an analog signal and three analog waveforms resulting from an analog-digital-analog conversion. All waveforms have infinite quantization, but different numbers of samples in the analog-to-digital conversion. As the number of samples decreases, the output waveform becomes a poorer copy of the input.
In general, the sampling frequency affects the horizontal resolution of the digitized waveform and the quantization affects the vertical resolution.