Binary Multiply - Mlb(52) - Omron CQM1H - PROGRAM Programming Manual

Programmable controllers; inner boards
Table of Contents

Advertisement

Binary Calculation Instructions
Example
00001
5-22-3 BINARY MULTIPLY – MLB(52)
Limitations
330
The following example shows a four-digit subtraction. When IR 00001 is ON,
the content of LR 00 and CY are subtracted from the content of IR 002 and
the result is written to HR 01.
CY is turned ON if the result is negative. If normal data is being used, a nega-
tive result (signed binary) must be converted to normal data using NEG(––).
Refer to 5-20-17 2'S COMPLEMENT – NEG(––) for details.
In the case below, the content of LR 00 (#7A03) and CY are subtracted from
IR 002 (#F8C5). Since the result is positive, CY is 0.
If the result had been negative, CY would have been set to 1. For normal
(unsigned) data, the result would have to be converted to its 2's complement.
Note For signed binary calculations, the status of the UF and OF flags indicate
whether the result has exceeded the signed binary data range (–32,768
(8000) to +32,767 (7FFF)).
Ladder Symbols
MLB(52)
Md
Mr
R
DM 6143 to DM 6655 cannot be used for R.
MLB(52) cannot be used to multiply signed binary data, but MBS(––) can be
used. Refer to 5-22-7 SIGNED BINARY MULTIPLY – MBS(––).
Address Instruction
00000
CLC(41)
00001
00002
SBB(51)
00003
002
LR00
HR 01
Mi: IR 002
F
8
C
5
Su: LR 00
CY = 0
7
A
0
3
(from CLC(41))
0
0
0
0
R: HR 01
7
E
C
2
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
@MLB(52)
Md
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Mr
R
Section 5-22
Operands
LD
OUT
TR
CLC(41)
SBB(51)
LR
HR
Operand Data Areas
Md: Multiplicand word (binary)
Mr: Multiplier word (binary)
R: First result word
IR, SR, AR, DM, EM, HR, LR
00001
1
002
00
01

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CQM1H - PROGRAM and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents

Save PDF