4

Using Division and Multiplication Functions Together

If a Multiplication produces a result that is too large to use easily (the results are greater than 65535, and occupy two registers), you can divide the Multiplication result to scale the result to use smaller numbers.

For example:

Multiply:

R100

1000

x

R101

1000

=

46137

R102 R103

00015 16960 = 15*65536 + 16960 = 1,000,000

Divide:

R102

R103

 

R104

 

R105

 

R106

00015

16960

/

1000

=

01000

 

00000

 

 

 

 

 

 

 

 

 

 

1,000,000

/

1000

=

1000

with no remainder

In this example, R105 would contain the whole number result of the division, and R106 would contain the remainder.

Programming Software Instructions

1.Select Math/Move (F5).

2.Select /DIV (F4) from the Math/Move function keys.

3.First, enter the number to be divided. This can be either a constant, or a two-registerlocation that will contain the number to be added. For example: R001 above represents the two-register location R001 and R002. Press the Enter key.

4.Enter the number to divide by. This can also be a constant or a one-registerlocation. Press the Enter key.

5.Enter the first register of a two register location to contain the result. For example, if you entered R004 as shown above, the result of the division would be be located in R004 and R005. Press the Enter key.

GFK-0804B

Chapter 4 The Micro PLC Instruction Set

4-29

Page 70
Image 70
GE GFK-0804B manual Using Division and Multiplication Functions Together, Divide