[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[fpu] your fmul: norm_mul.v file



Hi Rudi,

I am sorry, i don't have any significant or perceptible contribution in fpu. Nevertheless,
I, sometimes, do read your emails. I was just looking at your norm_mul.v file (downloaded
from cvs)......I can't imagine why do you need such a big mux. 
Let us see the following example.
if you multiply two 4 bit binary numbers, their MSB being always '1' (in ur case it is 24 bits) 
the result will always be within the following two limites.
1) 1000*1000 =  1000000
2) 1111*1111 = 11100001
In fact in general, result would be (2n-1) or 2n bits, if the numbers are n bit each and
MSB being '1'.
So if i say that you only need  a very small mux to normalize .. would that be wrong?

if(fract_in[48]) 
	begin
	fract_out = fract_in[46:24];
	exp_adj = 1'b1; //keep this reg only bit size.
	end
else 
	fract_out = fract_in[45:23];
	exp_adj = 1'b0;
endif

 
Sagheer Ahmad.


-----Original Message-----
From: Rudolf Usselmann [mailto:rudi@asics.ws]
Sent: Sunday, September 03, 2000 6:56 PM
To: fpu@opencores.org
Subject: Re: [fpu] '/' operator


on 9/3/00 20:13, Jamil Khatib at jamilkhatib75@yahoo.com wrote:
> 
>> 
>> No, no, no, the default equation for the exponent
>> is:
>> exp_result = expa - expb + 127;
>> 
> Why? can you explain more?

I really don't have the time right now, too many projects.
Get a good book !

>>> I am doing the conversion to the extended format
>> which
>>> is 32 bit for fraction and 11 bit for exp
>> 
>> That is wrong. There is no need to convert to
>> extended format.
>> 
> I thought that the standard mentioned that, and we
> discussed it on the mailing list and no one said that
> I should not do it!!!

No it does not. The standard does not say anything about
how to implement it. Only the behavior is described.

>>>> 4) The reason you think that the '/' operator
>> does
>>>> not work
>>>> is because you do not understand how to recover
>>>> precision. That
>>>> is done by shifting opa 23 bits to the left.
>>> 
>>> Could you explaine more because I thought when I
>> added
>>> the 8 bit to the right I am doing shift to the
>> left!!
>> 
>> Yes, I understand that, but it's still wrong. You
>> want to
>> add 23 bit to opa, and none to opb.
>> 
> why? 

Do you really don't understand that ??? OK, lets do this
example:
Integer division of 7/5 results in 1, right ?
If you want higher precision, you can do:

(7*10)/5=14 and then divide the result by 10.

Now think of the multiply and divide by 10 as a shift
left and a shift right.

 
> Anyhow is there is real bugs they could be fixed from
> the begining I posted my code lot of times before but
> I did not get any comment? where is the cooperation?

Now hold on. You can not expect for everybody to be fixing
your shit. Cooperation lies in you asking questions and
others answering them, just as I have been doing.
You can not expect people explain and educate you in basic
concepts, such as math.

> 
> Jamil Khatib

rudi