3、A_WIDTH-1:0]x5,y5,z5; reg[DATA_WIDTH-1:0]x6,y6,z6; reg[DATA_WIDTH-1:0]x7,y7,z7; reg[1:0]quadrant[PIPELINE:0]; integeri; //getrealquadrantandmaptofirst_nquadrant always@(posedgeclkornegedgerst_n) begin if(!rst_n) phase_in_reg<=8’b0000_0000; else if(ena) begin case(phas
4、e_in[7:6]) 2’b00:phase_in_reg<=phase_in; 2’b01:phase_in_reg<=phase_in-8’h40;//-pi/2 2’b10:phase_in_reg<=phase_in-8’h80;//-pi 2’b11:phase_in_reg<=phase_in-8’hc0;//-3pi/2 default:; endcase end end always@(posedgeclkornegedgerst_n) begin if(!rst_n) begin x0<=8’b0000_0000
5、; y0<=8’b0000_0000; z0<=8’b0000_0000; end else if(ena) begin x0<=8’h4D;//defineaggregateconstantXi=1/P=1/1.6467=0.60725(Xi=2*P+8’h4D) y0<=8’h00; z0<=phase_in_reg; end end //level1 always@(posedgeclkornegedgerst_n) begin if(!rst_n) begin x1<=8’b0000_0000; y1<=8’b
6、0000_0000; z1<=8’b0000_0000; end else if(ena) if(z0[7]==1’b0) begin x1<=x0-y0; y1<=y0+x0;