referring now to fig1 there is shown a functional block diagram of a cordic magnitude semiconductor chip 10 employing the invention for very accurately calculating the magnitude and phase of a complex number or vector i + jq using an improved cordic magnitude algorithm . i represents the in - phase or real component of the complex number and q represents the quadrature on imaginary component of the complex number . the cordic magnitude chip ( cmc ) is fabricated with a 1 . 25 micron cmos technology and packaged in a 172 pin flat pack . the cmc 10 as shown in fig1 converts cartesion coordinates to polar coordinates by approximating the magnitude of complex numbers comprising two 16 bit fixed point numbers or block floating point numbers with 8 bit common exponents . the resulting magnitude is a 16 bit fixed point or floating point number with an 8 bit exponent . the cmc supports a data rate of 20 mhz and the maximum percentage error for the approximated magnitude is less than 0 . 003 %. the phase information is represented as a 12 bit data word in binary angle measurement system ( bams ) format and it is determinable to a resolution of +/- 0 . 224 deg ( lsb = 180 °/ 2048 ). the input buffer 12 and buffer 22 provide drive capability within the chip for the input signals . the magnitude calculator 14 determines the magnitude of a complex number represented by real and imaginary input data words redat 0 - 15 and imdat 0 - 15 . the phase calculator 16 which is coupled to the magnitude calculator 14 determines the phase of the complex number . the sign monitor 18 which is coupled to the magnitude calculator 14 provides sign history information for the i and q components of the complex number or vector and the sign bits of the q components over the eight cordic rotations . the output buffer 20 is coupled to the outputs of the magnitude calculator 14 , phase calculator 16 , sign monitor 18 and scan tester 24 and provides drive capability for the cmc output signals . the scan tester 24 provides a self - test capability within the cmc 10 for testing all registers . all of the input and output signals of the cmc 10 are described in table 1 . for normal operation the scanen input of the cmc 10 is set to a logical 0 so that the i and q components pass through the pipeline registers within the magnitude calculator 14 , phase calculator 16 and sign monitor 18 . the fix / fl input is set to a logical 0 if the cmc 10 is used in a floating point system and set to a logical 1 if the cmc 10 is used in a fixed point system . the full scale input is set to a logic 1 if a full scale magnitude output ( all ones ) is required when the exponent has a value of one ( incorrect data input which causes overflow ) in the fixed point case , otherwise it is set to a logic 0 . the unsgn input is set to a logic 1 if the magnitude is to be represented as a 15 - bit number , otherwise it is set to a logic 0 . the 8 - bit flexp input is tied to logic 0 for a fixed point system . the cmc 10 does not need any external factors or control words to be loaded for initialization . these operating modes are summarized in table 2 . table 1______________________________________signal name signal description type______________________________________redat 0 - 15 16 bit real data bus inputimdat 0 - 15 16 bit imaginary data input busflexp 0 - 7 8 bit floating point input exponentscannin 0 - 10 11 1 bit test data inputs inputfix / fl fixed or floating input point control signalsysclk system clock inputscanen test enable signal inputfull scale full scale output input control signalunsgn 15 bit magnitude input output control signalmagdat 0 - 15 16 bit magnitude output data busscanout 0 - 10 11 bit output test bus outputexpdat 0 - 7 8 bit exponent data bus outputsgndat 0 - 9 10 bit sign history outputphase 0 - 11 12 bit phase output in output bams format______________________________________ table 2______________________________________control logicalsignal state function______________________________________fix / fl 0 magnitude output is in floating point mode 1 magnitude output is in fixed point modeunsgn 0 magnitude output is represented as 16 bit 1 magnitude output is represented as 15 bitfull 0 magnitude output is half of true valuescale 1 magnitude output is set to full scalescanen 0 cmc is in normal operational mode 1 cmc is in scan test mode______________________________________ the cmc 10 approximates the magnitude of a complex vector i + jq by performing a sequence of vector rotations of fixed decreasing values of angles . only the direction of rotation changes , and this direction is determined by the sign of the imaginary component ( q ) of the previous rotation . the object of each rotation is to align the vector with the real axis so that after the sequence of vector rotations , the real component ( i ) shall be the approximated magnitude . fig2 illustrates the rotation of a vector v towards the real axis to a v &# 39 ; position wherein q decreases to q &# 39 ; and i increases to i &# 39 ;. during each rotation the imaginary component decreases and the real component increases by a factor equal to sec θ , where θ is the angle of rotation . in the present embodiment , after eight rotations , the real component is taken as the approximated magnitude of the input vector . the inherent growth due to the cordic algorithm for eight rotations is 1 . 6467 . this growth factor is decreased to 0 . 9263 in the last stage ( stage 10 ) by multiplying the approximated magnitude by 9 / 16 ( in order to get closer to 1 . 00 ). the computations performed during a rotation are as follows : ## equ1 ## where : | i0 |= absolute value of the real component of the complex input vector ( in - phase component ) | i ( i )|= the absolute value of the real component of the complex value after i cordic rotations q ( i )= the imaginary component of the complex value after i cordic rotations k = 4 if i & gt ; 1 and the three ( 3 ) msbs of i ( i - 1 ) are equal to 0 k = 1 if i = 1 , or any of the three ( 3 ) msbs of i ( i - 1 ) are equal to 1 k = 2 if i = 2 and three ( 3 ) msbs of i ( i - 1 ) are equal to zero and the fourth msb is equal to one k = 8 if i = 2 and the four ( 4 ) msbs of i ( i - 1 ) are equal to zero if the input vector falls in the second or third quadrant then it is reflected into the first or fourth quadrant respectively by taking the absolute value of the real component . the q portion takes advantage of the fact that the most significant bit ( msb ) position is vacated when the value of q is reduced by one - half with each succeeding rotation . then the q value is doubled by a left shift which fills in the msb position and provides for a vacated least significant bit ( lsb ) which is used for a one bit lsb growth in the next vector rotation . the i portion of the computations left justify the i component ( and correspondingly shifts the q component ) by two ( 2 ) bit positions when the three msbs are zeros . hence , this reconfiguration accommodates a 2 bit lsb growth . the algorithms for the first three rotations are as follows : ## equ2 ## referring now to fig3 and fig3 a - 3e , fig3 is a sketch showing how fig3 a - 3e are arranged to make up a functional block diagram of ten pipeline stages 30 - 48 of the cmc 10 which implement the improved cordic algorithm for calculating the magnitude and phase of the complex number i + jq . the input data , redat 0 - 15 and imdat 0 - 15 , for the initial vector comprises two &# 39 ; s complement real ( i ) and imaginary ( q ) components of a complex vector i + jq which may be either 16 bit fixed point or 16 bit block floating point with 8 bit exponents . the i and q components are 20 - bits wide for rotations 2 - 8 in stages 2 - 8 respectively and 16 - bits wide for rotation 1 in stage 1 . all intermediate phase calculations are performed in 20 - bits . the cmc 10 outputs the approximated magnitude as a 16 - bit unsigned number for a fixed point system or a 16 - bit unsigned number with an 8 - bit exponent for a floating point system , the sign history as a 10 - bit binary number , the phase of the complex vector as 12 - bit number in bams format . if the unsgn input is set to a logic 1 then the magnitude output is a 15 - bit number . referring to fig3 a , stage 0 30 comprises two 16 bit registers 52 , 54 for storing the i and q components , a 4 bit register 56 for storing i and q sign data , an 8 bit register 58 for storing a floating point exponent and an absolute value generator 60 for converting the real component ( i ) to its absolute value . the absolute value generator 60 comprises an adder - subtractor ( as ) such that if the real component ( i ) is negative , then it is complemented and one ( 1 ) is added to the least significant bit ; otherwise , it passes straight through the adder - subtractor with no change . the imaginary component ( q ) is not affected in the stage 0 . hence , the outputs of stage 0 are the original q component ( q0 ), the absolute i component | i | the sign bits i0sgn and q0sgn of the original i and q components and a floating point exponent ( flexp1 , if dealing with block floating point input data ). the registers 52 , 54 , 56 and 58 are serially connected in order to perform logic scan path testing readily known to one skilled in the art . all of the registers in each of the ten stages 30 - 48 have similar test capability . stage 1 32 performs the first cordic rotation and comprises four registers 62 - 68 as in stage 0 30 for storing the i0 and q0 components , sign history word ( sgnhst0 ) and exponent word ( flexp0 ) outputs from stage 0 30 . the sign bit of the q component determines the direction of rotation . if it is negative , then the vector lies in the fourth quadrant and a counter clockwise rotation is performed . if it is positive , then the vector lies in the first quadrant and a clockwise rotation is performed . also , the sign bit of the q component selects the computations to be performed in order to determine the new rotated vector . the computations are performed by two adder - subtractors ( as ) 70 and 72 which are each coupled to the outputs of registers 62 and 64 which store the i0 and q0 original components . the four most significant bits ( msbs ) of the i1 component are checked in the or and nor gates 76 to determine if the components can be left justified for the following stage . the phase of the complex vector is computed from the sign bits of the q components over the eight rotations . stage 1 initiates the phase computation in adder - subtractor 74 by looking at the sign bits of the original i0 and q0 components . all phase computations are performed in 20 bits . the sign of the q component from the previous rotation and the sign of the original i component ( i0 ) determines whether the angle of rotation ( 45 deg in stage 1 ) should be added or subtracted from the interim phase . table 3 shows how the q sign of the previous stage determines the phase output , and table 4 shows the angles of rotation for each rotation . the outputs from stage 2 comprise the new i1 and q1 components , the sign history ( sgnhstl ) which includes the sign bit of the new q1 component ( q1sgn ) along with the previous sign bits , two bits to flag left justify ( leftj1 ) the interim phase ( phase1 ), and the exponent ( flexp1 ). table 3______________________________________ ( previousq sign stage ) phase output______________________________________0 interim phase + angle of rotation1 interim phase - angle of rotation______________________________________ table 4______________________________________rotation angles of rotation______________________________________1 45 . 00 deg2 26 . 57 deg3 14 . 04 deg4 7 . 13 deg5 3 . 58 deg6 1 . 79 deg7 0 . 90 deg8 0 . 45 deg______________________________________ still referring to fig3 a , stage 2 34 performs the second cordic rotation and comprises five registers 78 - 86 for storing the outputs from stage 4 32 . registers 78 and 80 are 16 bit registers for storing the i1 and q1 components resulting from the first rotation computations . an 8 bit register 82 stores the sign history ( sgnhstl ) and left justify flag bits ( leftj1 ); a 20 bit register 84 stores the interim phase ( phase1 ) and an 8 bit register stores the exponent ( flexp1 ). before the second rotation is performed the 16 bit i1 component from stage 1 is expanded to 20 bits by adding an extra bit at the msb side and three bits at the lsb side . similarly , the 16 bit q1 component from stage 1 is expanded to 20 bits by adding two extra bits at the msb side and two bits at the lsb side . these four extra bits are added so that the growth in the i and q components can be accommodated in stages 2 through 8 . in accordance with the algorithm the computed i1 and q1 components may have to be shifted left or right . this shifting is performed by four sets of multiplexers 88 - 94 coupled to the outputs of registers 78 and 80 , and the left justify flag select bits from register 82 selects the appropriate shifted i1 and q1 components for the second rotation . the outputs of the multiplexers coupled to the i and q adder - subtractor are shown in tables 5 and 6 respectively . table 5__________________________________________________________________________multiplexer outputs to i adder - subtractor__________________________________________________________________________i register outputsbit 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18rot 1 stage 1i k = 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15q k = 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15rot , 2 stage 2i k = 1 z 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 z z z k = 2 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 z z z z k = 8 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 z z z z z zq k = 1 1 1 1 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 z k = 2 1 1 1 - 2 - 1 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 z z k = 8 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 z z z zrot , 3 stage 3i k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 z zq k = 1 3 3 3 2 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 k = 4 3 2 1 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16rot , 4 stage 4i k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 18 k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 z zq k = 1 3 3 3 3 3 2 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 k = 4 3 3 3 12 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14rot , 5 stage 5i k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 z zq k = 1 3 3 3 3 3 3 3 2 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 k = 4 3 3 3 3 3 2 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12rot , 6 stage 6i k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 z zq k = 1 3 3 3 3 3 3 3 3 3 2 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 k = 4 3 3 3 33 3 3 2 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10rot , 7 stage 7i k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 z zq k = 1 3 3 3 3 3 3 3 3 3 3 3 2 1 0 - 1 - 2 - 3 - 4 - 5 - 6 k = 4 3 3 3 3 3 3 3 3 2 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8rot , 8 stage 8i k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 z zq k = 1 3 3 3 3 3 3 3 3 3 3 3 3 3 2 1 0 - 1 - 2 - 3 - 4 k = 4 3 3 3 3 3 3 3 3 3 3 3 2 1 0 - 1 - 2 - 3 - 4 - 5 - 6__________________________________________________________________________ table 6__________________________________________________________________________multiplexer outputs to q adder - subtractor__________________________________________________________________________q register outputsbit 2 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17rot , 1 stage 1i k = 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15q k = 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15rot , 2 stage 2i k = 1 z 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 z z z k = 2 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 z z z z k = 8 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 z z z z z zq k = 1 1 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 z z z k = 2 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 z z z z k = 8 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 z z z z z zrot , 3 stage 3i k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 z zq k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 z k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 z z zrot , 4 stage 4i k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 z zq k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 z k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 z z zrot , 5 stage 5i k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 z zq k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 z k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 z z zrot , 6 stage 6i k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 z zq k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 z k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 z z zrot , 7 stage 7i k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 z zq k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 z k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 z z zrot , 8 stage 8i k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 z zq k = 1 1 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 z k = 4 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 z z z__________________________________________________________________________ the direction of rotation is determined by the signs of the imaginary component ( q1sgn ). the computations for the second rotation are performed by two 20 bit adder - subtractors 96 and 98 . a value of one is added to the left justify count if the four msbs of i1 are zero and one is added to the floating point exponent from register 86 by adder 102 if any three msbs of i1 are equal to one . after the eight rotations the left justify count is the number of times a left justify was performed over the eight rotations . the 26 . 57 deg rotation angle in this stage is added to the interim phase ( phase1 ) from stage 1 which is stored in register 84 by adder - subtractor 100 if the original vector lies in the 1st or 3rd quadrants ; otherwise , the 26 . 57 deg rotation angle is subtracted from the interim phase ( phase1 ). in order to maintain accuracy , one of the q rounding bits ( qrs2 ), depending on whether k = 1 or k = 4 , that is dropped when right shifting the q2 component will be used as a carry - in to the adder - subtractor 132 when computing i3 in stage 3 . the value of this carry - in is computed as follows : if q2 is a negative number , then the rounding bit will be inverted before being used in adder - subtractor 132 and , if q2 is positive , then the rounding bit will be used as is . the carry - in bits ( qrs2 ) generated to perform a rounding function are computed by the exnor 108 logic for use in the third rotation by stage 3 . as shown in table 6 , q - 15 is dropped for the third rotation if the left justify flag is a logical 0 and if the left justify is a logical 1 , q - 17 is dropped . since no bits are dropped when q1 is right justified in stage 1 , the carry - in for the two as 96 , 98 is controlled by the sign of q1 ( q1sgn ). the nor gate 106 determines the left justify flag ( leftj2 ) for the next rotating stage . the outputs from stage 2 are the 20 bit i2 and q2 components , the sign history word ( sgnhst2 ), qrs2 bits for rounding , the left justify flag ( leftj2 ), the left justify count ( leftj1 ), the interim phase ( phase2 ) and the common exponent ( flexp2 ). referring now to fig3 b , stage 3 36 performs the computations for third cordic rotation and comprises six registers 110 - 120 for storing the outputs from stage 2 34 . registers 110 and 112 are 20 bit registers for storing the i2 and q2 components resulting from the second rotation . an 8 bit register 114 stores the qrs2 rounding bits and the sign history ( sgnhst2 ). a 4 bit register 116 stores the left justify flag ( leftj2 ) and the left justify count ( leftj1 ). a 20 bit register 118 stores the interim phase ( phase2 ) and an 8 bit register 120 stores the common exponent ( flexp2 ). in accordance with the algorithm the i2 and q2 components stored in registers 110 and 112 may have to be shifted left or right . this shifting is performed by four sets of multiplexers 122 - 128 similar to those in stage 2 which are coupled to the outputs of registers 110 and 112 . an additional 4 bit 2 : 1 multiplexer 130 selects one of the two rounding bit inputs ( qrs2 ) to stage 3 36 in order to provide a carry - in ( cin3 ) signal to adder - subtractor 132 to accomplish the rounding resulting from a dropped q2 bit after a right shift . the outputs of the multiplexers for each rotation are shown in tables 5 and 6 . the outputs of multiplexers 122 and 124 are coupled to adder - subtractor 132 and the outputs of multiplexers 126 and 128 are coupled to adder - subtractor 134 . the two adder - subtractors 132 , 134 compute the i3 and q3 components . a 4 bit adder 136 coupled to the outputs of register 116 adds one to the left justify count if the left justify flag ( leftj2 ) is set and provides the new left justified accumulated count ( lja3 ) to the next stage . the 14 . 04 deg rotation angle in this stage is added to or subtracted from the interim phase ( phase2 ) from stage 2 , which is stored in register 118 , by adder - subtractor 138 depending on the sign of q from the previous stage and the sign of the original i component ( i0 ). the nor gate 142 generates a the left justify flag ( leftj3 ) for the next rotation stage . the q sign generator 140 is coupled to the carry - out of adder - subtractor 134 and the q2sgn and generates the q3sgn for the sign history ( sgnhst4 ). the sign of the new q component ( q3 in stage 3 ) is the carry - out ( co ) of as 134 if the q component from the previous stage has not overflowed . a 2 to 1 selector in the q sign generator 140 selects between the carry - out ( co ) of as 134 and the previous q sign ( q2sgn ). the overflow condition is detected by exclusive - oring the q19 bit of the previous q component with the sign bit of the previous q . the result is used to make the selection for the new q sign bit . if the q component from the previous stage overflows , then the sign of the new q component is the same as the previous q sign . after each rotation , there can be conditions depending on the input i and q values , which may cause the sign of the q component to overflow to the 21st bit . the q19 bit of q component cannot be used as the sign bit because if an overflow condition exists , the vector will be rotated in the wrong direction in the following stage causing erroneous results . the q3sgn is also coupled to exnor gates 144 along with two lsb round bits ( rnd bits ) depending on the k value from the q3 outputs of adder - subtractor 134 for generating the ( qrs3 ) signal for the i adder - subtractor in the next stage 4 for rounding depending on the dropped bit after right shifting q3 . the outputs from stage 3 are the 20 bit i3 and q3 components , the qrs3 bits for rounding , the sign history word ( sgnhst3 ), the left justify flag ( leftj3 ), the left justify accumulated count ( lja3 ), the interim phase ( phase3 ) and the common exponent ( flexp3 ). referring now to fig3 b , 3c and 3d block diagrams of stages 4 , 5 , 6 , 7 and 8 ( 38 - 46 ) are shown with inputs and outputs . these stages are similar to stage 3 36 performing the calculations for the fourth rotation ( 7 . 13 deg ), fifth rotation ( 3 . 58 deg ), sixth rotation ( 1 . 79 deg ), seventh rotation ( 0 . 90 deg ) and the eighth rotation ( 0 . 45 deg ). the multiplexer outputs in each of these stages are shown in tables 5 and 6 . however , stage 8 46 has the additional signal input , fix / fl for fixed or floating point control . also , although this stage for the eighth rotation is similar to stage 3 , it does not have the nor gate to generate a left justify flag and the exnor gates to generate the rounding bits as in previous stages since there are no further rotation calculations . referring now to fig3 e and fig4 stage 9 48 is the final stage for output formatting and rounding the approximated magnitude to a 16 bit unsigned number . the outputs from stage 8 46 which are coupled to stage 9 and stored in registers 150 , 152 , 154 , 156 and 158 include the 20 bit i8 component which is the final approximated magnitude , the 6 bit left justify count ( fxexp8 ), the 10 bits of the sign history over the eight rotations ( sgnhst8 ) as shown in fig4 the 20 bit phase of the original vector ( phase8 ) and the 8 bit common exponent ( flexp8 ). if the initial vector input ( represented by i0 and q0 ) is a fixed point number , then i8 has to be right shifted by two times the left justify accumulated count ( lja8 ) which is stored in sections c , b and a of register 152 . each time a left justify was performed during the rotation , the i and q components were left justified twice . the shifting is accomplished by 8 : 1 multiplexers 160 in accordance with the select inputs s0 , s1 , s2 from register 152 . the upper 16 bits of the selected 17 bit output from multiplexer 160 ( i &# 39 ; 8 ) and the upper 16 bits of 1 / 8 i &# 39 ; 8 are added together by 16 bit adder 164 . the 17th bit of either i &# 39 ; 8 or 1 / 8 i &# 39 ; 8 is used as the rounding bit in accordance with or gate 162 which also provides the 15 bit unsgn signal to adder 164 . the purpose of adding 1 / 8 i &# 39 ; 8 to i &# 39 ; 8 is to make the growth factor equal to 1 . 8526 instead of 1 . 64 ( i . e . closer to 2 . 00 ). the 16 bit output from adder 164 is the unsigned magnitude . also in the fixed point case , the exponent stored in register 158 should have a value of zero after the eight rotation computations . if this exponent has a value of one , then an overflow has occurred after the first rotation due to an out of limit error in the 16 bit i or q component input values to the cmc 10 , and the user has a choice to output the magnitude as all ones when the full scale input is set to a logical 1 or to output the magnitude as is when the full scale input is set to a logical 0 and gate 168 receives the exponent bit and full scale signal and controls the 2 : 1 selector 166 for making the above choice . the calculated magnitude is one - half of what it should be if the exponent has a value of one so the user has to modify the magnitude externally . if the initial vector is described by block floating point numbers , then i8 is not shifted and the upper 17 bits are used for input to adder 164 . the left justify accumulated ( lsa8 ) count stored in register 152 from the previous stage is doubled by the manner in which the outputs from register 152 are used to adder - subtractor 172 and subtracted from the exponent stored in register 158 by adder - subtractor 172 so that the true exponent is determined . the final phase calculation is performed by adder - subtractor 170 which receives the phase8 word stored in register 156 and a 0 . 224 deg signal and provides a 12 bit word ( phase ) representing the phase of the polar coordinates of the initial vector in the binary angular measurement system ( bams ). if there was a ninth rotation stage , the 0 . 224 deg . input would be a next rotation angle , and since the sign of q after the eighth rotation indicates the direction of rotation , the 0 . 244 deg . input is used to obtain a more accurate phase result . the upper 15 bits of the adder output 164 can represent the magnitude if the unsign signal is set to a logic 1 so that the carry - in bit to adder 164 is added to the 15th bit of the adder 164 inputs . this option allows the cordic magnitude chip ( cmc ) 10 to be used in a system where a 16 bit signed magnitude is required ; hence , the 16 bit signed magnitude comprises the 15 bit output from the cmc 10 and a zero at the msb to represent the sign bit . the final outputs from stage 9 comprise the 16 bit approximated magnitude ( magdat ), the 12 bit phase ( phase ), the 8 bit exponent ( expdat ) and the 10 - bit sign history ( sgndat ). referring now to fig4 the bit portions of the accumulated sign history is shown . the sign bits ( sgndat ) out of stage 9 48 can be used to address a rom in order to obtain the actual phase value of the original vector . the phase of the complex vector is computed from the sign history as follows : the angles by which the vector is rotated during the eight rotations are 45 °, 26 . 57 °, 14 . 04 °, 7 . 13 °, 3 . 58 °, 1 . 79 °, 0 . 90 ° and 0 . 45 °. these angles are given by the equation : θ = tan - 1 ( 2 . sup . ( 1 - i )) where i is the rotation index . if a2 , a0 = 01 or a2 , a0 = 10 , then - 26 . 5 and so on for a 3 - ag . the phase of the vector is accurate to within ± 0 . 224 after eight rotations . referring now to fig1 and fig3 a - 3e , the pipeline registers in cmc 10 are designed using scannable registers connected as shift registers so that each pipeline register has a scan path . each scan path has a dedicated scanin 0 - 10 input and a scanout 0 - 10 output . all the test data is loaded serially into the pipeline registers using the scanin 0 - 10 inputs . the number of clock pulses required to load the test data depends on the width of the pipeline register under test . the pipeline registers can be tested by loading test data via the scanin 0 - 10 input and reading the outputs via the scanout 0 - 10 outputs . the computation circuitry within a stage can be tested by loading the test data into the pipeline register of a stage via the scanin 0 - 10 input and then the results are read via the scanout 0 - 10 output of the pipeline register in the following stage . the logic devices or their equivolent used to implement the function ad design shown in fig3 a - 3e is readily known to one skilled in the art . however , the cmc 10 was implemented with 1 . 25 micron cmos vlsi technology using macrocells from the rd , re , rf and rm libraries of the advanced device center of raytheon company in andover , mass . this concludes the description of the preferred embodiment . however , many modifications and alterations will be obvious to one of ordinary skill in the art without departing from the spirit and scope of the inventive concept . therefore , it is intended that the scope of this invention be limited only by the appended claims .