US 20060282489 A1 Abstract The present invention relates to digital signal processors with an integrated module configured to compute a Coordinate Rotation Digital Computer (CORDIC) in a pipeline. The pipelined module can advantageously complete computation of one CORDIC computation for each clock pulse applied to the CORDIC module, thereby providing a CORDIC computation for each clock pulse. One embodiment advantageously computes a first portion of a computation with a lookup table and a second portion in accordance with a CORDIC algorithm. Advantageously, data in a CORDIC pipeline is automatically advanced in response to read instructions and can be automatically advanced from the beginning of the pipeline to the end of the pipeline to reinitialize the pipeline. This allows information to be retrieved from the CORDIC pipeline with relatively little overhead The automatic starting and stopping of the CORDIC pipeline advantageously allows the retrieval of computations from efficient pipeline architectures on an as-needed basis.
Claims(40) 1. A method of computing correlation in a digital signal processor (DSP), the method comprising:
receiving receiver data in quadrature; relieving at least a first portion of a sine wave and at least a first portion of a cosine wave by reference to a lookup table; digitally generating a second portion of the sine wave and a second portion of the cosine wave in multiple stages of a pipelined Coordinate Rotation Digital Computer (CORDIC), where the generated sine wave and the generated cosine wave are of substantially constant magnitude; and multiplying the receiver data by the sine wave and by the cosine wave in a Multiplier Accumulator (MAC) block to determine an amount of correlation. 2. The method as defined in 3. A method of digitally generating a sine wave and a cosine wave in a plurality of digital steps, the method comprising:
(a) receiving an angle increment value, where the angle increment value is related to a change in an angle by which the sine wave and the cosine wave change in a step; (b) computing a new angle value by combining the angle increment value with an existing angle value; (c) calculating a sine and a cosine of the new angle value to compute a value of a step of the sine wave and a value of a step of the cosine wave, respectively; (d) maintaining the computed values of the steps of the sine wave and of the cosine wave such that the values are ready to be read upon receipt of a read instruction; (e) performing the following when a read instruction has been received:
(i) providing the computed values of the steps of the sine wave and of the cosine wave in response to a receipt of the read instruction;
(ii) storing the new angle value as the existing angle value; and
(iii) computing another value for the new angle value by combining the angle increment value with the existing angle value; and
(f) inhibiting further computations of values of other steps of the sine wave and of the cosine wave when a read instruction has not been received. 4. The method as defined in 5. The method as defined in phase shifting the new angle value to a phase shifted angle value, where the phase shifted angle value conforms to a 90-degree range; swapping a sine computation and a cosine computation when the phase shifted angle value is in a first 45-degree portion of the 90-degree range and mirroring the phase angle around 45 degrees; not swapping the sine computation and the cosine computation when the phase shifted angle value is in the other 45-degree portion of the 90-degree range; computing a portion of the sine wave and the cosine wave of the phase shifted angle value by applying the phase shifted angle value as an input to a lookup table; applying an output of the lookup table as an input to a pipelined CORDIC; and compensating the output of the pipelined Coordinate Rotation Digital Computer (CORDIC) in accordance with an amount of phase shift applied to the phase shifted angle value to generate the sine and the cosine of the new angle value. 6. The method as defined in 7. The method as defined in receiving an initial angle value and an indication to start a computation of the sine wave and the cosine wave; using the initial angle value as the existing angle value; automatically advancing computations in the pipelined CORDIC to compute the new angle value until the sine and the cosine of the initial angle is available at an output; and automatically stopping the sequencing of the pipelined CORDIC and the computing of the new angle value until a read instruction has been received. 8. The method as defined in 9. The method as defined in 10. A method of generating a digital sine wave and a digital cosine wave in a digital signal processor (DSP), the method comprising:
storing a plurality of coarse data points in a lookup table; receiving an angle value; applying a first portion of the angle value as an input to the lookup table and retrieving a coarse data point; and applying a second portion of the angle value and applying the retrieved coarse data point as an input to a Coordinate Rotation Digital Computer (CORDIC). 11. The method as defined in converting the angle value to a modified value within a quadrant by applying a phase shift that is an integer multiple of 45 degrees, where such integer multiple includes 0, 1, 2, 3, 4, 5, 6, and 7; applying a first portion and a second portion of the modified value to the lookup table and the CORDIC, respectively, to produce a sine output and a cosine output; and compensating for the conversion of the angle value by selectively phase-shifting and by selectively swapping the sine and the cosine outputs of the CORDIC. 12. The method as defined in using the cosine output as the cosine output and using the sine output as the sine output when the CORDIC calculates an angle within a first 45 degree portion of a quadrant; and swapping the cosine output and the sine output such that the cosine output is the sine output and the sine output is the cosine output when the CORDIC calculates an angle within the other 45 degree portion of the quadrant. 13. A method of providing an intermittent clock signal comprising:
receiving a system clock signal; generating clock pulses of the intermittent clock signal from the system clock signal for a predetermined period after decoding of a first instruction received in a DSP; inhibiting clock pulses of the intermittent clock signal after termination of the predetermined period; and providing a clock pulse of the intermittent clock signal from the system clock signal in response to a decoding of a second instruction. 14. The method as defined in 15. The method as defined in 16. The method as defined in 17. The method as defined in triggering an increment of a count by applying the intermittent clock signal to a counter; using the count to indicate an angle; and computing at least one trigonometric function of the angle. 18. The method as defined in 19. A method of generating a function in a digital signal processor (DSP), the method comprising:
receiving a first instruction, where the first instruction initiates a computation according to a Coordinate Rotation Digital Computer (CORDIC) algorithm; computing the CORDIC algorithm in a pipeline; automatically discontinuing further computations of the CORDIC algorithm in the pipeline when a computed output is ready; and providing the computed output of the CORDIC algorithm in response to a second instruction. 20. The method as defined in 21. The method as defined in 22. The method as defined in predicting a desired time when a computation of the CORDIC algorithm is desired; and initiating the computation of the CORDIC algorithm before the desired time such that the computation is completed by the desired time. 23. The method as defined in 24. A process of controlling a pipelined circuit with a read instruction comprising:
receiving a plurality of instructions; determining when a received instruction corresponds to the read instruction; pausing sequencing of the pipelined circuit until the read instruction is detected; and sequencing the pipelined circuit such that data progresses through one segment of the pipeline in response to receiving the read instruction; and generating an output of the pipelined circuit in response to receiving the read instruction. 25. The process as defined in 26. The process as defined in determining when the received instruction corresponds to a start instruction, where the start instruction further includes a first argument that provides an initial angle and a second argument that provides an amount of an increment; loading an angle generation stage of the pipelined circuit; automatically advancing the data through the pipelined circuit until data is available to be read at the output of the pipeline; and pausing sequencing of the pipelined circuit until detection of an instruction selected from the group consisting of a read instruction and a write instruction. 27. The process as defined in 28. A process of controlling a pipelined circuit with a start instruction comprising:
receiving a plurality of instructions; pausing sequencing of the pipelined circuit until the start instruction is detected; and determining when a received instruction corresponds to the start instruction, where the start instruction includes a first argument that provides an initial angle and a second argument that provides an amount of an increment; and automatically advancing stages of the pipelined circuit until data based on the initial angle is available to be read at the output of the pipelined circuit. 29. The process as defined in Cain 28, wherein at least one of the first argument and the second argument is provided as a content in a register. 30. A digital signal processor (DSP) comprising:
a Coordinate Rotation Digital Computer (CORDIC) unit configured to compute steps of a sine wave and a cosine wave of a constant magnitude and a selectable frequency, where the frequency is selected by configuration of a step size of a change in an angle between computed steps; at least one of a Multiplier Accumulator (MAC), an arithmetic logic unit (ALU), and a Shifter, and a register file to provide arguments to the CORDIC unit and the at least one of the MAC, the ALU, and the Shifter. 31. The DSP as defined in a lookup table adapted to store a plurality of intermediate values of sines and cosines of substantially evenly spaced angles, where the lookup table is configured to receive a first portion of an angle value to address the plurality of intermediate values and to select an intermediate value as an output at least partially in response to the first portion of the angle value; a pipelined CORDIC adapted to receive a second portion of the angle value and the output of the lookup table as inputs, where the pipelined CORDIC is configured to generate a sine step and a cosine step of the second portion of the angle value; an inhibit counter adapted to provide a first state of an inhibit signal upon reaching a predetermined count, where the inhibit counter is reset to a second state upon a reloading of the CORDIC, and where the predetermined count is related to a latency in the pipelined CORDIC; and an angle generator adapted to incrementally step among a plurality of angles, where an output of the angle generator circuit is the angle value, where the angle generator is configured to increment in response to a condition selected from the group consisting of a read instruction and the second state of the inhibit signal. 32. The DSP as defined in 33. The DSP as defined in 34. The DSP as defined in 35. A Coordinate Rotation Digital Computer (CORDIC) comprising:
a plurality of computation stages arranged in a pipeline; a reset unit adapted to receive a reset instruction and to reset the plurality of computation stages in response to the reset instruction; an output circuit adapted to provide a computation from the plurality of computation stages in the pipeline in response to read computation instruction; and a timing circuit adapted to advance calculations through the pipeline in response to a start instruction, where the timing circuit automatically discontinues advancing the calculations through the pipeline when a calculation has progressed to an end of the pipeline, where the timing circuit is further configured sequence the pipeline to generate another computation in response to the read CORDIC instruction. 36. The CORDIC as defined in 37. A control circuit for a pipelined Coordinate Rotation Digital Computer (CORDIC) comprising:
a reset circuit adapted to reset at least a portion of the pipelined stages of the pipelined CORDIC; a first sequencing unit adapted to automatically enable clock pulses to the pipelined CORDIC such that a new calculation can progress from a beginning of the pipelined CORDIC to an end of the pipelined CORDIC and to automatically disable the automatic application of clock pulses to the pipelined CORDIC when the computation is available at the end of the pipelined CORDIC; and a second sequencing unit adapted to provide a clock pulse to the pipelined CORDIC to advance a calculation from one stage to another, where the second sequencing unit is configured to provide the clock pulse in response to an instruction to read an output of the pipelined CORDIC. 38. The control circuit as defined in 39. The control circuit as defined in 40. The control circuit as defined in Description This application claims the benefit under 35 U.S.C. §119(e) of U.S. Provisional Application No. 60/231,280, filed Sep. 8, 2000, the entirety of which is hereby incorporated by reference. 1. Field of the Invention The present invention generally relates to digital signal processing. In particular, the present invention relates to a Coordinate Rotation Digital Computer (CORDIC) in a digital signal processor (DSP). 2. Description of the Related Art A Coordinate Rotation Digital Computer (CORDIC) algorithm performs vector coordinate rotations by using simple iterative shifts and add/subtract operations, which are relatively easy to implement in hardware. Advantages of the CORDIC algorithm have been well documented by U.S. Pat. No. 4,896,287 to O'Donnell, et al., U.S. Pat. No. 4,937,775 to Engeler, et al., and U.S. Pat. No. 5,684,435 to Bergen, the entireties of which are hereby incorporated by reference. The CORDIC algorithm can be used in function generators. Function generators are an integral part of many DSP algorithms. Digital communication and signal processing systems use representations of sine, cosine, tangent and hyperbolic functions to perform fundamental operations such as coherent detection, rectangular to polar conversions, decoding of Quadrant Amplitude Modulation (QAM) and M-ARY modulated signals, and the like. In addition, the CORDIC algorithm can be used in Direct Digital Synthesis (DDS) of frequencies. One conventional technique to generate trigonometric functions is via a lookup table stored in a Read Only Memory (ROM). Disadvantageously, the amount of data that is stored in a ROM lookup table can quickly surpass practical size and cost limitations. The storage area of a ROM chip increases almost exponentially with increases in resolution. By contrast, where a ROM lookup table is relatively small and inexpensive, the number of available functions and the resolution of the data available are limited. Another conventional technique is to compute trigonometric functions through polynomial software routines executed in a digital signal processor (DSP). Disadvantageously, typical software implementations of function generation are relatively slow. Typical software routines use iterative techniques, and take relatively time consuming multiple cycles to generate a trigonometric function. Function generation can be performed by a CORDIC. However, many conventional implementations of a CORDIC iterate numerous times to perform a calculation for function generation. Thus, a microprocessor or DSP reading the output of the CORDIC waits until computation is complete. Where a conventional CORDIC is pipelined, execution can be faster, but conventional pipelined CORDICs have relatively little integration with other hardware. Disadvantageously, other hardware, such as microprocessors and DSPs, closely monitor or control conventional pipelined CORDICs or store the results of the conventional pipelined CORDIC in relatively large and expensive memory devices. Embodiments of the invention quickly and efficiently process the CORDIC algorithm in a pipeline. Advantageously, data in the CORDIC pipeline is automatically advanced in response to read instructions and can be automatically advanced from the beginning of the pipeline to the end of the pipeline to reinitialize the pipeline. This allows a controller or a digital signal processor (DSP) to efficiently retrieve information from the CORDIC pipeline with relatively little overhead. The automatic starting and stopping of the CORDIC pipeline advantageously allows the retrieval of computations from efficient pipeline architectures on an as-needed basis and advantageously avoids having to store relatively large amounts of computations from a pipeline in memory. One embodiment of the present invention includes a design of a modified CORDIC Function Generator that can be used in a DSP core. The modified CORDIC Function Generator is pipelined to provide a new output on every clock edge. A relatively small initial latency allows the modified CORDIC Function Generator time to process new data through the pipeline. In one embodiment, an architecture for an Execution Block, which can be implemented in the DSP core, advantageously uses the CORDIC Function Generator to reduce both chip area and DSP idle cycles. An example of a Radix-2 butterfly illustrates how this CORDIC Function Generator improves the implementation of such DSP algorithms. One embodiment according to the invention includes a method of computing correlation in a digital signal processor (DSP). The method includes receiving receiver data in quadrature, digitally generating a sine wave and a cosine wave with a pipelined Coordinate Rotation Digital Computer (CORDIC), and multiplying the receiver data by the first portion of the sine wave and the first portion of the cosine wave in a Multiplier Accumulator (MAC) block to determine an amount of correlation. In one embodiment, the sine wave and the cosine wave generated by the CORDIC algorithm are of substantially constant magnitude. Another embodiment according to the invention is a method of digitally generating a sine wave and a cosine wave. The method includes (a) receiving an angle J increment value, where the angle increment value is related to a change in an angle by which the sine wave and the cosine wave change during a time increment, (b) computing a new angle value by combining the angle increment value with an existing angle value, (c) calculating a sine and a cosine of the new angle value to compute a value of a step of the sine wave and a value of a step of the cosine wave, respectively, (d) maintaining the computed values of the steps of the sine wave and of the cosine wave such that the values are ready to be read upon receipt of a read instruction, (e) performing the following when a read instruction has been received, (e)(i) providing the computed values of the steps of the sine wave and of the cosine wave in response to a receipt of the read instruction, (e)(ii) storing the new angle value as the existing angle value, (e)(iii) computing another value for the new angle value by combining the angle increment value with the existing angle value, (f) inhibiting further computations of values of other steps of the sine wave and of the cosine wave when a read instruction has not been received, and (g) repeating steps (b), (c), (d), (e), and (f). One embodiment of the invention includes a method of generating a digital sine wave and a digital cosine wave in a digital signal processor (DSP). The method includes computing a portion of the sine wave and a portion of the cosine wave by looking up points in a lookup table, and computing a remaining portion of the sine wave and the cosine wave in accordance with a pipelined CORDIC. One embodiment of the invention includes a method of providing an intermittent clock signal to a pipelined process. The intermittent clock signal automatically advances and stops advancing computations in the pipelined process in accordance with the rate at which data is retrieved from the pipelined process. The method includes receiving a system clock signal and generating clock pulses of the intermittent clock signal from the system clock signal for a predetermined period after decoding of a first instruction received in a DSP. The first instruction can correspond to a start instruction. The method further includes inhibiting clock pulses of the intermittent clock signal after termination of the predetermined period and providing a clock pulse of the intermittent clock signal from the system clock signal in response to a decoding of a second instruction. The second instruction can be a read instruction. In one embodiment, the predetermined period is the latency of a pipeline from beginning to end. One embodiment according to the invention includes a method of generating a function in a digital signal processor (DSP). The method includes receiving a first instruction, such as a start instruction, which initiates a computation according to a Coordinate Rotation Digital Computer (CORDIC) algorithm. The method computes the CORDIC algorithm in a pipeline and automatically discontinues further computations of the CORDIC algorithm in the pipeline when a computed output is ready. The method provides the computed output of the CORDIC algorithm in response to a second instruction such as a read instruction. One embodiment of the invention is a process of controlling a pipelined circuit with a read instruction. The process includes receiving a plurality of instructions and detecting the occurrence of the read instruction. In response to the detection of the read instruction, the process advances computations through one stage or segment of the pipelined circuit and generates an output of the pipelined circuit. One embodiment of the invention is a process that includes detecting a start instruction, which loads the beginning of the pipelined circuit and automatically sequences the stages of the pipelined circuit until new data is ready to be read at the output. Where the received instruction does not correspond to the read instruction or to S the start instruction, one embodiment of the invention pauses the pipelined circuit One embodiment of the invention includes a DSP that includes a CORDIC unit, a register file, and at least one of a Multiplier Accumulator (MAC), an Arithmetic Logic Unit (ALU), and a Shifter. The CORDIC computes steps of sine waves and cosine waves. The register file provides arguments to the CORDIC unit and the at least one of the MAC, the ALU, and the Shifter. One embodiment of the invention is a CORDIC that includes a plurality of computation stages arranged in a pipeline, a reset unit, an output circuit, and a timing circuit. The reset unit is adapted to receive a reset instruction and to reset the plurality of computation stages in response to the reset instruction. The output circuit is adapted to provide a computation from the plurality of computation stages in the pipeline in response to read computation instruction. The timing circuit is adapted to advance calculations through the pipeline in response to a start instruction. The timing circuit is further configured to automatically discontinue advancing the calculations through the pipeline when a calculation has progressed to an end of the pipeline, and the timing circuit is further configured to generate another computation in response to the read CORDIC instruction. One embodiment according to the invention includes a control circuit for a pipelined CORDIC. The control circuit can also be used to control other pipelined circuits. The control circuit includes a reset circuit, a first sequencing unit, and a second sequencing unit. The reset circuit is adapted to reset at least a portion of the pipelined stages of the pipelined CORDIC. The first sequencing unit is adapted to automatically enable clock pulses to the pipelined CORDIC such that a new calculation can progress from a beginning of the pipelined CORDIC to an end of the pipelined CORDIC. The first sequencing unit is also configured to automatically disable the automatic application of clock pulses to the pipelined CORDIC when the computation is available at the end of the pipelined CORDIC. The second sequencing unit is adapted to provide a clock pulse to the pipelined CORDIC to advance a calculation from one stage to another, where the second sequencing unit is configured to provide the clock pulse in response to an instruction to read an output of the pipelined CORDIC. These and other features of the invention will now be described with reference to the drawings summarized below. These drawings and the associated description are provided to illustrate preferred embodiments of the invention, and are not intended to limit the scope of the invention. Although this invention is described in terms of certain preferred embodiments, other embodiments that are apparent to those of ordinary skill in the art, including embodiments which do not provide all of the benefits and features set forth herein, are also within the scope of this invention. Accordingly, the scope of the present invention is defined only by reference to the appended claims. One use of a Coordinate Rotation Digital Computer (CORDIC) algorithm is to generate functions such as trigonometric, logarithmic, hyperbolic and linear functions. Another use of the CORDIC algorithm is to convert between Polar and Cartesian coordinates. The CORDIC algorithm performs vector coordinate rotations using simple iterative shifts and add/subtract operations. The general (Givens') rotation transform expressed in Equations 1A and 1B rotates a vector by an angle φ.
The transform can be rearranged as shown in Equations 2A and 2B.
The rotation angle s can be selected such that tan(φ)=±2 Since, k Conventionally, the values of tan The vectoring mode rotates the input vector through an angle such that the resulting vector lies on the x-axis. Successive iterations rotate in the direction to reduce the y-component, y The initial values of the system variables, x Generally, if the CORDIC algorithm can compute a function, the inverse of the function can also be computed The CORDIC equations can be modified to introduce a coordinate system factor, m. The coordinate systems are hyperbolic (m=1), linear (m=0) and circular (m=−1). These extensions allow the CORDIC algorithm to compute linear and hyperbolic functions. One implementation of the CORDIC algorithm uses comparators for each stage to determine the direction of rotation A modified CORDIC algorithm for Direct Digital Frequency Synthesis (DDFS) or DDS simplifies a CORDIC computation by determining the d ion of rotation directly from the bits r The modified CORDIC algorithm uses φ=2 Table 1 illustrates that the values of tan(2
In one embodiment, the core of the DSP has a scalable and configurable architecture, which allows the designer to plug-in a variety of functional units without changing the external interfaces of the block with the rest of the core. The Instruction Decoder In one embodiment, a function generation process, such as sine/cosine generation, is initiated early. In one embodiment, the function generation process is initiated early by approximately the amount of time equal to the initial latency of the pipelined process, such that an output of the function generation process is available in response to a read instruction. In one embodiment, the Execution Block In one embodiment, the CORDIC Assist After initial latency cycles, which vary depending on the number of stages or segments of the pipeline, the result of the first computation progresses through the stages or segments of the pipelined CORDIC Assist -
- n: startCORDIC (R1, R2)
- n+1: <instr>, <instr>
- n+2: <instr>, <instr>
- n+3: <instr>, <instr>
- n+4: <instr>, <instr>
- n+5: readCORDIC(R4)
In the sample instructions shown above, an initial angle is specified in R1, and the increment in angle is specified in R2. In the illustrated embodiment, the sine and the cosine values of initial angle are ready in cycle n+5 and are available to be read in cycle n+5 or a later cycle, i.e., the number of latency cycles is 5. In the illustrated embodiment, the sine and the cosine of the next value (R1+R2) are immediately available to be read in the next cycle after the readCORDIC instruction is applied. Another sample sequence of instructions is provided below: -
- n+6: readCORDIC (R4); sin/cos (R1+R2)
- n+7: readCORDIC (R6); sin/cos (R1+2*R2)
- n+8: <instr>
- n+9: <instr>
- n+10: readCORDIC (R4); sin/cos (R1+3*R2)
In one embodiment, the CORDIC Assist The CORDIC Assist The pipelined sine/cosine generation unit The accumulator The output The multiplexer Due to the symmetry of sine and cosine waves, the cosines and sines of an entire 360-degree range need not be computed. Rather, a more limited range, such as 45 degrees or 90 degrees, can be computed, and the computed sines and cosines can be inverted and/or swapped to rotate the computed result by, for example, a multiple of 90 degrees. In one embodiment, the output The output In the illustrated embodiment, an output of the hardwired π/4 multiplier To achieve 16 bits of output precision, one embodiment of the pipelined sine/cosine generation unit
The outputs of the multi-stage butterfly pipeline The sample code, below, is written in an assembly language for a DSP core. The “∥ to the left of a line of code indicates an instruction that can execute in parallel with the prior instruction. The sample code illustrates how the pipelined sine/cosine generation unit
In the second step In the third step In the reset decision block In the reset step In the start decision block In the first advance pipeline step In the computation available decision block In the read decision block In the output computation step In the second advance pipeline step The illustrated process repeats indefinitely. The skilled practitioner will appreciate that the reset decision block The instruction decoder The reset signal The read signal The pipeline control unit A variety of techniques can be used to generate the series of pulses by the pipeline control unit In another embodiment, a counter is preloaded in response to the start signal In another embodiment, the stages of the pipelined circuit receive a continuous The pipelined circuits and the pipeline control circuits disclosed herein can be fabricated in a broad variety of ways. In one embodiment, the circuits are integrated into dedicated hardware such as a custom application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a programmable logic device (PLD), and the like. In one embodiment, the pipelined circuits, the pipeline control circuits, or both are integrated with a digital signal processor (DSP) core. Various embodiments of the present invention have been described above. Although this invention has been described with reference to these specific embodiments, the descriptions are intended to be illustrative of the invention and are not intended to be limiting. Various modifications and applications may occur to those skilled in the art without departing from the true spirit and scope of the invention as defined in the appended claims. Referenced by
Classifications
Legal Events
Rotate |