Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Floating point to fixed point converter of C code

Status
Not open for further replies.

ramziiss

Newbie level 4
Joined
Apr 3, 2012
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,326
Hi everyone,

I'm a student and I'm working on project that requires me to convert really complicated C code ( containing floating-point variable ) to a fixed-point C code ( integers only ), I found manual conversion but it would take me forever to do that, I found some papers that speak about automatic converters but without saying the name or how can I download it and use it, if anyone knows any such converters, please let me know,

And Thanks in advance,

PS : Already posted this thread in Microcontroller section, thought maybe this is the right place for it
 

I don't think i understand the problem...

Is this what you are looking for?

Code:
// conversion with truncation
float f = 234.33;
int i = (int) f;
//i has value 234

// rounding conversion
float g = 234.57;
int i = (int)(g + 0.5f);
//i has value 235;
 

I don't think i understand the problem...

Is this what you are looking for?

Code:
// conversion with truncation
float f = 234.33;
int i = (int) f;
//i has value 234

// rounding conversion
float g = 234.57;
int i = (int)(g + 0.5f);
//i has value 235;

What i'm looking for is a software, a tool, anything that makes the automatic conversion of floating-point C code ( .c files ) into fixed-point C code, I already found Two ( Fixify and Float2fix ) but i couldn't find fixify anywhere in the net and for Float2fix I'm stuggeling with the installation instructions,

And Thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top