13.07.2015 Views

[Instruction] Contents

[Instruction] Contents

[Instruction] Contents

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Advanced Function <strong>Instruction</strong>FUN 26 D PSQRTSQUARE ROOTFUN 26 D PSQRTS : Source register to be taken square rootD : Register for storing result(square root value)S, D may combine with V, Z, P0~P9 to serveindirect address applicationOperandRangeWX WY WM WS TMR CTR HR IR OR SR ROR DR K XRWX0∣WX240WY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0∣R3839R3840∣R3903R3904∣R3967R3968∣R4167R5000∣R8071D0∣D409516/32-bitP0~P9S ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○V、Z• When operation control "EN" = 1 or "EN↑" ( P instruction) from 0 to 1, take the square root (rounding offnumbers after the decimal point) of the data specified by the S field, and store the result into the registerspecified by D.• While the S value is derived from the content of the register, if the value is negative, then the S value errorflag "ERR" will be set to 1, and do not execute the operation.X026DP.SQRTENS :2147483647ERR• The instruction at left calculates the square root of theconstant 2147483647, and stores the result in R0.D :R 0S K 2147483647 X0=D R1 R0 46340R1R02147483647 = 46340.95↑rounding off7-5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!