Bcd Multiply - Mul(32) - Omron CQM1H - PROGRAM Programming Manual

Programmable controllers; inner boards
Table of Contents

Advertisement

BCD Calculation Instructions
5-21-5 BCD MULTIPLY – MUL(32)
320
The first and second subtractions for this diagram are shown below using
example data for 010 and DM 0100.
Note The actual SUB(31) operation involves subtracting Su and CY from 10,000
plus Mi. For positive results the leftmost digit is truncated. For negative results
the 10s complement is obtained. The procedure for establishing the correct
answer is given below.
First Subtraction
IR 010
DM 0100
CY
HR 10
CY
Second Subtraction
0000
HR 10 –7577
CY
–0
HR 10 2423
CY 1
In the above case, the program would turn ON HR 1100 to indicate that the
value held in HR 10 is negative.
Ladder Symbols
MUL(32)
Md
Mr
R
Address Instruction
00000
LD
00001
OUT
TR
00002
CLC(41)
00003
@SUB(31)
DM
HR
00004
AND
00005
CLC(41)
00006
@SUB(31)
#
HR
HR
00007
LD
TR
00008
LD
00009
OR
HR
00010
AND LD
00011
OUT
HR
1029
–3452
–0
7577
(1029 + (10000 – 3452))
1
(negative result)
(0000 + (10000 – 7577))
(negative result)
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
@MUL(32)
Md
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Mr
R
Section 5-21
Operands
00002
0
010
0100
10
25504
0000
10
10
0
25504
1100
1100
Operand Data Areas
Md: Multiplicand (BCD)
Mr: Multiplier (BCD)
R: First result word
IR, SR, AR, DM, EM, HR, LR

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents