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?
>>
>
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)
Albert