132 XLS: bit population count

132 : 0b 010 000 100 : XLS: bit population count

Select Project 1 2 3 4 5 6 7 8 9 ON SW2
  • Author: proppy
  • Description: Count bits set in the input.
  • GitHub repository
  • HDL project
  • Extra docs
  • Clock: 0 Hz
  • External hardware: LEDs and resistors

picture

How it works

https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel

How to test

Pull up input bits, check that output bits represent the count.

IO

# 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