Claims
- 1. A method for dividing a dividend by a divisor, wherein the magnitude of the divisor is an integer power of two, said method comprising:
adding the dividend to one half of the magnitude of the divisor, wherein the divisor is positive; adding a compliment of the dividend to one half of the magnitude of the divisor, wherein the divisor is negative, thereby resulting in a sum; and right-shifting the sum the integer number of times.
- 2. The method of claim 1, further comprising:
subtracting one from the sum, wherein the dividend is negative and the divisor is positive.
- 3. The method of claim 1, further comprising:
adding one to the sum, wherein the dividend is negative and the divisor is negative.
- 4. The method of claim 1, wherein right-shifting further comprises:
right-shifting a most significant bit of the sum into the sum, the integer number of times, wherein the sign of the divisor and the sign of the dividend are different; and right-shifting a zeroes into the sum, the integer number of times, wherein the sign of the divisor and the sign of the dividend are different.
- 5. The method of claim 1, wherein adding the dividend to one half of the magnitude of the divisor further comprises:
right-shifting the divisor one time; and setting one-half of the magnitude of the divisor to the rightmost x−1 bits of the right-shifted divisor.
- 6. A circuit for dividing a dividend by a divisor, wherein the magnitude of the divisor is an integer power of two, said circuit comprising:
a first switch for selecting the dividend or the compliment of the dividend; a second switch for selecting one half of the magnitude of the divisor or one half of the magnitude of the divisor minus one; an adder for adding the selection of the first switch and the selection of the second switch and outputting a sum; and a shift register for right shifting the sum from the adder the integer power of two times.
- 7. The circuit of claim 6, wherein the first switch selects the dividend if the sign bit of the divisor is zero and selects the compliment of the dividend if the sign bit of the divisor is one.
- 8. The circuit of claim 6, further comprising:
an exclusive OR gate for comparing the sign of the divisor and the sign of the dividend; and an AND gate for providing the product of an output of the exclusive-OR gate and a most significant bit of the sum.
- 9. A circuit for dividing a dividend by a divisor, wherein the magnitude of the divisor is an integer power of two, said circuit comprising:
a first switch for receiving the dividend and the compliment of the dividend; a second switch for receiving one half of the magnitude of the divisor and one half of the magnitude of the divisor minus one; an adder connected to the first switch and the second switch; and a shift register connected to the adder.
- 10. The circuit of claim 9, wherein the first switch receives the sign bit of the divisor and selects the dividend if the sign bit of the divisor is zero and selects the compliment of the dividend if the sign bit of the divisor is one.
- 11. The circuit of claim 9, further comprising an exclusive OR gate connected to the shift register.
- 12. An encoder for encoding data, said encoder comprising:
a discrete cosine transformation engine for transforming the data to the frequency domain; a quantizer for quantizing the data in the frequency domain; and memory for storing a plurality of instructions for dividing a dividend by a divisor, wherein the magnitude of the divisor is an integer power of two, the plurality of instructions further comprising:
adding the dividend to one half of the magnitude of the divisor, wherein the divisor is positive; adding a compliment of the dividend to one half of the magnitude of the divisor, wherein the divisor is negative, thereby resulting in a sum; and right-shifting the sum the integer number of times.
- 13. An encoder for encoding data, said encoder comprising:
a discrete cosine transformation engine for transforming the data to the frequency domain; a quantizer for quantizing the data in the frequency domain, the quantizer further comprising a circuit for dividing a dividend by a divisor, wherein the magnitude of the divisor is an integer power of two, the circuit comprising: a first switch for selecting the dividend or the compliment of the dividend; a second switch for selecting one half of the magnitude of the divisor or one half of the magnitude of the divisor minus one; an adder for adding the selection of the first switch and the selection of the second switch and outputting the sum; and a shift register for right shifting the sum from the adder the integer power of two times.
RELATED APPLICATIONS
[0001] The present application claims the priority benefit of U.S. Provisional Patent Application Serial No. 60/426,618, entitled “Algorithm for Division Coupled with Rounding of Signed Binary Numbers”, by Kishore et., al., filed Nov. 15, 2002, which is incorporated herein by reference for all purposes. The present application is also related to U.S. patent application Serial No. __/______, Attorney Docket Number 14143US02, entitled “System, Method, and Apparatus for Division Coupled with Truncation of Signed Binary Numbers”, by Kishore, et. al., filed ______, which is incorporated herein by reference for all purposes.
Provisional Applications (1)
|
Number |
Date |
Country |
|
60426618 |
Nov 2002 |
US |