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

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
num1
num0
exp4
exp3
exp2
exp1
exp0
table_mask
table_log
num
exp
Anti-Log Table ($D000-$DFFF)
The anti-log table contains data used to convert base-2 exponents into unsigned numbers.
The anti-log table is comprised of 2,048 unsigned words which are each the lower 16-bits of a
17-bit mantissa (the 17th bit is implied and must be set separately). To use this table, shift the
top 11 bits of the exponent fraction (bits 15..5) into bits 11..1 and isolate. Add $D000 for the
anti-log table base. Read the word at that location into the result – this is the mantissa. Next,
shift the mantissa left to bits 30..15 and set bit 31 – the missing 17th bit of the mantissa. The
last step is to shift the result right by 31 minus the exponent integer in bits 20..16. The
exponent is now converted to an unsigned number.
Here is a routine that will convert a base-2 exponent into an unsigned number using the anti-
log table:
' Convert exponent to number
'
' on entry: exp holds 21-bit exponent with 5 integer bits and 16 fraction bits
' on exit: num holds 32-bit unsigned value
'
expnum
offset
Page 422 · Propeller Manual v1.0
long
long
long
long
long
long
long
long
long
long
long
mov
shr
and
or
rdword num,num
shl
or
shr
xor
shr
$C0000000
$80000000
$00100000
$00080000
$00040000
$00020000
$00010000
$0FFE
$C000
0
0
num,exp
num,#15-11
num,table_mask
num,table_antilog
num,#15
num,num0
exp,#20-4
exp,#$1F
num,exp
'table offset mask
'log table base
'input
'output
'get exponent into number
'justify exponent fraction as word
'isolate table offset bits
'add anti-log table address
'read mantissa word into number
'shift mantissa into bits 30..15
'set top bit (17th bit of mantissa)
'shift exponent integer into bits 4..0
'inverse bits to get shift count
'shift number into final position

Related parts for 122-32000