Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 453

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Conversion Instructions
Description
Note
420
Area
Indirect DM addresses
in BCD
Constants
Data Registers
Index Registers
Indirect addressing
using Index Registers
BINS(470) converts signed BCD data to signed binary data. First the signed
BCD data format and range in word S are checked against the setting in the
control word (C). If the source data is correct, the signed BCD data in S is
converted to signed binary and output to D. If the source data is incorrect, the
Error Flag will be turned ON and the instruction will not be executed.
Signed BCD format
specified in C
Signed BCD
Signed binary
When the converted data is negative, it will be output as the 2's complement
and the Negative Flag be will turned ON. NEG(160) can be used to determine
the absolute value of a negative signed binary number. Refer to 3-11-5 2'S
COMPLEMENT: NEG(160)395 for details.
A value of –0 in the source data will be treated as 0 and will not cause an
error. Also, the status of bits 13 to 15 of S is not checked when C=0000.
Some Special I/O Units output signed BCD data. Calculations using this data
will normally be easier if it is first converted to signed binary data with
BINS(470).
The control word specifies the signed BCD format as shown below.
C = 0000 (Input Data Range: –999 to 999 BCD)
C = 0001 (Input Data Range: –7999 to 7999 BCD)
C
*D0 to *D32767
#0000 to #0003
---
(binary)
DR0 to DR15
---
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
3 digits BCD, 12 bits
Sign bit (0: Positive; 1: Negative)
Status of 3 bits: 0
3 digits BCD, 12 bits
3 bits of digit 4 (0 to 7)
Sign bit (0: Positive; 1: Negative)
Section 3-11
S
D

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents