DSPRelated.com
Forums

Fixed point representation

Started by Tarang Dadia November 24, 2004

Hi all,

I have posted a copy of this on 'matlab' yahoogroups (apologies if you
are member of both the group and got this email twice) but I think
this is very related to what many of you mite be doing daily. Any help
will be greatly appreciated. I am trying to simulate the fixed point operation on any DSP on
matlab. I dont have fixed point toolbox on my computer. I just want to
know how important is it to get that toolbox. Isnt it same as ceiling
off the number to nearest integer both before and after any
calculations? Or is there anything else I need to take care of.

Thanks.
Tarang




Tarang-

> I have posted a copy of this on 'matlab' yahoogroups (apologies if you
> are member of both the group and got this email twice) but I think
> this is very related to what many of you mite be doing daily. Any help
> will be greatly appreciated.
>
> I am trying to simulate the fixed point operation on any DSP on
> matlab. I dont have fixed point toolbox on my computer. I just want to
> know how important is it to get that toolbox. Isnt it same as ceiling
> off the number to nearest integer both before and after any
> calculations? Or is there anything else I need to take care of.

For most fixed-point DSPs, see saturation mode and sign-extension bits. There
can be
some strange things for some devices, such as C5xxx -- for example, "extra left
shift" after multiplies, extra guard band bits, etc.

-Jeff





Jeff, Vishal,

Thanks for the response. I realised that its not as simple as
*ceiling* or *rounding*. A simple search revealed a lot about fixed
point operation.

First one is that we have to decide where the decimal point is. cos
there is tradeoff associated with it. Greater maximum value on one
hand and better resolution on other.

Second we dont have to tell the processor where the decimal point is.
Its upto us how to interpret the result and hence be *very very*
careful about the representation of the result.

One question I have now is, having decided where your decimal point
should lie. how do you go about implementing fixed point math. Do you
keep the same format (same place where you put your decimal point)
throughout the code or change it as and when you need to and reallign
at the end?? Thanks.
Tarang

On Tue, 23 Nov 2004 22:20:47 -0600, Jeff Brower <> wrote:
> Tarang- > For most fixed-point DSPs, see saturation mode and sign-extension bits. There
can be
> some strange things for some devices, such as C5xxx -- for example, "extra
left
> shift" after multiplies, extra guard band bits, etc.
>
> -Jeff
>
Fixed point arithmatic does not mean that decimal point is not there at
all.
It's just that CPU registers do not support any format to store a fixed
point,
There fore, one uses a format in which using the these 'fixed point'
registers and cpu,
He can do arithmatic on floating points (real numbers).

Search on a search engine about what a fixed point operation is. You
will get a lot to know.

Regards
Vishal.






Hi
You may want to change your fixed point format for the intermediate
results (i.e change the position of the decimal point) and realign
at the end to increase precision but the choice of format may depend
on the dynamic range of the data and of course the hardware. A
popular fixed point representation is the Q_format.

-Nithin
--- In , Tarang Dadia <tarangdadia@g...> wrote:
>
> Jeff, Vishal,
>
> Thanks for the response. I realised that its not as simple as
> *ceiling* or *rounding*. A simple search revealed a lot about fixed
> point operation.
>
> First one is that we have to decide where the decimal point is. cos
> there is tradeoff associated with it. Greater maximum value on one
> hand and better resolution on other.
>
> Second we dont have to tell the processor where the decimal point
is.
> Its upto us how to interpret the result and hence be *very very*
> careful about the representation of the result.
>
> One question I have now is, having decided where your decimal point
> should lie. how do you go about implementing fixed point math. Do
you
> keep the same format (same place where you put your decimal point)
> throughout the code or change it as and when you need to and
reallign
> at the end?? > Thanks.
> Tarang
>
> On Tue, 23 Nov 2004 22:20:47 -0600, Jeff Brower <jbrower@s...>
wrote:
> > Tarang-
> >
> >
> > For most fixed-point DSPs, see saturation mode and sign-
extension bits. There can be
> > some strange things for some devices, such as C5xxx -- for
example, "extra left
> > shift" after multiplies, extra guard band bits, etc.
> >
> > -Jeff
> >
> Fixed point arithmatic does not mean that decimal point is not
there at
> all.
> It's just that CPU registers do not support any format to store a
fixed
> point,
> There fore, one uses a format in which using the these 'fixed
point'
> registers and cpu,
> He can do arithmatic on floating points (real numbers).
>
> Search on a search engine about what a fixed point operation is.
You
> will get a lot to know.
>
> Regards
> Vishal.



Tarang-

> Thanks for the response. I realised that its not as simple as
> *ceiling* or *rounding*. A simple search revealed a lot about fixed
> point operation.
>
> First one is that we have to decide where the decimal point is. cos
> there is tradeoff associated with it. Greater maximum value on one
> hand and better resolution on other.
>
> Second we dont have to tell the processor where the decimal point is.
> Its upto us how to interpret the result and hence be *very very*
> careful about the representation of the result.
>
> One question I have now is, having decided where your decimal point
> should lie. how do you go about implementing fixed point math. Do you
> keep the same format (same place where you put your decimal point)
> throughout the code or change it as and when you need to and reallign
> at the end??

I think that has to be an option, or maybe based on constraints / design goals.
In
most cases in the real world, you frequently have to "return to base", or get
back to
the Q notation of your coefficients stored in memory. You can sustain a higher
Q
and/or flexible Q, only as long as you don't need another memory value. In
thinking
about how to simulate, that part might be the hard part. You need some way to
indicate in the simulation when a "memory access" occurs -- for example, when
you
read a value from an array or vector.

On the real device the way around this, of course, is to use double-precision
functions and access 2x mem values -- but those eat MIPS, cuz then you're going
beyond the instrinsic capabilities of the chip.

-Jeff > On Tue, 23 Nov 2004 22:20:47 -0600, Jeff Brower <>
wrote:
> > Tarang-
> >
> >
> > For most fixed-point DSPs, see saturation mode and sign-extension bits.
There can be
> > some strange things for some devices, such as C5xxx -- for example, "extra
left
> > shift" after multiplies, extra guard band bits, etc.
> >
> > -Jeff
> >
>
> Fixed point arithmatic does not mean that decimal point is not there at
> all.
> It's just that CPU registers do not support any format to store a fixed
> point,
> There fore, one uses a format in which using the these 'fixed point'
> registers and cpu,
> He can do arithmatic on floating points (real numbers).
>
> Search on a search engine about what a fixed point operation is. You
> will get a lot to know.
>
> Regards
> Vishal.
>
> _____________________________________
> Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you want
your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to
>
> To Post: Send an email to
>
> To Leave: Send an email to
>
> Archives: http://www.yahoogroups.com/group/c6x
>
> Other Groups: http://www.dsprelated.com
>
> Yahoo! Groups Links >
>






Hi,

I'm doing a project on the ti Tms3206711 DSK board.
However, I got an old version of the code composer
'CCS' which is Version 1.23. So, I can't open .pjt
extensions, nor creat .pjt project extensions.

Is there a way to overcome this rather than buying a
new board with the new version of the software?

Thanks alot --- Jeff Brower <> wrote:

>
> Tarang-
>
> > Thanks for the response. I realised that its not
> as simple as
> > *ceiling* or *rounding*. A simple search revealed
> a lot about fixed
> > point operation.
> >
> > First one is that we have to decide where the
> decimal point is. cos
> > there is tradeoff associated with it. Greater
> maximum value on one
> > hand and better resolution on other.
> >
> > Second we dont have to tell the processor where
> the decimal point is.
> > Its upto us how to interpret the result and hence
> be *very very*
> > careful about the representation of the result.
> >
> > One question I have now is, having decided where
> your decimal point
> > should lie. how do you go about implementing fixed
> point math. Do you
> > keep the same format (same place where you put
> your decimal point)
> > throughout the code or change it as and when you
> need to and reallign
> > at the end??
>
> I think that has to be an option, or maybe based on
> constraints / design goals. In
> most cases in the real world, you frequently have to
> "return to base", or get back to
> the Q notation of your coefficients stored in
> memory. You can sustain a higher Q
> and/or flexible Q, only as long as you don't need
> another memory value. In thinking
> about how to simulate, that part might be the hard
> part. You need some way to
> indicate in the simulation when a "memory access"
> occurs -- for example, when you
> read a value from an array or vector.
>
> On the real device the way around this, of course,
> is to use double-precision
> functions and access 2x mem values -- but those eat
> MIPS, cuz then you're going
> beyond the instrinsic capabilities of the chip.
>
> -Jeff > > On Tue, 23 Nov 2004 22:20:47 -0600, Jeff Brower
> <> wrote:
> > > Tarang-
> > >
> > >
> > > For most fixed-point DSPs, see saturation mode
> and sign-extension bits. There can be
> > > some strange things for some devices, such as
> C5xxx -- for example, "extra left
> > > shift" after multiplies, extra guard band bits,
> etc.
> > >
> > > -Jeff
> > >
> >
> > Fixed point arithmatic does not mean that decimal
> point is not there at
> > all.
> > It's just that CPU registers do not support any
> format to store a fixed
> > point,
> > There fore, one uses a format in which using the
> these 'fixed point'
> > registers and cpu,
> > He can do arithmatic on floating points (real
> numbers).
> >
> > Search on a search engine about what a fixed point
> operation is. You
> > will get a lot to know.
> >
> > Regards
> > Vishal.
> >
> > _____________________________________
> > Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
> >
> > _____________________________________
> > About this discussion group:
> >
> > To Join: Send an email to
>
> >
> > To Post: Send an email to
> >
> > To Leave: Send an email to
>
> >
> > Archives: http://www.yahoogroups.com/group/c6x
> >
> > Other Groups: http://www.dsprelated.com
> >
> > Yahoo! Groups Links
> >
> >
> >
> > _____________________________________
> Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to > To Post: Send an email to
>
> To Leave: Send an email to > Archives: http://www.yahoogroups.com/group/c6x
>
> Other Groups: http://www.dsprelated.com
>
> Yahoo! Groups Links >


__________________________________________________






Gentleman-

>Re: [c6x] Fixed point representation

How is this in any way related to the Fixed point post???
Not so like you to do that intentionally here...

>So, I can't open .pjt
>extensions, nor creat .pjt project extensions.

Is your goal to create .pjt extensioned files?

>Is there a way to overcome this rather than buying a
>new board with the new version of the software?

There are few more sensible options like analysing your goals, what
algorithms you want to implement, reading up the release notes of the next
highest revision of CCS then the one you possess...and also wonder why you
would to but change your hardware when apparently your software is the
issue...many more...

let me know if it helps.

--Bhooshan

Thanks alot

Anyways --- Jeff Brower <> wrote:

>
> Tarang-
>
> > Thanks for the response. I realised that its not
> as simple as
> > *ceiling* or *rounding*. A simple search revealed
> a lot about fixed
> > point operation.
> >
> > First one is that we have to decide where the
> decimal point is. cos
> > there is tradeoff associated with it. Greater
> maximum value on one
> > hand and better resolution on other.
> >
> > Second we dont have to tell the processor where
> the decimal point is.
> > Its upto us how to interpret the result and hence
> be *very very*
> > careful about the representation of the result.
> >
> > One question I have now is, having decided where
> your decimal point
> > should lie. how do you go about implementing fixed
> point math. Do you
> > keep the same format (same place where you put
> your decimal point)
> > throughout the code or change it as and when you
> need to and reallign
> > at the end??
>
> I think that has to be an option, or maybe based on
> constraints / design goals. In
> most cases in the real world, you frequently have to
> "return to base", or get back to
> the Q notation of your coefficients stored in
> memory. You can sustain a higher Q
> and/or flexible Q, only as long as you don't need
> another memory value. In thinking
> about how to simulate, that part might be the hard
> part. You need some way to
> indicate in the simulation when a "memory access"
> occurs -- for example, when you
> read a value from an array or vector.
>
> On the real device the way around this, of course,
> is to use double-precision
> functions and access 2x mem values -- but those eat
> MIPS, cuz then you're going
> beyond the instrinsic capabilities of the chip.
>
> -Jeff > > On Tue, 23 Nov 2004 22:20:47 -0600, Jeff Brower
> <> wrote:
> > > Tarang-
> > >
> > >
> > > For most fixed-point DSPs, see saturation mode
> and sign-extension bits. There can be
> > > some strange things for some devices, such as
> C5xxx -- for example, "extra left
> > > shift" after multiplies, extra guard band bits,
> etc.
> > >
> > > -Jeff
> > >
> >
> > Fixed point arithmatic does not mean that decimal
> point is not there at
> > all.
> > It's just that CPU registers do not support any
> format to store a fixed
> > point,
> > There fore, one uses a format in which using the
> these 'fixed point'
> > registers and cpu,
> > He can do arithmatic on floating points (real
> numbers).
> >
> > Search on a search engine about what a fixed point
> operation is. You
> > will get a lot to know.
> >
> > Regards
> > Vishal.
> >
> > _____________________________________
> > Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
> >
> > _____________________________________
> > About this discussion group:
> >
> > To Join: Send an email to
>
> >
> > To Post: Send an email to
> >
> > To Leave: Send an email to
>
> >
> > Archives: http://www.yahoogroups.com/group/c6x
> >
> > Other Groups: http://www.dsprelated.com
> >
> > Yahoo! Groups Links
> >
> >
> >
> > _____________________________________
> Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to > To Post: Send an email to
>
> To Leave: Send an email to > Archives: http://www.yahoogroups.com/group/c6x
>
> Other Groups: http://www.dsprelated.com
>
> Yahoo! Groups Links >


__________________________________________________
_____________________________________
Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you
want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join: Send an email to

To Post: Send an email to

To Leave: Send an email to

Archives: http://www.yahoogroups.com/group/c6x

Other Groups: http://www.dsprelated.com

Yahoo! Groups Links

_________________________________________________________________
The happening world of BPO! Know all that you need to know!
http://www.bpowatchindia.com/msn/ Keep in step with whats hot!




> Hi,
>
> I'm doing a project on the ti Tms3206711 DSK board.
> However, I got an old version of the code composer
> 'CCS' which is Version 1.23. So, I can't open .pjt
> extensions, nor creat .pjt project extensions.
>
> Is there a way to overcome this rather than buying a
> new board with the new version of the software?
>
> Thanks alot

__________________________________



gentleman;
 
If my memory serves me correctly, 1.23 used '.mak' files as project files.  Is there some special reason that you need to use '.pjt' files??
I believe that they are both text files and that you can look at a '.pjt' and create a project to build it under 1.23 [as long as the project doesn't use features that are not in 1.23.
 
Or you can create makefiles and build from the command line.
 
mikedunn

gentleman <g...@yahoo.com> wrote:
> Hi,
>
> I'm doing a project on the ti Tms3206711 DSK board.
> However, I got an old version of the code composer
> 'CCS' which is Version 1.23. So, I can't open .pjt
> extensions, nor creat .pjt project extensions.
>
> Is there a way to overcome this rather than buying a
> new board with the new version of the software?
>
> Thanks alot

__________________________________

_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join: Send an email to c...@yahoogroups.com

To Post: Send an email to c...@yahoogroups.com

To Leave: Send an email to c...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/c6x

Other Groups: http://www.dsprelated.com

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/c6x/

<*> To unsubscribe from this group, send an email to:
c...@yahoogroups.com

<*






Firstly, thanks alot for your reply.

Secondly, I'm a beginner in TMS320 field, I've some
files which are in .pjt extension and i'm trying to
work with them, but the software doesn't let me open
them.

Thanks for your coopeartion.

Adil

--- Mike Dunn <> wrote:

> gentleman;
>
> If my memory serves me correctly, 1.23 used '.mak'
> files as project files. Is there some special
> reason that you need to use '.pjt' files??
> I believe that they are both text files and that you
> can look at a '.pjt' and create a project to build
> it under 1.23 [as long as the project doesn't use
> features that are not in 1.23.
>
> Or you can create makefiles and build from the
> command line.
>
> mikedunn
>
> gentleman <> wrote: >
> > Hi,
> >
> > I'm doing a project on the ti Tms3206711 DSK
> board.
> > However, I got an old version of the code composer
> > 'CCS' which is Version 1.23. So, I can't open .pjt
> > extensions, nor creat .pjt project extensions.
> >
> > Is there a way to overcome this rather than buying
> a
> > new board with the new version of the software?
> >
> > Thanks alot >
>
> __________________________________ >
>
> _____________________________________
> Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to > To Post: Send an email to
>
> To Leave: Send an email to > Archives: http://www.yahoogroups.com/group/c6x
>
> Other Groups: http://www.dsprelated.com
>
> Yahoo! Groups Links

__________________________________