DL205 User Manual, 4th Edition, Rev. B
5–135
Chapter 5: Standard RLL Instructions - Number Conversion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Real to Binary Conversion (RTOB)
The Real-to-Binary instruction converts the real number in
the accumulator to a binary value. The result resides in the
accumulator. Both the binary and the real number may use all
32 bits of the accumulator.
NOTE
1
:
The decimal portion of the result will be rounded down (14.1
14 or - 14.1
-15).
NOTE
2
:
If the real number is negative, it becomes a signed decimal value.
In the following example, when X1 is on, the value in V1400 and V1401 is loaded into the
accumulator using the Load Double instruction. The RTOB instruction converts the real
value in the accumulator the equivalent binary number format. The value in the accumulator
is copied to V1500 and V1501 using the Out Double instruction. The handheld programmer
would display the binary value in V1500 and V1501 as a HEX value.
RTOB
Sta
nd
ard
R
LL
Ins
tru
ctio
ns
V1400
V1401
Direct
SOFT
LDD
V1400
X
1
Load the value in
V1400
and
V1401
into the accumulator
RTOB
Convert the real number in
the accumulator to binary
format.
0 1 1 1 0 0 1 0 0 0 1 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
1
Acc.
V1
5
00
V1
5
01
Binary
V
alue
Copy the real value in the
accumulator to
V1
5
00
and
V1
5
01
OUTD
V1
5
00
0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0
0 1 0 0 1 0 0 0 1 0 1 0 1 1 1 0
Acc.
Real Number Format
Mantissa (23 bits)
Exponent (8 bits)
Sign Bit
2 (exp
1
8)
1
27 +
1
8 =
14
5
1
28 +
1
6 +
1
=
14
5
STR
$
SHFT
ANDST
L
3
D
3
D
SHFT
1
B
MLR
T
ORN
R
ENT
OUT
GX
SHFT
3
D
1
B
ENT
INST#
O
ENT
1
B
4
E
0
A
0
A
ENT
1
B
5
F
0
A
0
A
Handheld Programmer Keystrokes
4
8
2
8
4
E
A
0
0 0
4
2
7
5
0
1
The binary number copied to
V1400
ý
ý
þ
þ
230
240
2
5
0
-1
2
6
0
Discrete Bit Flags
Description
SP63
On when the result of the instruction causes the value in the accumulator to be zero.
SP70
On anytime the value in the accumulator is negative.
SP72
On anytime the value in the accumulator is a valid floating point number.
SP73
On when a signed addition or subtraction results in an incorrect sign bit.
SP75
On when a number cannot be converted to binary.
DS
Used
HPP Used