omara007
Advanced Member level 4
- Joined
- Jan 6, 2003
- Messages
- 1,237
- Helped
- 50
- Reputation
- 102
- Reaction score
- 16
- Trophy points
- 1,318
- Location
- Cairo/Egypt
- Activity points
- 9,716
guys ..
anyone has a function to convert real/float numbers to fixed point with a given precision ?
for example : I give the function this number : (0.5) as a first argument and in the second argument I give it (1) as the number of binary digits to the left of the binary point , and (2) in the third argument as the number of binary digits to the right of the binary point.
The return value will be (010)
if the function is called funcX => funcX(0.75,1,2) returns (011)
and so on ..
functions in matlab, vhdl, c are all welcomed ..
anyone has a function to convert real/float numbers to fixed point with a given precision ?
for example : I give the function this number : (0.5) as a first argument and in the second argument I give it (1) as the number of binary digits to the left of the binary point , and (2) in the third argument as the number of binary digits to the right of the binary point.
The return value will be (010)
if the function is called funcX => funcX(0.75,1,2) returns (011)
and so on ..
functions in matlab, vhdl, c are all welcomed ..