Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [Proj4] Math Library

0 views
Skip to first unread message

[Instr] Albert Chae

unread,
Aug 8, 2008, 11:13:18 PM8/8/08
to
Actually, you don't have to because util.c contains the log you probably
want, and combining that with what you can do with shifting should be
enough.

Albert

On Fri, 8 Aug 2008, [Instr] Albert Chae wrote:

> You are allowed to use the math library.
>
> Albert
>
> On Fri, 8 Aug 2008, Ahmed Owainati wrote:
>
>>
>> We're trying to figure out a good way to get the number of bits for the
>> index
>> and offset from the physical address, and it seems like the best way to do
>> it
>> would be by using the log of certain numbers to figure out how many bits we
>> need to represent offset and index. Is it alright to compile with the math
>> library to do this?
>>
>

Stephen Tu

unread,
Aug 8, 2008, 11:12:39 PM8/8/08
to

>> We're trying to figure out a good way to get the number of bits for
>> the index
>> and offset from the physical address, and it seems like the best way
>> to do it
>> would be by using the log of certain numbers to figure out how many
>> bits we
>> need to represent offset and index. Is it alright to compile with the
>> math
>> library to do this?
>>

am i missing something, or does the following function provided in
util.c do just that?

/* finds the highest 1 bit, and returns its position, else 0 */
unsigned int uint_log2(unsigned int w)

[Instr] Albert Chae

unread,
Aug 8, 2008, 11:30:11 PM8/8/08
to
Beat me to it.

[Instr] Albert Chae

unread,
Aug 8, 2008, 10:39:54 PM8/8/08
to
You are allowed to use the math library.

Albert

0 new messages