If you have to count numbers of 1 in a 32 bit word. Other than checking every other bit or dividing the bits is 4 parts and then using lookup table. What will be some other most efficent way ?

If you have to count numbers of 1 in a 32 bit word. Other than checking every other bit or dividing the bits is 4 parts and then using lookup table. What will be some other most efficent way ?

You're ruling out these?

Comments
fun link :-) -Raye

If you have to count numbers of 1 in a 32 bit word. Other than checking every other bit or dividing the bits is 4 parts and then using lookup table. What will be some other most efficent way ?

Jeez... do your own 'Computer Systems' Homework!

If you have to count numbers of 1 in a 32 bit word. Other than checking every other bit or dividing the bits is 4 parts and then using lookup table. What will be some other most efficent way ?

Can you show an example of what you need to do? I'm assuming you just want to count the number of set bits in a word, but it might be something different than that.

Jeez... do your own 'Computer Systems' Homework!

mehakkapur included a viable solution in his question, so this isn't a matter of not knowing how to solve the problem. He also didn't ask for code, so assuming that this is the usual homework question is jumping the gun. Not to mention that the way you went about that assumption was rude and uncalled for.

This article has been dead for over six months. Start a new discussion instead.