Installation manual
Publication 1747-RM001G-EN-P - November 2008
4-12 Math Instructions
Clear (CLR)
Use the CLR instruction to set the destination value of a word to zero.
Updates to Arithmetic Status Bits
The arithmetic status bits are found in Word 0, bits 0 to 3 in the status file.
After an instruction is executed, the arithmetic status bits in the status file are
updated.
Square Root (SQR)
When this instruction is evaluated as true, the square root of the absolute value
of the source is calculated and the rounded result is placed in the destination.
The instruction calculates the square root of a negative number without
overflow or faults. In applications where the source value may be negative, use
a comparison instruction to evaluate the source value to determine if the
destination may be invalid.
Updates to Arithmetic Status Bits
The arithmetic status bits are found in Word 0, bits 0 to 3 in the status file.
After an instruction is executed, the arithmetic status bits in the status file are
updated.
CLR
Clear
Dest N7:27
0<
CLR
Output Instruction
Fixed SLC
5/01
SLC
5/02
SLC
5/03
SLC
5/04
SLC
5/05
• •••••
Table 4.10 Processor Function
With this Bit The Processor
S:0/0 Carry (C) always resets.
S:0/1 Overflow (V) always resets.
S:0/2 Zero (Z) always sets.
S:0/3 Sign (S) always resets.
SQR
Square Root
Source N7:28
0<
Dest N7:29
0<
SQR
Output Instruction
Fixed SLC
5/01
SLC
5/02
SLC
5/03
SLC
5/04
SLC
5/05
••••
Table 4.11 Processor Function
With this Bit The Processor
S:0/0 Carry (C) is reserved (integer). For floating point, it is always cleared.
S:0/1 Overflow (V) always resets.
S:0/2 Zero (Z) sets when destination value is zero.
S:0/3 Sign (S) always resets.