DL205 User Manual, 4th Edition, Rev. B
5–134
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
Binary to Real Conversion (BTOR)
The Binary-to-Real instruction converts a binary value in the
accumulator to its equivalent real number (floating point)
format. The result resides in the accumulator. Both the binary
and the real number may use all 32 bits of the accumulator.
NOTE:
This instruction only works with unsigned
binary, or decimal
values. It will not work with signed
decimal values.
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 BTOR instruction converts the binary
value in the accumulator the equivalent real number format. The binary weight of the MSB is
converted to the real number exponent by adding it to 127 (decimal). Then the remaining
bits are copied to the mantissa as shown. 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.
BTOR
4 8 A E
4 8 2 0
V1500
V1501
LDD
V1400
X1
Load the value in V1400 and
V1401 into the accumulator
BTOR
Convert the binary value in
the accumulator to the real
number equivalent 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.
0 0 0 5
7 2 4 1
V1400
V1401
Binary Value
Copy the real value in the
accumulator to V1500 and V1501
OUTD
V1500
The real number (HEX) value
copied to V1500
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 18)
127 + 18 = 145
145 = 128 + 16 + 1
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
Direct
SOFT
ý
ý
þ
þ
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.
DS
Used
HPP Used