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.

MUSIC SYNTHESIS SOFTWARE 651<br />

operands. This means that the number <strong>of</strong> fraction bits in the product is<br />

the sum <strong>of</strong> the number <strong>of</strong> fraction bits in the operands.<br />

From the foregoing we can conclude that if the operands are <strong>of</strong> equal<br />

length, the result length is twice as great. Actually, it is one bit shorter when<br />

both operands are signed (provided that largest negative numbers are<br />

avoided). It is also easy to see that when both operands are fractions that the<br />

range <strong>of</strong> the result is unchanged, although the resolution is increased. Thus,<br />

fractional arithmetic is attractive because a chain <strong>of</strong> multiplications will not<br />

increase the range <strong>of</strong> numbers to be handled. Note that, if both operands are<br />

signed binary fractions, the binary point in the result will be two positions to<br />

the right <strong>of</strong> the sign bit <strong>of</strong> the result, that is, the sign bit will be duplicated.<br />

Thus, one would normally shift the double-length fractional product left one<br />

position before using it.<br />

One may be tempted to conclude that the excess resolution that may<br />

result can always be discarded without any loss <strong>of</strong> significant data. This is not<br />

generally true if one <strong>of</strong> the factors is small. SiN ratio will be lost if the excess<br />

resolution is discarded in such a situation, but the absolute noise level<br />

relative to full scale will remain constant. Ideally, multiplication and other<br />

arithmetic operations are done with word lengths longer than the initial<br />

input samples or final output samples in order to eliminate "computational<br />

noise" from the results. Of course, this must be tempered by a possible<br />

increase in computation time, particularly when using machines like the<br />

6502.<br />

Division<br />

Division is by far the most difficult fixed-point arithmetic operation to<br />

control. Fortunately, it is not needed very <strong>of</strong>ten in signal-processing work<br />

and in many <strong>of</strong> the remaining cases it can still be eliminated. Division<br />

operands must be carefully distinguished. The numerator is called the dil!idend<br />

and the denominator is called the divisor. Like multiplication, there is<br />

no restriction on the position <strong>of</strong> the operands' binary points, although there<br />

is definitely a practical restriction. Unlike multiplication, nothing concrete<br />

can be said in general about the range and resolution <strong>of</strong> a division result. This<br />

should be obvious, since division by very small numbers gives rise to a very<br />

large quotient, while for most operands there is no limit to how far the<br />

fractional part <strong>of</strong> the quotient can be carried.<br />

Fixed-point binary division is customarily done with a dividend word<br />

length precisely double the divisor word length. The quotient is restricted to<br />

a word length equal to the divisor. With these restrictions, the rules <strong>of</strong><br />

binary division are as follows:<br />

1. The upper half <strong>of</strong> the dividend must be numerically smaller than the<br />

numerical value <strong>of</strong> the divisor to avoid overflow.

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

Saved successfully!

Ooh no, something went wrong!