[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: working with fixed point
From: |
Per Persson |
Subject: |
Re: working with fixed point |
Date: |
Sun, 24 Aug 2003 12:08:51 +0200 |
How about
B=7;
## Truncation of x to B fractional bits
x_qt = 2^-B*floor(x*2^B);
## Rounding of x to B fractional bits
x_qr = 2^-B*floor(x*2^B + 0.5);
You'll have to check for range overflow etc. manually.
HTH,
Per
On Sunday, August 24, 2003, at 11:30 AM, address@hidden wrote:
Hi,
I want to convert a floating point octave program into fixed point
(with
about 7 bits representation) - for simulating its behaviour on fpga.
How can I do it?
Thanks
Ravid
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------