Hi, Russ
first, shift right your word 12 times if > 4095 ...
mask the result to keep the 4 lower bits,
then 6 possibilities remain for an even count of the bits ...
( call the result "ABCD" ... if even, ABCD = Ch,Ah,9h,6h,5h or 3h )
A SELECT CASE will do it.
mask your word to keep the 4 lower bits
Then 6 possibilities ...
The SELECT CASE ...
it's one way ...in PbP !!! ( lol )
or use "NCD" function in a loop ... which looks furiously to what Darrel Wrote !!!
Alain
Last edited by Acetronics2; - 10th October 2008 at 09:07.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks