Sign in

username:

password:



Not a member?

Search c28x



Search tips

Subscribe to c28x



Ads

Discussion Groups

Discussion Groups | TMS320C28x | Datatype declaration for variables in F2812

Technical discussions about the TI C28x DSPs (including the C2810, C2811, C2812, F2801, F2806, F2808, F2810,, F2811, F2812, R2811 and R2812).

  

Post a new Thread

Datatype declaration for variables in F2812 - naay...@gmail.com - Apr 13 11:13:42 2008



Hi all, 

Can any one tell me how do we declare data type for the variables having a fractional value 

float n=0.2;
int16 A=540;
float B=50e-06;
float C=2.109375e-06;,

i have assigned n,B,C as float. but DSP working in Fixed point.Should i mention the above as
frac? how many bits whether it will take float as 16bit or 32 bit? or frac as 16bit or 32bit?

if i give float16 it gives error. My question seems to be silly to many of you, but i don't
have any programming experience.

can any one answer me?

thanks in advance.

regards

------------------------------------

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution
for Commercial & Consumer End Equipment: www.ti.com/dm6467

You can post a message or access and search the archives of this group on DSPRelated.com:
http://www.dsprelated.com/groups/c28x/1.php

_____________________________________




(You need to be a member of c28x -- send a blank email to c28x-subscribe@yahoogroups.com )

RE: Datatype declaration for variables in F2812 - Alain SALMETOZ - Apr 14 10:07:46 2008

hi, datatype are standards from Ainsi C.

Float is a floating point representation, so your declaration are right.
DSP have no FPU (floating point unit), so all computation will be emulated=
=20
by DSP, very slow !

Fixed points means working with float as integer. See IQ library for the=20
DSP. It allows you to compute very fast, with the precision you want.

Veuillez r=E9pondre =E0 n...@gmail.com
Envoy=E9 par :    c...@yahoogroups.com
Pour :  c...@yahoogroups.com
cc :=20=20=20=20=20

Objet : [c28x] Datatype declaration for variables in F2812

Hi all,=20

Can any one tell me how do we declare data type for the variables having a=
=20
fractional value=20

float n=3D0.2;
int16 A=3D540;
float B=3D50e-06;
float C=3D2.109375e-06;,

i have assigned n,B,C as float. but DSP working in Fixed point.Should i=20
mention the above as frac? how many bits whether it will take float as=20
16bit or 32 bit? or frac as 16bit or 32bit?

if i give float16 it gives error. My question seems to be silly to many of=
=20
you, but i don't have any programming experience.

can any one answer me?

thanks in advance.

regards

------------------------------------

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Tr=
anscoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm64=
67

You can post a message or access and search the archives of this group on D=
SPRelated.com:
http://www.dsprelated.com/groups/c28x/1.php

_____________________________________




(You need to be a member of c28x -- send a blank email to c28x-subscribe@yahoogroups.com )