122-32000 Parallax Inc, 122-32000 Datasheet - Page 421

MANUAL PROPELLER

122-32000

Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-32000

Accessory Type
Manual
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
exponent. By reading the word at $C800, we get the value $95C0. Adding this into the partial
result yields $001E95C0 – that's $60000000 in exponent form. Note that bits 20..16 make up
the integer portion of the exponent, while bits 15..0 make up the fractional portion, with bit
15 being the ½, bit 14 being the ¼, and so on, down to bit 0. The exponent can now be
manipulated by adding, subtracting, and shifting. Always insure that your math operations
will never drive the exponent below 0 or cause it to overflow bit 20. Otherwise, it may not
convert back to a number correctly.
Here is a routine that will convert an unsigned number into its base-2 exponent using the log
table:
' Convert number to exponent
'
' on entry: num holds 32-bit unsigned value
' on exit: exp holds 21-bit exponent with 5 integer bits and 16 fractional bits
'
numexp
offset
numexp_ret
num4
num3
num2
if_z
if_z
if_z
if_z
if_z
mov
test
muxnz
shl
test
muxnz
shl
test
muxnz
shl
test
muxnz
shl
test
muxnz
shl
shr
and
add
rdword num,num
or
ret
long
long
long
exp,#0
num,num4
exp,exp4
num,#16
num,num3
exp,exp3
num,#8
num,num2
exp,exp2
num,#4
num,num1
exp,exp1
num,#2
num,num0
exp,exp0
num,#1
num,#30-11
num,table_mask
num,table_log
exp,num
$FFFF0000
$FF000000
$F0000000
wz 'get integer portion of exponent
wz
wz
wz
wz
'clear exponent
'while top-justifying number
'justify sub-leading bits as word
'isolate table offset bits
'add log table address
'read fractional portion of exponent
'combine fractional & integer portions
'91..106 clocks
'(variance due to HUB sync on RDWORD)
Propeller Manual v1.0 · Page 421

Related parts for 122-32000