Hi,
Is there any specific funtion code to count number of active bits in the register?. If have, please do share the codes or the library. Im doing one project, which requires to count the active bits and gets displayed on the LCD.
Thanks,
Sutha
Bit count funtion in 18F series
Re: Bit count funtion in 18F series
Hi,
What do you mean by active bits exactly ?
Regards,
Filip.
What do you mean by active bits exactly ?
Regards,
Filip.
Re: Bit count funtion in 18F series
Hi filip,
The active bits are those true bits .
Best regards,
Sutha
The active bits are those true bits .
Best regards,
Sutha
Re: Bit count funtion in 18F series
Hi Filip,
Any updates for this?
Regards,
Sutha
Any updates for this?
Regards,
Sutha
Re: Bit count funtion in 18F series
Hi,
Sorry for the delay. By true bits you mean the ones that are set to 1 ?
Regards,
Filip.
Sorry for the delay. By true bits you mean the ones that are set to 1 ?
Regards,
Filip.
Re: Bit count funtion in 18F series
Hi Filip,
Yes you're right. For example > 01011011 = So the result should be 5.
Best Regards,
Sutha
Yes you're right. For example > 01011011 = So the result should be 5.
Best Regards,
Sutha
Re: Bit count funtion in 18F series
Hi,
There is no such function I'm afraid, but you can implemented by yourself - simply by testing each bit in a variable and increment a counter if condition is met.
Regards,
Filip.
There is no such function I'm afraid, but you can implemented by yourself - simply by testing each bit in a variable and increment a counter if condition is met.
Regards,
Filip.