https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel
Pull up input bits, check that output bits represent the count.
LEDs and resistors
# | Input | Output |
---|---|---|
0 | bit0 | count0 |
1 | bit1 | count1 |
2 | bit2 | count2 |
3 | bit3 | count3 |
4 | bit4 | count4 |
5 | bit5 | count5 |
6 | bit6 | count6 |
7 | bit7 | count7 |