60
Calculating with Signed Binary Data
Section 1-7
CQM1H Operation Manual
. Refer to the
CX-Programmer Operation Manual:
C-series PCs
for details on using the CX-Programmer.
Input Instructions
Only 16-bit operands can be input for the following instructions: NEG(––),
ADB(50), SBB(51), MBS(––), and DBS(––). Refer to the
CQM1H Operation
Manual
for details on inputting instructions from the Programming Console.
1-7-4
Using Signed-binary Expansion Instructions
The following CQM1H instructions must be allocated function codes in the
instructions table before they can be used.
• 2’S COMPLEMENT – NEG(––)
• DOUBLE 2’S COMPLEMENT – NEGL(––)
• DOUBLE BINARY ADD – ADBL(––)
• DOUBLE BINARY SUBTRACT – SBBL(––)
• SIGNED BINARY MULTIPLY – MBS(––)
• DOUBLE SIGNED BINARY MULTIPLY – MBSL(––)
• SIGNED BINARY DIVIDE – DBS(––)
• DOUBLE SIGNED BINARY DIVIDE – DBSL(––)
Allocating Function
Codes
The procedure to using the Programming Console to allocate function codes
is shown in the
CQM1H Operation Manual
. Be sure that pin 4 of the CQM1H’s
DIP switch is turned ON to enable use of a user-set instruction table before
performing this operation.
1-7-5
Application Example Using Signed Binary Data
The following programming can be used to performed calculations such as
the following in the CQM1H:
((1234 + (–123)) x 1212 – 12345)
÷
(–1234) = –1081, Remainder of 232
000
=
04D2
←
1234
001
=
FF85
←
–123
LR00
=
04BC
←
1212
HR50
=
3039
←
12345
HR51
=
0000
←
DM1000
=
FB2E
←
–1234
DM1001
=
FFFF
←