PIC Microcontroller Math Method

IEEE<>Microchip format conversion

From Microchip Application Note AN575:

;IEEE to MCHIP format conversion
	rl	AARGB0	;IEEE -> Microchip
	rl	AEXP
	rr	AARGB0

;MCHIP to IEEE format conversion
	rl	AARGB0	;IEEE <- MICROCHIP
	rr	AEXP
	rr	AARGB0

Format 8-bit biased exponent (exponent + 127)

Mantissa

AEXP
AARGB0(MSB)
AARGB1
AARGB2
IEEE754 32-bit sxxx xxxx y.xxx xxxx xxxx xxxx xxxx xxxx
Microchip 32-bit xxxx xxxy s.xxx xxxx xxxx xxxx xxxx xxxx
Microchip 24-bit xxxx xxxy s.xxx xxxx xxxx xxxx n/a

s - sign bit of mantissa

y - least significant bit of biased exponent