From: lkcl Date: Tue, 8 Oct 2019 11:05:09 +0000 (+0100) Subject: (no commit message) X-Git-Tag: convert-csv-opcode-to-binary~3870 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3efb0197ddbdfd55bac02340106d621f8b9e578c;p=libreriscv.git --- diff --git a/simple_v_extension/vector_ops.mdwn b/simple_v_extension/vector_ops.mdwn index 32b11f88c..ce4c370cc 100644 --- a/simple_v_extension/vector_ops.mdwn +++ b/simple_v_extension/vector_ops.mdwn @@ -39,34 +39,6 @@ CORDIC can also be used for performing DCT. See vx, vy = CORDIC(vx, vy, coordinate\_mode, beta) - int i = 0; - int iterations = 0; // Number of times to run the algorithm - float arctanTable[iterations]; // in Radians - float K = 0.6073; // K - float v_x,v_y; // Vector v; x and y components - - for(i=0; i < iterations; i++) { - arctanTable[i] = atan(pow(2,-i)); - } - - float vnew_x; // To store the new value of x; - for(i = 0; i < iterations; i++) { - // If beta is negative, we need to do a counter-clockwise rotation: - if( beta < 0) { - vnew_x = v_x + (v_y*pow(2,-i)); - v_y -= (v_x*pow(2,-i)); - beta += arctanTable[i]; - } - // If beta is positive, we need to do a clockwise rotation: - else { - vnew_x = v_x - (v_y*pow(2,-i)); - v_y += (v_x*pow(2,-i)); - beta -= arctanTable[i]; - } - v_x = vnew_x; - } - v_x *= K; - v_y *= K; Links: