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.
Yes, you can. The most important thing is to keep the best precision allowed by the platform where you are going to process the fixed data. Normally, most processors provide the arithmetic operation extension capability. For example, a processor with 16-bit data bus width has an instruction to add or subtract with carry or borrow. After examining the range of the data to be processed, you will determine the number of bits to represent the data and where the binary point are to be located. I heard about some auto-scaling programs to do these things.
First, simply convert all the floats to char int or long int.
long int is best, as it allows you to retain more precision.
Next convert all maths to retain precision in fixed point.
Ie, multiply and add before devide, you might have to fiddle with the equations to do this.
Finally add scailing. To do this work out what your largest and smallest possible values are through the different steps in the program, and how many extra bits you dont use in your variables(probably long's), then add scailing (easiest is multiply by 2 using left shift opperator variable<<6).
scail up at the start and scail down to reach your result ensureing you still have correct maths.
check that your variables cant overflow or underflow.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.