This is a multi-part message in MIME format. ------=_NextPart_000_0090_01C561C7.D3449300 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Mark Bellamy wrote: > It seems very difficult to caculate the binary represention of a > number. For instance, how you represent .5 in the "24 bit reduced > format"? Can someone walk me through the conversion process. I see > there is appendix A there is an algroithm to do it. But wow, it would > take about 30 minutes to manually do it. If the Microchip format is the same as my 24 bit floating point format, you can use my conversion utilities FPH and HFP. These are part of the PIC development environment at http://www.embedinc.com/pic. I've attached a description of my 24 bit floating point format. > What is the point in ADC if you can't use floating point? Huh? You seriously can't think of ways of using the unsigned integer value from the A/D directly? > I don't > see how ADC can be usful without a multiply and divide instrution to > calcuate the actual voltage value from the 10 bit representation. Why are units of volts special? Why can't you use the measured EMF in the units the A/D gives you? About the only reason I can see for the PIC converting to volts is if it has to handle direct interaction with a human where units of volts are used explicitly. Even then, floating point is most likely unnecesary. If the PIC is driving a 4 digit display showing volts with 3 decimal places, then integer millivolts would be more useful. Chances are good you don't really need floating point to manipulate your A/D readings. What is your application? ------=_NextPart_000_0090_01C561C7.D3449300 Content-Type: text/plain; format=flowed; name="fp24.txt"; reply-type=original Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="fp24.txt" ; 24 bit floating point format: ; ; 24 bits are used to describe a floating point value using 1 sign = bit ; 7 exponent bits, and 16 mantissa bits as follows: ; ; | byte 2 | byte 1 | byte 0 = | ; | | | | | | = | ; 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 = 1 0 ; = ------------------------------------------------------------------------ ; | | | = | ; | S| EXP | MANT = | ; | | | = | ; = ------------------------------------------------------------------------ ; ; S - Sign bit. 0 for positive or zero value, 1 for negative = value. ; ; EXP - Exponent. The overall floating point value is the = mantissa ; value times 2 ** (EXP - 64) when EXP is in the range from 1 to = 127. ; The special EXP value of 0 is only used when the overall = floating ; point value is 0.0. ; ; MANT - Mantissa. Except for the special case when the overall ; floating point value is 0, the mantissa represents a fixed point ; value such that 1 <=3D mantissa < 2. This means the integer = part of ; the mantissa is always 1. Since this integer part is always the ; same, it is not stored. The MANT field contains the 16 most ; significant fraction bits of the mantissa value. Therefore ; MANT =3D (mantissa - 1) * 65536. An overall floating point = value of ; 0.0 is indicated by EXP =3D 0. In that case MANT is reserved, = and ; should be 0. ; ; Consider the following examples: ; ; 0.0 --> 000000h ; ; S =3D 0 (positive or zero) ; EXP =3D 0 (special case for 0.0) ; MANT =3D 0 (special case for 0.0) ; ; 1.0 --> 400000h ; ; S =3D 0 (positive or zero) ; exponent =3D 0, EXP =3D 64 --> 40h ; mantissa =3D 1.0, MANT =3D 0 ; ; -3.141593 --> C19220h ; ; S =3D 1 (negative) ; exponent =3D 1, EXP =3D 65 --> 41h ; mantissa =3D 1.570797, MANT =3D 37,408 --> 9220h ; ; Unless otherwise specified, overflow and underflow values are = silently ; clipped to the maximum magnitude (7FFFFF for positive, FFFFFF for = negative) ; and zero, respectively. ------=_NextPart_000_0090_01C561C7.D3449300 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist ------=_NextPart_000_0090_01C561C7.D3449300-- ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com