15
There are instructions provided to convert data in either direction between
BCD and hexadecimal. Refer to
5–15 Data Conversion
for details. Tables of
binary equivalents to hexadecimal and BCD digits are provided in the appen-
dices for reference.
Decimal points are also not stored directly in memory, although some of the
parameters contained in data areas have assumed decimal points. For ex-
ample, if a value is said to be in 3-decimal hexadecimal to the tenths of an
second and it occupies the rightmost three digits in a specified word (i.e., bits
00 through 11), the rightmost digit (bits 00 through 03) would contain tenths
of a second and the other two digits would contain the number of whole sec-
onds. If the value was 15.4 decimal, the corresponding BCD bits in memory
would be as shown below.
Bit number
Contents 000101010100
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
Digits Not used here. 1 5 4
3–3 IR Area
The IR area is used both to control I/O points and as work bits to manipulate
and store data internally. It is accessible both by bit and by word. Those
words that can be used to control I/O points are called I/O words. Bits in I/O
words are called I/O bits.
The number of I/O words varies between the P-type PCs. As shown, the IR
area is comprised of three main sections. These are input words, output
words and work words (work bits). Work bits are used in programming to ma-
nipulate data and control other bits. IR area work bits are reset when power
is interrupted or PC operation is stopped.
Word type I/O words I/O bits
Input IR 00
through IR
04
IR 0000 through IR 0415
Output IR 05
through IR
09
IR 0500 through IR 0915
Work IR 10
through IR
18
IR 1000 through IR 1807
I/O bits are assigned to input or output points as described in
Word Alloca-
tions
.
If a Unit brings inputs into the PC, the bit assigned to it is an input bit; if the
Unit sends an output from the PC, the bit is an output bit. To turn on an out-
put, the output bit assigned to it must be turned ON. When an input turns on,
the input bit assigned to it also turns ON. These facts can be used in the pro-
gram to access input status and control output status through I/O bits.
I/O bits that are not assigned to I/O points can be used as work bits, unless
otherwise specified in
Word Allocations
.
Input bits can directly input external signals to the PC and can be used in any
order in programming. Each input bit can also be used in as many instruc-
Decimal Points
I/O Words
Input Bit Usage
IR Area Section 3–3