Interview Preparation Bit Fiddling

From Embedded Systems Learning Academy
Revision as of 22:22, 7 July 2013 by Preet (talk | contribs) (Created page with "This article prepares you for the bit-fiddling questions. The source code should guide you through by example. If you get confused at any step, you can try the source code y...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This article prepares you for the bit-fiddling questions. The source code should guide you through by example. If you get confused at any step, you can try the source code yourself using a debugger. Note that none of the code has been tested to compile :(

Find Highest Bit Set

/* Find the highest bit that has been set in a uint32 variable */
uint32_t find_highest_bit_num(uint32_t num)
{

}

/* Well, that is too slow, so find the highest big faster */
uint32_t find_highest_bit_num(uint32_t num)
{

}