d = s1 / s2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Chapter 5

Instruction Specifications

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Item number

 

Arithmetic instructions-9

 

 

Name

 

Binary division (BINARY DIVISION)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ladder format

 

 

 

 

 

 

Condition code

 

 

 

 

Processing time (s)

 

Remark

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R7F4

 

R7F3

 

R7F2

R7F1

R7F0

Average

Maximum

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d = s1 / s2

 

 

DER

 

ERR

 

SD

 

V

 

 

 

C

 

 

 

 

 

 

 

Upper case: W

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

55

 

 

Lower case: DW

 

 

 

 

 

 

 

 

 

 

z

 

 

z

 

z

 

 

 

z

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction format

 

 

 

 

 

 

Number of steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Condition

 

 

 

 

Steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d = s1 / s2

 

 

 

 

 

Word

 

 

 

 

4

 

110

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Double word

 

 

6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bit

 

 

 

 

 

 

 

Word

 

Double word

 

Constant

 

 

 

 

Usable I/O

 

 

X

Y

M

 

 

CU, CT

 

WX

WY

WM

TC

DX

DY

DM

 

 

Other

 

 

 

 

 

 

 

 

R,

 

 

TD, SS,

 

 

 

 

 

WR,

 

 

 

DR,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d

Substitution destination

 

 

 

 

 

 

 

 

 

 

{

 

{

{

 

{

{

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

s1

Dividend

 

 

 

 

 

 

 

 

 

 

 

{

{

 

{

{

{

{

{

 

{

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

s2

Divisor

 

 

 

 

 

 

 

 

 

 

 

{

{

 

{

{

{

{

{

 

{

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Function

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Divides s1 by s2 as the binary data and substitutes the quotient into d in binary. 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 s2 is “0,” and the operation is not performed. As long as s2 is not set to “0”, the flag is set to “0” and the operation is performed.

Example: WR0042 = WR0040/WR0041

Example: DR0047 = DR0045/DR0043

 

 

 

 

 

 

 

 

 

 

 

DR0047

DRF016

 

WR0042 . . .

WRF016

 

 

WR0048

 

WR0047 . . .

WRF017

 

WRF016

 

 

 

 

 

 

 

 

 

 

 

 

WR0041

WR0040

WR0041

 

WR0043

WR0046

 

WR0045

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DR0043

DR0045

 

 

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

LD X00000

 

X00000

 

 

 

 

 

 

 

 

 

 

 

 

WR0042 = WR0040 / WR0041

 

 

 

[

 

 

 

 

 

 

 

 

 

 

 

WR0042 = WR0040 / WR0041

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Program description

 

 

 

 

 

 

 

 

• When input X00000 is on, the value of WR0040 is divided by the value of WR0041, then substituted into WR0042. The remainder is substituted into special internal output WRF016.

5-54

Page 104
Image 104
Hitachi NJI-350B manual Arithmetic instructions-9, Binary division Binary Division, = s1 / s2 Word 110 Double word