Never mind, I found it. In binary, a standard 2 bit (+ carry) full adder is also counting the number of ones. To expand that, one must simply add the results from more than one full adder. http://www.circuitcellar.com/library/eq/144/5.htm A full adder is shown here: http://et.nmsu.edu/~etti/spring98/electronics/tapper/img00052.gif and explained in dizzying detail here: http://et.nmsu.edu/~etti/spring98/electronics/tapper/bcdpaper.html Basically, for inputs A B and C, the outputs S0 and S1 are: S0 = (A XOR B) XOR C S1 = ( C AND (A XOR B) ) OR (A AND B) --- James. > -----Original Message----- > From: James Newton, Host [mailto:jamesnewton@piclist.com] > Sent: 2007 Jan 29, Mon 18:46 > To: 'Microcontroller discussion list - Public.' > Subject: RE: [EE] Digital circuit that counts 'ones'. > > All I seem to have is at: > > http://www.piclist.com/techref/microchip/math/bit/countbits.htm > > But that is programmatic rather than discrete logic. > > I seem to remember such a thing but I also can't find it with > a short dogpile (.com) so I will be watching to see if anyone > comes up with it. > > --- > James. > > > > > -----Original Message----- > > From: piclist-bounces@mit.edu > > [mailto:piclist-bounces@mit.edu] On Behalf Of Carlos A. Marcano V. > > Sent: 2007 Jan 29, Mon 17:30 > > To: Microcontroller discussion list - Public. > > Subject: [EE] Digital circuit that counts 'ones'. > > > > This one is making me go crazy. I know there is a > well-known solution > > for detecting the number of 'ones' in a byte using logic > gates (just > > as you might use XOR's for parity check) but I just can't simply > > remember! > > > > Do any of you guys do remember it? > > > > Regards, > > > > *Carlos Marcano* > > -Guri, Venezuela- > > -- > > http://www.piclist.com PIC/SX FAQ & list archive View/change your > > membership options at > http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist