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.

converting floating point to fixed point

Status
Not open for further replies.

fireblade

Newbie level 6
Joined
Nov 1, 2006
Messages
13
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Activity points
1,356
what are the techniques to convert Floating point numbers to Fixed Point numbers.
 

emanuelcsm

Member level 3
Joined
Feb 15, 2005
Messages
61
Helped
7
Reputation
14
Reaction score
1
Trophy points
1,288
Location
Brasil
Activity points
1,801
fireblade,

What language are you trying to do this...

If is C, you can use:
float a = 2.5;
int b = (int)a; //It will retraive the integer part of the float

you can use the Ceil rotine too, it will chect the value before retreave the integer part, for example ceil(2.4) returns 2, ceil(2.6) returns 3.



fireblade said:
what are the techniques to convert Floating point numbers to Fixed Point numbers.
 

pmat

Member level 5
Joined
Mar 26, 2007
Messages
91
Helped
15
Reputation
28
Reaction score
9
Trophy points
1,288
Location
Grenoble, France, EU
Activity points
1,790
Hi,
try SystemC typecasts from floating point numbers to fixed point systemC
numbers and vice versa.
They are prety handy!
Fom more details read the last chapters of the SystemC user manual...

pmat
 

rsrinivas

Advanced Member level 1
Joined
Oct 10, 2006
Messages
415
Helped
50
Reputation
100
Reaction score
12
Trophy points
1,298
Location
bengalooru
Activity points
3,704
check out the matlab fixed point toolbox. it's really worth as it contains lot of inbuilt functions and also good documentation.
 

xstal

Full Member level 2
Joined
Oct 12, 2006
Messages
138
Helped
20
Reputation
40
Reaction score
0
Trophy points
1,296
Location
USA
Activity points
2,197
hi,
Do you want to implement it in VHDL?
 

vinodkumar

Full Member level 5
Joined
Oct 5, 2006
Messages
251
Helped
12
Reputation
24
Reaction score
3
Trophy points
1,298
Location
hyderabad
Activity points
2,822
Hi IS this requires as a part of your project you are explicitly trying for this.

bye
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top