DSPRelated.com
Forums

Floating-point to fixed-point samples in C/C++

Started by vutruong October 10, 2005
vutruong <vuttruong@yahoo.com> wrote:

>It seems that I didn't describe my issue clearly. > >My work is to remove the floating-point. My project is written in C >language. And there are some simple operations: addition, subtraction, >multiplication, division and exponent. I think I will make a fixed-point >library with these simple operations. I read some papers about fixed-point >but they are difficult for me to implement the operations in my library. My >project after removing floating-point will use 16 bits to present a >number. > >Thanks for your helps,
Have you considered using System C? Its libraries define fixed-point types that are quire flexible and can certainly do what you want. Usually they are pretty fast also. Steve
Baskar--

>Or...are you looking for C/C++ code that takes as input, code in C/C++
for a
>floating point algorithm and outputs code for the same algorithm in
fixed
>point?? >You won't find any C/C++ code for any of the above 2 problems.
Mmm.. Am not sure if thats true. I remember a research effort along these lines at some university under the name FRIDGE(Fixed-point pRogrammIng DesiGn Environment) Not sure if it ever worked though! OK. Here is a quick google based link(untested by me): http://www.ert.rwth-aachen.de/Projekte/Tools/FRIDGE/fridge.html --Bhooshan This message was sent using the Comp.DSP web interface on www.DSPRelated.com
Bhooshan Iyer wrote:
> I remember a research effort along these > lines at some university under the name FRIDGE(Fixed-point pRogrammIng > DesiGn Environment) Not sure if it ever worked though!
Well, their acronym sure didn't. -- Jim Thomas Principal Applications Engineer Bittware, Inc jthomas@bittware.com http://www.bittware.com (603) 226-0404 x536 I thought I was wrong once, but I was mistaken.