Multiply – Rockwell Automation 1336T Function Block Prog. Manual, Series A/B User Manual

Page 98

Advertising
background image

Function Block Library

4–36

1336 FORCE — 5.9 August 1995

Bit 31 is the sign bit, the most significant bit for 32 bit values. For 16
bit values, bit 15 (the sign bit) is the most significant bit.

EXAMPLES

Example 1

EXAMPLE 2

In 1

32767

3

In 2

32767

32767

Out LSW

1

32765

Out MSW

16383

1

OUTPUT VALUE

1073676289

98301

Example 1 — Double Word Output Value = 1073676289 = 32767

×

32767

16383

dec

1

dec

3FFF

hex

0001

hex

Most Significant Word

Node 3

Least Significant Word

Node 2

Important:

The output range of the multiplied values can be critical. Should only one
output word (LSW node) of the MULTIPLY block be used, it will appear to
roll over or under if the product exceeds

±

32767.

+ 16383 (Upper Waveform)

"

t1

"

MULTIPLY
Out LSW

"

MULTIPLY input

"

+ 32767 (Upper Waveform)

"

0 (Upper Waveform)

"

0 (Lower Waveform)

"

"

– 32767 (Upper Waveform)
+ 32767 (Lower Waveform)

– 32767 (Lower Waveform)

"

In the Upper Waveform above, the MULTIPLY In1 input (node 0), is
multiplied by an In 2 (node 1) value of 2. As the In1 value increases beyond
16383 (time t1), the product increases beyond + 32767. Although the Out
LSW output (node 2) has a range of 0 to 65535 (0 to FFFF

hex

), the analog

input has a single word signed range of

±

32767. When the input reaches

16385, the multiplied output of 32770 (8002

hex

) is interpreted by the signed

analog output parameter as having a value of – 32766 which makes it
appear to roll over.

MULTIPLY

(continued)

Advertising