[Cordic] Design and implementation of NCO based on Cordic algorithm

1. Software version

ISE14.7

2. Theoretical knowledge of this algorithm

ROM resources, as another effective way to generate discrete sinusoidal signals, CORDIC (Coordinate Rotation Numerical Computation) algorithm has become more and more popular. The basic idea is to approach the final rotation angle that needs to be achieved through a series of successively decreasing reciprocating deflections related to the operation base. This algorithm only uses two operations of addition and shift to rotate the vector in an iterative manner. Since the CORDIC algorithm only uses addition and shift operations, it is very suitable to be implemented in FPGA. It can be used to realize NCO, mixing in digital down-conversion frequency converter and coordinate transformation.

        Another way to realize NCO is to use an algorithm based on a coordinate rotation digital computer, namely the CORDIC algorithm. The basic idea is to use the successive approximation method to realize the calculation of trigonometric functions. The outstanding advantage of this algorithm is that it only performs addition, subtraction and shift operations, and combined with the pipeline, it can output a result after n iterations per clock cycle.

 

 

 3. Core code

`timescale 1ns / 1ps
//
// Company: 
// Engineer: 
// 
// Create Date:    23:07:56 04/30/2012 
// Design Name: 
// Module Name:    Tops 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//
module Tops(
            i_clk,
				i_rst,
				i_phase,
				i_freq,
				
				o_freq,
				o_cos,
				o_sin
	        );

input       i_clk;
input       i_rst;

input[15:0] i_phase;
input[31:0] i_freq;

output[15:0]o_freq;
output[15:0]o_cos;    
output[15:0]o_sin;     


//频率相位累加器
//频率相位累加器
phase_adder phase_adder_u(
								 .i_clk          (i_clk), 
								 .i_rst          (i_rst), 
								 .i_phase_in     (i_phase), 
								 .i_frequency_in (i_freq), 
								 .o_freq         (o_freq)
								 );

//cordic模块//象限判决
//cordic模块//象限判决
//cordic模块//象限判决
wire [15:0] o_y;
wire [15:0] o_x;
cordic_top cordic_top_u(
								 .i_clk      (i_clk), 
								 .i_reset    (i_reset), 
								 .i_phase_in (o_freq[15:0]), 
								 .i_phase_in2(o_freq[15:14]),//象限判决
								 .o_cos_out  (o_cos), 
								 .o_sin_out  (o_sin)
							  );

 

endmodule

4. Operation steps and simulation conclusion

 

5. References

A35-11

[1] Wang Yuliang, Li Hongsheng, Xia Dunzhu. Implementation of NCO in FPGA based on CORDIC algorithm [J]. Computer and Digital Engineering, 2009, 37(12):4.

Guess you like

Origin blog.csdn.net/ccsss22/article/details/124370965
Recommended