22.09.2015 Views

of Microprocessors

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

222 MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

than eight different voltage levels as its output. With an ideal DAC, these<br />

eight levels would be equally spaced across the range <strong>of</strong> output voltages. If<br />

the output is to span the range <strong>of</strong> - 10 V to + 10 V, for example, these eight<br />

levels might be assigned as:<br />

Binary Analog Binary Analog<br />

000 -10.00 100 + 1.42<br />

001 - 7.14 101 + 4.29<br />

010 - 4.29 110 + 7.14<br />

011 - 1.42 111 +10.00<br />

Actually, since twos-complement binary inputs are usually desirable, the<br />

eight levels should probably be assigned instead as:<br />

000<br />

001<br />

010<br />

011<br />

+ 0.00<br />

+ 2.50<br />

+ 5.00<br />

+ 7.50<br />

100<br />

101<br />

110<br />

111<br />

-10.00<br />

- 7.50<br />

- 5.00<br />

- 2.50<br />

Unfortunately, neither assignment is ideal. The first has no code for<br />

a zero output and puts out rather odd voltages anyway. The second has a zero<br />

point and nice round levels but falls short <strong>of</strong> the full ± 1O-V range desired.<br />

Actually, practical DACs have considerably more resolution than this example<br />

so that last missing level on the positive side is generally <strong>of</strong> no consequence.<br />

Using the twos-complement assignment, the resolution <strong>of</strong> this 3-bit<br />

DAC would be a very coarse 2.5 V. The maximum error in converting an<br />

arbitrary number (with rounding) to a voltage would be only half <strong>of</strong> this or<br />

1.25 V.<br />

Moving up to an 8-bit DAC improves things considerably. The<br />

resolution now would be 20/(2""-1) or 0.078 V. The largest negative output<br />

would still be - 10 V, but the positive limit would be one step short <strong>of</strong><br />

+ 10.0 or +9.922 V. Even with 8 bits, the step size <strong>of</strong>0.078 V controlling a<br />

voltage-controlled oscillator with a sensitivity <strong>of</strong> one octave per volt would<br />

yield a pitch step size <strong>of</strong> about one semitone. A 12-bit DAC would have a<br />

step size <strong>of</strong> 0.00488 V, which would give a nearly inaudible 1/17 semitone<br />

increment. Even higher resolutions are available, but the expense would<br />

limit extensive use.<br />

Usually it is convenient to consider the binary input to a DAC as being<br />

a signed binary fraction between -1.000 ... and +0.9999 .... The<br />

output voltage <strong>of</strong> the DAC then is the binary fraction (rounded or truncated<br />

to the DAC's resolution) times 10 V. This representation has the advantage<br />

that calculations leading up to the value to be converted are not affected by<br />

the actual resolution <strong>of</strong> the DAC used. For example, if a 16-bit computer is<br />

being used, it would be convenient to perform all calculations using 16-bit<br />

fractional arithmetic. (Fractional arithmetic is really the same as integer

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!