d = s1 S/ s2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Chapter 5

Instruction Specifications

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Item number

Arithmetic instructions-11

 

 

Name

 

 

Signed binary division

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ladder format

 

 

 

 

 

 

Condition code

 

Processing time (s)

Remark

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R7F4

 

R7F3

 

R7F2

 

R7F1

R7F0

Average

Maximum

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d = s1 S/ s2

 

 

DER

 

ERR

 

SD

 

 

V

 

 

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

z

 

 

z

 

 

 

 

z

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

101

 

 

 

 

 

 

Command format

 

 

 

 

 

 

Number of steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Condition

 

 

 

 

Steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d = s1 S/ s2

 

 

 

Double word

6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bit

 

 

 

 

 

 

 

 

Word

 

Double word

 

Constant

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M

 

TD, SS,

 

 

 

 

 

WR,

 

 

 

 

DR,

 

 

 

 

Usable I/O

 

 

 

R,

 

 

 

 

 

 

 

 

 

 

 

 

 

Other

 

X

Y

L,

 

CU, CT

 

WX

WY

WM

 

TC

DX

DY

DM

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d

Substitution destination

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

{

{

 

 

 

 

s1

Dividend

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

{

{

{

 

{

 

 

s2

Divisor

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

{

{

{

 

{

 

 

Function

zDivides s1 by s2 as signed binary data, and substitutes the quotient into d in signed binary data. The remainder is set in the special internal output DRF016 signed binary data.

zThe DER flag is 1 if s2 is 0, and the operation is not performed. As long as s2 is not 0, it is 0 and the operation is performed.

zThe V flag is 1 when the quotient is a positive value and exceeds H7FFFFFFF. Otherwise, it is 0.

Eexample) DR0060 = DR0056 S/ DR0058

WR0061 WR0060 • • • WRF017 WRF016

DR0060

DRF016

 

WR0059

WR0058

WR0057

WR0056

DR0058

DR0056

zs1, s2 – 2147483648 to +2147483647 (decimal) H80000000 to H7FFFFFFF (hexadecimal)

Program example

X00000

 

 

LD X00000

 

 

 

DR0060 = DR0056 S/ DR0058

 

[

 

 

 

 

 

 

 

 

DR0060 = DR0056 S/ DR0058

 

 

 

 

 

 

 

 

 

 

]

 

 

 

 

 

Program description

z When input X00000 turns on, the value of DR0056 is divided by the value in DR0058, then substituted into DR0060 as signed binary data. The remainder is substituted into special internal output DRF016 as signed binary data.

5-56

Page 106
Image 106
Hitachi NJI-350B manual Arithmetic instructions-11, Signed binary division, 101, = s1 S/ s2 Double word