Chapter 5

Instruction Specifications

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Item number

 

Arithmetic instructions-8

 

 

Name

 

 

Signed binary multiplication (SIGNED BINARY

 

 

 

 

 

 

MULTIPLICATION)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

 

z

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

143

 

 

 

 

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

Multiplicand

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

{

 

{

{

 

{

 

 

 

s2

Multiplier

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

{

 

{

{

 

{

 

 

 

Function

zMultiplies s1 and s2 as signed binary data, and substitutes the result into d+1 (upper digit) and d (lower digit) as signed binary.

zThe DER flag is 1 if d+1 exceeds the usable I/O range (in this case only the lower digit word is substituted), and 0 when it does not.

 

 

 

 

31

 

0

 

 

Example) D R0031 = DR0026 S

⋅ DR0028

 

 

 

 

 

 

s1

 

 

 

 

 

 

 

 

 

 

 

Sign

 

 

 

 

WR0027

 

WR0026

s1

 

 

 

 

31

 

0

 

 

 

 

 

DR0026

 

 

 

 

 

 

Sign

 

 

s2

 

 

s2

 

 

 

 

 

 

WR0029

 

WR0028

 

 

 

 

 

 

 

 

 

 

 

63

 

3231

 

0

 

 

 

 

DR0028

 

 

 

 

 

d+1

 

d

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

WR0034

 

WR0033

WR0032

 

WR0031

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Sign bit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DR0033

DR0031

 

The sign of the operation result is entered in the most significant bit.

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

Cautionary notes

zThe operation result is always assigned to d and d+1. Be sure not to use word or double word d+1 as the I/O of other functions.

Program example

X00000

 

 

LD

X00000

 

 

 

DR0031 = DR0026 S* DR0028

 

[

 

 

 

 

 

 

 

 

 

 

DR0031 = DR0026 S * DR0028

 

 

 

 

 

 

 

 

 

 

]

 

 

 

 

 

 

 

Program description

z When input X00000 turns on, the product of the values in DR0026 and DR0028 is substituted into DR0031 as signed binary data.

d = s1 S x s2

5-53

Page 103
Image 103
Hitachi NJI-350B manual Signed binary multiplication Signed Binary, 143, Multiplication