FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > DSP

DSP comp.dsp newsgroup, mailing list

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-09-2005, 01:52 PM
K.
Guest
 
Posts: n/a
Default fixed point - floating point newbie question

hi,

i have e.g. number 1 in floating point and its equivalent of 8192 in
fixed point representation.
what is the connection? how do you calculate this exactly?

another example would be -2.000125721 in floating is -16385 in fixed
point.

please help.

thx

Reply With Quote
  #2 (permalink)  
Old 12-09-2005, 04:35 PM
Randy Yates
Guest
 
Posts: n/a
Default Re: fixed point - floating point newbie question

Hi,

In a nutshell you divide the integer value of (e.g.) 8192 by 2^b,
where b is the "scaling" of the fixed-point value. In your case, b
must be 13 since 2^13 = 8192 and 8192/8192 = 1.0.

In the second example, the scaling of the value is still apparently
13, since -16385/2^13 = -2.00012207, which is approximately equal to
your desired floating-point value of -2.000125721. This is a good
example because you can begin to see the effect of the choice of b on
your results, i.e., that there is an error in the representation, and
that the range of the value you wish to represent dictates the scaling
(so you don't overflow), which in turn dictates the resolution you
will have.

I've been meaning to rewrite this for years since it's so long-winded,
but the following may help:

http://www.digitalsignallabs.com/fp.pdf

--Randy Yates

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting floating point to fixed point H aka N VHDL 15 03-02-2006 03:26 PM
Floating-point to fixed-point samples in C/C++ vutruong DSP 12 10-11-2005 06:59 PM
Convert floating point values to fixed point? Robert Oschler DSP 6 05-04-2005 04:48 PM
Porting LMS from floating-point to fixed-point processor Daniel DSP 35 03-09-2005 09:35 PM
Floating point to fixed point conversion. Gowtham DSP 7 07-26-2003 02:33 PM


All times are GMT +1. The time now is 02:52 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved