Addition, subtraction, multiplication, and division are the four basic operations included in the arithmetic operations. These instructions use the contents of two word locations and perform the desired function.
The arithmetic instructions are programmed in the output portion of the ladder and use either one or two data words to store the result. The add and subtract instructions use one word. Multiply and divide need two words for the computed result.
The ADD instruction performs the addition of two values stored in two different memory locations. The processor uses a GET (data transfer) instruction to access the two values. The result is stored in the word address referenced by the ADD coil. The input conditions should be programmed before the values are accessed in the addition rung, if the addition operation is enabled only when the rung conditions are true.
It performs the subtraction operation of two registers. As in addition, if there is a condition to enable the subtraction, it should be programmed before the values are accessed in the rung. The subtraction result register will use a minus sign to represent a negative result.
Multiplication operation is performed when MUL is defined. It uses two registers to hold the results of the operation between two operand registers. The two registers are referenced by two output coils. It should be programmed before the two operands are accessed in the multiplication rung, if there is a condition to enable the operation.
The DIV instruction performs the quotient calculations of two numbers. The result of the division is held in two result registers as referenced by the output coils. The first register generally holds the integer, while the second result register holds the decimal fraction. A typical math application in programmable controller systems is to scale process analog input signals.