Implementation of Cordic Algorithm for FPGA. Based Computers Using Verilog. pani1, ju, a3. If you’ve never worked with a CORDIC algorithm before, the .. Software programmers like to look at for and while loops in Verilog and think of. The CORDIC rotator seeks to reduce the angle to zero by rotating the vector. To compute . See the description of the CORDIC algorithm for details. */ module.

Author: Kigazshura Yozshunos
Country: Kazakhstan
Language: English (Spanish)
Genre: Education
Published (Last): 16 February 2008
Pages: 216
PDF File Size: 8.17 Mb
ePub File Size: 8.9 Mb
ISBN: 574-6-69521-736-6
Downloads: 36617
Price: Free* [*Free Regsitration Required]
Uploader: Arashishakar

T is also something that is easy to calculate within an FPGA. Moreover, it enables fine-grained range error checking at run-time. Our task here will be to calculate that gain.

Such a core generator will be our approach here. To set up a co-simulation, we need to create a Cosimulation object for the Verilog design. The idea is to use the cos and sin functions from the math module to compute the expected results on a number of input angles, and to compare them with the outputs from the design under test.

On this page, we will implement a parallel, iterative processor, which is a fairly straightforward mapping of the equations into a bit-parallel data path and a state machine.

But as this code is outside a generator function, it doesn’t matter. As long as the code inside them obeys the constraints of the convertible subset, the design instance can always be converted to Verilog.

Using a CORDIC to calculate sines and cosines in an FPGA

Here is the code:. The first three are 32 bits wide, since they are storing fixed-point numbers as described above. That’s why I defined it as reg.


Sign up using Email and Password. The core will operate in one of two modes: We will assume that all numbers are stored as bit fixed-point numbers, with the radix point between the second-most-significant and third-most-significant bits.

Note that we constrain the intbv instances by specifying the range of valid integer values, not by a bit width. The Cordic equations for this mode are:.

Inline mathematics generated by MathJax.

Cordic-based Sine Computer

One would vrilog expect a similar feature in other HDLs. Remember, atan2 accepts the y argument first. This, however, only tells us how much gain will be applied to our input.

O ye simple, understand wisdom: Going to a higher number of bits would allow more iterations thus improving accuracy.

Clearly we will want to verify that the Verilog output from the convertor is correct. It basically calculates the product of all of the gains of cordix various stages in our algorithm.

Therefore, the comparisons between expected and actual results are performed using an error margin. For detailed information, you can review the synthesis report.

I believe it’s quite clear what this is supposed to do. It seems vordic that a type that unifies the integer and the bit vector views should be very useful for hardware design. A simple two-dimensional rotation matrix is given by: For these applications, the way to compensate for the gain is to send a different number as an input.


Further, as you may have guessed from Fig 1 above, we can apply a cordoc rotation going in the opposite direction:. It requires only adds, subtracts, and shifts. As before, the dut object is a simulatable design instance, but as a side effect of the instantiation, an equivalent Algorihtm module file will be generated.

This is what we are going to try to do: The command shown is for the open-source Cver simulator. This means that only the source code of generator functions is converted.

Using a CORDIC to calculate sines and cosines in an FPGA

Hence we are rotating xv and yv in a counter-clockwise direction, while the remaining phase angle will decrease in what will look coric a clock-wise direction. You can find more information about the convertible subset in the MyHDL manual.

The Cordic algorithm is an iterative algorithm based on vector rotations over elementary angles. Software loops repeat the same instruction, one after another in time. The dual nature of this class comes in very handy. The combinatorial implementation runs at about 10 mhz while the iterative ones run at about in a Lattice ECP2 device.

That allows you to pick the number of most-significant bits that you need, for the precision you want.

The actual computation is done by the processor generator.