« Previous day (Jun 19, 2007) | Main | Next day (Jun 21, 2007) »
http://blogs.sun.com/insidemyhead/date/20070621 Thursday June 21, 2007

Playing with numbers.

Consider that you have a 32 bit machine and you have a number such as say Hex CF39. How would you go about counting the number of 1's in the binary representation of this number? In other words, the binary representation of CF39 is 1100111100111001. What is needed is a way to count the number of 1's in this number i.e the answer should be 10.[ Your 32 bit machine doesn't have an instruction that can do this :-) ]



Posted by insidemyhead [Personal] ( June 21, 2007 10:06 AM ) Permalink | Comments[1]