Arithmetic commands, 4 arithmetic commands – HEIDENHAIN TNC 122 Technical Manual User Manual
Page 53

52
TNC 122
12 PLC Description
4/97
Word execution with the EXCLUSIVE OR command
Operands: B, W, D, K
The contents of the Word Accumulator and the contents of the operand (B, W, D, K) are gated with
EXCLUSIVE OR. In accordance with the different sizes of operand (B = 8 bits; W = 16 bits;
D = K = 32 bits), 8, 16 or 32 bits will be influenced in the Accumulator.
Thus: Bit 0 of the Accumulator is gated with bit 0 of the operand
Bit 1 of the Accumulator is gated with bit 1 of the operand, and so on.
The result of the operation is stored in the Word Accumulator.
EXCLUSIVE OR NOT (XON)
Logic execution with the EXCLUSIVE OR NOT command
Operands: M, I, O, T, C
This command functions in different ways depending on its position in the program:
a) At the start of a logic chain this command functions as a LN command. That is, the complement
of the operand is loaded into the Logic Accumulator.
b) Within a logic chain the contents of the Logic Accumulator and the logic state of the operand (M,
I, O, T, C) are gated with EXCLUSIVE OR NOT. The result of the operation is stored in the Logic
Accumulator.
Word execution with the EXCLUSIVE OR NOT command
Operands: B, W, D, K
The contents of the Word Accumulator and the contents of the operand (B, W, D, K) are gated with
EXCLUSIVE OR NOT. In accordance with the different sizes of operand (B = 8 bits; W = 16 bits; D =
K = 32 bits), 8, 16 or 32 bits will be influenced in the Accumulator.
Thus: Bit 0 of the Accumulator is gated with bit 0 of the operand
Bit 1 of the Accumulator is gated with bit 1 of the operand, and so on.
The result of the operation is stored in the Word Accumulator.
12.2.4 Arithmetic Commands
ADDITION (+)
Operands: B, W, D, K
With arithmetic functions the operand is first expanded to the size of the Accumulator (32 bits). Then
the contents of the operand are added to the Word Accumulator. The result of the operation is
stored in the Word Accumulator and can be processed further.
SUBTRACTION (–)
Operands: B, W, D, K
With arithmetic functions the operand is first expanded to the size of the Accumulator (32 bits). Then
the contents of the operand are subtracted from the contents of the Word Accumulator. The result
of the operation is stored in the Word Accumulator and can be processed further.