+ Post New Thread
Results 1 to 5 of 5

14th January 2005, 11:29 #1
 Join Date
 Dec 2004
 Posts
 188
 Helped
 3 / 3
 Points
 2,037
 Level
 10
how to do fixed point multiply C code?
Is the following correct??
x.data=a.data *b.data;
x.wordlen=a.wordlen+b.wordlen;
x.fractlen=a.fractlen + b.fractlen;
??
Bcz My answer seems wrong...so help....~~

Advertisement

14th January 2005, 12:11 #2
 Join Date
 Apr 2002
 Location
 USA
 Posts
 3,942
 Helped
 663 / 663
 Points
 32,456
 Level
 44
how to do fixed point multiply C code?
Maybe yes, maybe no. Need more info.
Please post a small, complete program, and tell us what answer you expected and what answer you got.

Advertisement

14th January 2005, 13:22 #3
 Join Date
 Jul 2004
 Posts
 892
 Helped
 177 / 177
 Points
 9,432
 Level
 23
Re: how to do fixed point multiply C code?
Your code is correct if
type of x.data is correct
What I maen is "if type of a.data and b.data is same lets say unsigned int (32 bits)
then type of x.data must be long long unsigned int (64 bits)
Hope this help

Advertisement

14th January 2005, 14:21 #4
 Join Date
 Apr 2002
 Location
 USA
 Posts
 3,942
 Helped
 663 / 663
 Points
 32,456
 Level
 44
Re: how to do fixed point multiply C code?
Originally Posted by nand_gates

14th January 2005, 16:37 #5
 Join Date
 Dec 2004
 Posts
 188
 Helped
 3 / 3
 Points
 2,037
 Level
 10
Re: how to do fixed point multiply C code?
mmm..
What I want is a general equation for all Q.format ....such as [16 18],[16 0],..[16 15],..........Is there any information about it?thanks for that.
+ Post New Thread
Please login