Information Technology Reference
In-Depth Information
added to the bipolar analog signal in order to make it unipolar as in (b). The ADC produces positive-only numbers
in (c), but the MSB is then inverted in (d) to give a two's complement output.
The two's complement system allows two sample values to be added, or mixed in audio and video parlance, and
the result will be referred to the system midrange; this is analogous to adding analog signals in an operational
amplifier.
Figure 2.39 illustrates how adding two's complement samples simulates a bipolar mixing process. The waveform of
input A is depicted by solid black samples, and that of B by samples with a solid outline. The result of mixing is the
linear sum of the two waveforms obtained by adding pairs of sample values. The dashed lines depict the output
values. Beneath each set of samples is the calculation which will be seen to give the correct result. Note that the
calculations are pure binary. No special arithmetic is needed to handle two's complement numbers.
Figure 2.39: Using two's complement arithmetic, single values from two waveforms are added together with
respect to midrange to give a correct mixing function.
It is interesting to see why the two's complement adding process works. Effectively both two's complement
numbers to be added contain an offset of half full scale. When they are added, the two offsets add to produce a
sum offset which has a value of full scale. As adding full scale to a code consists of moving one full rotation round
the circle of numbers, the offset has no effect and is effectively eliminated.
It is sometimes necessary to phase reverse or invert a digital signal. The process of inversion in two's complement
is simple. All bits of the sample value are inverted to form the one's complement, and one is added. This can be
checked by mentally inverting some of the values in Figure 2.37 (b). The inversion is transparent and performing a
second inversion gives the original sample values. Using inversion, signal subtraction can be performed using only
adding logic.
Two's complement numbers can have a radix point and bits below it just as pure binary numbers can. It should,
however, be noted that in two's complement, if a radix point exists, numbers to the right of it are added. For
example, 1100.1 is not -4.5, it is -4 + 0.5 = -3.5.
The circuitry necessary for adding pure binary or two's complement binary numbers is shown in Figure 2.40 .
Addition in binary requires two bits to be taken at a time from the same position in each word, starting at the least
significant bit. Should both be ones, the output is zero, and there is a carry-out generated. Such a circuit is called a
half adder, shown in Figure 2.40 (a) and is suitable for the least significant bit of the calculation. All higher stages
will require a circuit which can accept a carry input as well as two data inputs. This is known as a full adder ( Figure
2.40 (b)).
Search WWH ::




Custom Search