GE GFK-0804B 用户手册
4
4-28
Micro PLC Programmer’s Guide – April 1994
GFK-0804B
Division (DIV)
The Division function divides one number by another, and places the result in two
consecutive registers.
consecutive registers.
R1
B
R2
=
R3
R4
R5
R1
B
=
R3
R4
46136
The numbers can be either constants or the contents of register locations.
When this function is programmed, only the first register of a pair is programmed; that
is, the first register of the pair where the result of the division will be placed, and the first
register of the number to be divided, (unless it is a constant). Although only the first
register of a pair is actually specified, it is important not to use the second register for
any other purpose in the program.
is, the first register of the pair where the result of the division will be placed, and the first
register of the number to be divided, (unless it is a constant). Although only the first
register of a pair is actually specified, it is important not to use the second register for
any other purpose in the program.
Examples:
Whole # Remainder
R1
R2
R3
R4
R5
00000 01000 / 00010 = 00100 00000 ( 100 plus no remainder)
00000 01000 / 00012 = 00083 00004 ( 83 plus 4 remainder)
00000 01000 / 00012 = 00083 00004 ( 83 plus 4 remainder)
00001 01000 / 00002 = 33268 00000 ( 66536 / 2 = 33268, no remainder)
00010 01000 / 01000 = 00656 00360 (( 655360+1000) / 1000) = 656 plus
00010 01000 / 01000 = 00656 00360 (( 655360+1000) / 1000) = 656 plus
remainder of 360)
00000 01000 / 03000 = 00000 01000 ( 1000 / 3000 = 0, remainder 1000)
10000 00000 / 00010 = 00000 00000 (number is too large to represent as
10000 00000 / 00010 = 00000 00000 (number is too large to represent as
a whole number plus a remainder)
00000 01000 / 00000 = LAST RESULT (but C1023 turns on to indicate
that a divide by 0 was incorectly attempted.