4 division, 4 division (/) – HEIDENHAIN TNC 335 Technical Manual User Manual
Page 439

7-60
TNC 360
3 Commands
8/95
3.4.4 DIVISION (/)
/
Abbreviation for the PLC Editor:
/ (DIVIDE)
Logic
Byte/Word
Double
Constant
Execution time [µs] *) **)
----
20.2/19.8
---
19.8
Number of bytes
----
16
14
16
*) see Multiplication
**) An error in division and modulo (divisor = 0) results in a execution time of 3.8 µs.
An error condition (Divisor = 0) results in an execution time of 1.0 to 1.8 µs.
Operands: B, W, D, K
Operation:
With arithmetic functions the operand is firstly expanded to the size of the Accumulator (32 bits) .
Then the contents of the Word Accumulator are divided by the contents of the operand. The result
of the operation is stored in the Word Accumulator and may be processed further. If division by 0 is
attempted, the Marker M3169 is set, otherwise it is reset.
Example:
A Constant is to be divided by the value stored in Word W6 . The result is then assigned to
Doubleword D8.
Initial state:
Constant
= 100
(dec)
Word
W6 = 20
(dec)
Doubleword D8
= ?
In the interests of clarity the contents of the Accumulator and the operand are shown in decimal
notation. The 10 bit wide Accumulator allows the entry of the highest possible Accumulator
contents (2 147 483 647).
Line Instruction
Accumulator Contents
Operand Contents
x
x x x
x x x
x x x
1
L K100
1 0 0
2
/ W6
5
2 0
3
= D8
5
5
Line 1:
The Constant is loaded into the Accumulator.
Line 2:
The contents of the Accumulator are divided by the contents of Word W6.
Line 3:
The result is assigned to Doubleword D8.