327
BCD Calculation Instructions Section 5-21
5-21-11 SQUARE ROOT – ROOT(72)
Limitations DM 6144 to DM 6655 cannot be used for R.
Description When the execution condition is OFF, ROOT(72) is not executed. When the
execution condition is ON, ROOT(72) computes the square root of the eight-
digit content of Sq and Sq+1 and places the result in R. The fractional portion
is truncated.
Flags ER: Sq is not BCD.
Indirectly addressed EM/DM word is non-existent.
(Content of *EM/*DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
EQ: ON when the result is 0.
Example The following example shows how to take the square root of an eight digit
number. The result is a four-digit number, with the remainder rounded off. and
then round the result.
In this example,
√63250561 = 7953.0221..., which is rounded off to 7953.
Sq: First source word (BCD)
IR, SR, AR, DM, EM, HR, TIM/CNT, LR
R: Result word
IR, SR, AR, DM, EM, HR, LR
Ladder Symbols Operand Data Areas
ROOT(72)
Sq
R
@ROOT(72)
Sq
R
R
Sq+1 Sq
00000
@ROOT(72)
DM 0000
001
DM 0001 DM 0000
6325 05 61
63,250,561 = 7953.0221
001
79 5 3
Address Instruction Operands
00000 LD 00000
00001 @ROOT(72)
DM 0000
001
(The remainder is rounded off.)