Hitachi NJI-350B User Manual

Page 105

Advertising
background image

Chapter 5 Instruction Specifications

5-55

Item number

Arithmetic instructions-10

Name

BCD division

Ladder format

Condition code

Processing time (

µs)

Remark

R7F4

R7F3

R7F2

R7F1

R7F0

Average Maximum

d = s1 B/ s2

DER

ERR

SD

V

C

Upper case: W

z

z

z

z

152

Lower case: DW

Instruction format

Number of steps

Condition

Steps

d = s1 B/ s2

Words

4

253

Double word

6

Bit

Word

Double word

Usable I/O

X

Y

R,

M

TD, SS,

CU, CT

WX WY

WR,

WM TC DX DY

DR,

DM

C

onstant

Other

d

Substitution destination

{

{

{

{

{

s1 Dividend

{

{

{

{

{

{

{

{

s2 Divisor

{

{

{

{

{

{

{

{

Function

• Divides s1 by s2 as the BCD data, and substitutes the quotient into d in the BCD data. The remainder is set in the special

internal output WRF016 (DRF016 in the case of double word).

• The DER flag is set to “1” if s1 or s2 is an invalid BCD data or when s2 is set to “0”. In this case the operation is not

performed. If both s1 and s2 are valid BCD data and s2 is not set to “0,” the operation is performed.

WR0050

WR0049

WR0051

WRF016

. . .

Example: WR0051 = WR0049 B/ WR0050

• When s1, s2 are words:

0000 to 9999 (BCD)

• When s1, s2 are double words:

00000000 to 99999999 (BCD)

Notes

• The combinations of d, s1 and s2 are as follows:

d

s1

s2

Word

Word

Word

Double word

Double word

Double word

Program example

X00000

WR0051 = WR0049 B/ WR0050

LD X00000

[

WR0051 = WR0049 B/ WR0050

]

Program description

• When input X00000 is on, the value of WR0049 is divided by the value of WR0050, then substituted into WR0051 as the

BCD data.
The reminder is substituted into WRF016 as the BCD data.

d

=

s1

B/

. s2

Advertising