Paul Curtis wrote: > Hi, > > >>>Indeed! >>> >>>I don't see a lot of this sort of thing anymore, here, or >> >>on the piclist. >> >>>Used to be, several years ago.. >>> >> >>OK - how about another classic problem. Again, fine when you >>know but worth looking for a solution. Efficient code for >>counting the ones in an >>8 or 16 bit value - say for a majority vote or some such. >> >>Pete Harrison > > From my days using 6502 for speed, use a look up table again - but is that code! Or a simple loop. Relying on the bit shifted from the accumulator goes into the carry, then use ADC #0. This saves testing bits and any braches in code. Something similar must be possible with AVR but I don't want to stick my neck out too far yet, only a starter after a long break! Richard
Message
Re: [AVR-Chat] Re: Challenge
2005-06-09 by Richard Austin
Attachments
- No local attachments were found for this message.