2 // Generated by MyHDL 0.8
3 // Date: Tue Dec 3 04:33:14 2013
15 // Sine and cosine computer.
17 // This module computes the sine and cosine of an input angle. The
18 // floating point numbers are represented as integers by scaling them
19 // up with a factor corresponding to the number of bits after the point.
23 // cos_z0: cosine of the input angle
24 // sin_z0: sine of the input angle
25 // done: output flag indicated completion of the computation
27 // start: input that starts the computation on a posedge
31 output signed [19:0] cos_z0;
32 reg signed [19:0] cos_z0;
33 output signed [19:0] sin_z0;
34 reg signed [19:0] sin_z0;
37 input signed [19:0] z0;
42 (* gentb_constant="0" *)
45 always @(posedge clock, posedge reset) begin: DESIGN_PROCESSOR
48 reg signed [20-1:0] dz;
49 reg signed [20-1:0] dx;
50 reg signed [20-1:0] dy;
51 reg signed [20-1:0] y;
52 reg signed [20-1:0] x;
53 reg signed [20-1:0] z;
77 dx = $signed(y >>> $signed({1'b0, i}));
78 dy = $signed(x >>> $signed({1'b0, i}));
110 if ((i == (19 - 1))) begin