Searching \ for '[PIC]: value + 1/2 LSB' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'value + 1/2 LSB'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: value + 1/2 LSB'
2002\09\06@070214 by Vasile Surducan

flavicon
face
Hi piclisters,
I have a problem trying to understood which is the best way
for computing the:

value + 1/2 LSB, where
value is an 8 bit unsigned integer

BTW, the truth is I have no ( good ) ideea how to do it :-(

thank's in advance,
Vasile

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\09\06@072446 by Laszlo Kohegyi

flavicon
face
Hi Vasile,

>value + 1/2 LSB, where value is an 8 bit unsigned integer

That term mostly used in the analog domain. If you have
a 0 - 10V range and 8 bit A/D or D/A, 1 LSB = (10-0)/256=39mV

1/2 LSB = (10-0)/512=19.5mV

Best regards
Les

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\09\06@073525 by Olin Lathrop

face picon face
> I have a problem trying to understood which is the best way
> for computing the:
>
> value + 1/2 LSB, where
> value is an 8 bit unsigned integer

I don't understand the question.  There is no way to express 1/2 LBS in an
integer.  To do that you need at least one fraction bit.  I assume you mean
how to convert an 8 bit integer to some representation so that the value is
1/2 original LSB higher?  If the original value uses all 8 bits, then the
new representation will require at least one more bit.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\09\09@021854 by Vasile Surducan

flavicon
face
On Fri, 6 Sep 2002, Olin Lathrop wrote:

> > I have a problem trying to understood which is the best way
> > for computing the:
> >
> > value + 1/2 LSB, where
> > value is an 8 bit unsigned integer
>
> I don't understand the question.  There is no way to express 1/2 LBS in an
> integer.  To do that you need at least one fraction bit.  I assume you mean
> how to convert an 8 bit integer to some representation so that the value is
> 1/2 original LSB higher?  If the original value uses all 8 bits, then the
> new representation will require at least one more bit.
>
>
 Exactly that's I need. I need a general representation for the new
value, where "value" is the integer and 1/2 LSB is 1/2LSB from that value.
So I think I need to convert the integer into an fractional representation
As I understood I will need two bytes for that representation.
9 bit are not enough. There is somewhere a good book dealing with
mathematic representation inside of an 8 bit microcontroller ?
I'm interested in something which must cover all tricks ( integer, signed,
unsigned, fractional, and maybe floating )


Thank you,
Vasile

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\09\09@080708 by Olin Lathrop

face picon face
part 1 1333 bytes content-type:text/plain; (decoded 7bit)

>   Exactly that's I need. I need a general representation for the new
> value, where "value" is the integer and 1/2 LSB is 1/2LSB from that value.
> So I think I need to convert the integer into an fractional representation
> As I understood I will need two bytes for that representation.
> 9 bit are not enough.

Why not?  If the orignal number is an 8 bit integer, then you can always
express that value + 1/2 in a 9 bit fixed point number.

> There is somewhere a good book dealing with
> mathematic representation inside of an 8 bit microcontroller ?
> I'm interested in something which must cover all tricks ( integer, signed,
> unsigned, fractional, and maybe floating )

I think you mostly just want to use fixed point numbers.  You don't need a
book for that, just some extra bits below the imagined binary point.  Fixed
point numbers are still integers as far as the machine is concerned.  The
difference is in how YOU interpret them.

Floating point is a different story.  Again, I'm not sure about the question
you are asking.  I've attached the header comments for my PIC routine that
converts a fixed point number to floating point.  It also details the
floating point format.  Perhaps it will help.  If not, try asking more
specific questions.



part 2 2712 bytes content-type:text/plain;
(decoded quoted-printable)

;   Subroutine FP24FLT
;
;   Convert the signed fixed point number in REGA to 24 bit floating point
;   in the low 24 bits of REGA.  REG8 is a signed value indicating the number
;   of fraction bits included in the fixed point REGA value.
;
;   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 <= 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 = (mantissa - 1) * 65536.  An overall floating point value of
;       0.0 is indicated by EXP = 0.  In that case MANT is reserved, and
;       should be 0.
;
;    Consider the following examples:
;
;      0.0 --> 000000h
;
;        S = 0  (positive or zero)
;        EXP = 0  (special case for 0.0)
;        MANT = 0  (special case for 0.0)
;
;      1.0 --> 400000h
;
;        S = 0  (positive or zero)
;        exponent = 0, EXP = 64 --> 40h
;        mantissa = 1.0, MANT = 0
;
;      -3.141593 --> C19220h
;
;        S = 1  (negative)
;        exponent = 1, EXP = 65 --> 41h
;        mantissa = 1.570797, MANT = 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.
;


part 3 328 bytes

*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\09\09@130234 by Uri Sabadosh

flavicon
face
Read the article "Fixed_Point Math in C", from the Embedded System Journal,
April 2001.
Uri

{Original Message removed}

2002\09\10@021952 by Vasile Surducan

flavicon
face
Olin, thank you very much,
there are two people on this list which had change my bad
feelings for the americans, one is James Newton and the other is you...
Numbering Scott too, there are three... but I think he have latin roots.

however, it seems romanian will be your powerfull NATO allieds in the East
of the Europe ;-)

to be any missunderstandings, the last sentence was a joke !

regards,
Vasile
http://www.geocities.com/vsurducan


On Mon, 9 Sep 2002, Olin Lathrop wrote:

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\09\10@022006 by Vasile Surducan

flavicon
face
thx Uri,

do you know, there is also in electronic format ?
or do I start googling ?


thanks again,
Vasile
http://www.geocities.com/vsurducan


On Mon, 9 Sep 2002, Uri Sabadosh wrote:

> Read the article "Fixed_Point Math in C", from the Embedded System Journal,
> April 2001.
> Uri
>
> {Original Message removed}

2002\09\10@085903 by Karl Seibert

flavicon
face
I think this is the article:
http://www.embedded.com/story/OEG20010311S0022

Karl

Quoting Vasile Surducan <spam_OUTvasileTakeThisOuTspamS3.ITIM-CJ.RO>:

{Quote hidden}

> > {Original Message removed}

2002\09\10@125710 by Uri Sabadosh

flavicon
face
Go to http://www.embedded.com.
Uri



----- Original Message -----
From: "Vasile Surducan" <.....vasileKILLspamspam@spam@S3.ITIM-CJ.RO>
To: <PICLISTspamKILLspamMITVMA.MIT.EDU>
Sent: Monday, September 09, 2002 11:26 PM
Subject: Re: [PIC]: value + 1/2 LSB


{Quote hidden}

Journal,
{Quote hidden}

always
> > > express that value + 1/2 in a 9 bit fixed point number.
> > >
> > > > There is somewhere a good book dealing with
> > > > mathematic representation inside of an 8 bit microcontroller ?
> > > > I'm interested in something which must cover all tricks ( integer,
> > signed,
> > > > unsigned, fractional, and maybe floating )
> > >
> > > I think you mostly just want to use fixed point numbers.  You don't
need a
> > > book for that, just some extra bits below the imagined binary point.
> > Fixed
> > > point numbers are still integers as far as the machine is concerned.
The
> > > difference is in how YOU interpret them.
> > >
> > > Floating point is a different story.  Again, I'm not sure about the
> > question
> > > you are asking.  I've attached the header comments for my PIC routine
that
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\09\10@162848 by Mike Singer

picon face
Vasile Surducan wrote:
.
.
> however, it seems romanian will be your powerfull
> NATO allieds in the East of the Europe ;-)
.
.



Interestingly, to which border Eastern or Western
of the Europe is Romania closer geographically?

Mike.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\09\10@184236 by Andy Shaw

flavicon
face
Try....
http://www.embedded.com/story/OEG20010311S0022

Andy
----- Original Message -----
From: "Vasile Surducan" <vasilespamspam_OUTS3.ITIM-CJ.RO>
To: <@spam@PICLISTKILLspamspamMITVMA.MIT.EDU>
Sent: Tuesday, September 10, 2002 7:26 AM
Subject: Re: [PIC]: value + 1/2 LSB


{Quote hidden}

Journal,
{Quote hidden}

always
> > > express that value + 1/2 in a 9 bit fixed point number.
> > >
> > > > There is somewhere a good book dealing with
> > > > mathematic representation inside of an 8 bit microcontroller ?
> > > > I'm interested in something which must cover all tricks ( integer,
> > signed,
> > > > unsigned, fractional, and maybe floating )
> > >
> > > I think you mostly just want to use fixed point numbers.  You don't
need a
> > > book for that, just some extra bits below the imagined binary point.
> > Fixed
> > > point numbers are still integers as far as the machine is concerned.
The
> > > difference is in how YOU interpret them.
> > >
> > > Floating point is a different story.  Again, I'm not sure about the
> > question
> > > you are asking.  I've attached the header comments for my PIC routine
that
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\09\11@014611 by Vasile Surducan

flavicon
face
I forgive your ignorance Mike... ;-)
At the east side of the Europe, near Ukraine ( formerly ex-Soviet Union )
It seems you aren't informed at all about the NATO expanding in this area,
even we are extremely interested ( not me personaly but romanian
government )

regards,
Vasile
http://www.geocities.com/vsurducan


On Tue, 10 Sep 2002, Mike Singer wrote:

{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\09\11@020814 by Vasile Surducan

flavicon
face
Andy, Karl, Uri, thank you for the help !

regards,
Vasile
http://www.geocities.com/vsurducan


On Tue, 10 Sep 2002, Andy Shaw wrote:

> Try....
> http://www.embedded.com/story/OEG20010311S0022
>
> Andy
> {Original Message removed}

2002\09\11@131655 by Uri Sabadosh

flavicon
face
Vasile Hi,
Did you manage to find this article?
Uri


----- Original Message -----
From: "Vasile Surducan" <spamBeGonevasilespamBeGonespamS3.ITIM-CJ.RO>
To: <TakeThisOuTPICLISTEraseMEspamspam_OUTMITVMA.MIT.EDU>
Sent: Tuesday, September 10, 2002 11:19 PM
Subject: Re: [PIC]: value + 1/2 LSB


{Quote hidden}

new
> > > > > > value, where "value" is the integer and 1/2 LSB is 1/2LSB from
that
{Quote hidden}

integer,
> > > > signed,
> > > > > > unsigned, fractional, and maybe floating )
> > > > >
> > > > > I think you mostly just want to use fixed point numbers.  You
don't
> > need a
> > > > > book for that, just some extra bits below the imagined binary
point.
> > > > Fixed
> > > > > point numbers are still integers as far as the machine is
concerned.
> > The
> > > > > difference is in how YOU interpret them.
> > > > >
> > > > > Floating point is a different story.  Again, I'm not sure about
the
> > > > question
> > > > > you are asking.  I've attached the header comments for my PIC
routine
> > that
> > > > > converts a fixed point number to floating point.  It also details
the
> > > > > floating point format.  Perhaps it will help.  If not, try asking
more
> > > > > specific questions.
> > > > >
> > > > >
> > > >
> > > > --
> > > > http://www.piclist.com hint: PICList Posts must start with ONE
topic:
> > > > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other
[BUY]:,[AD]: ->Ads
{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...