A
Aart van Beuzekom
Guest
Hi,
Can anybody tell me a practical way (in VHDL) to count the number of
ones in a bit pattern? Counting should be done with combinatorial logic,
which means that a for-to loop cannot be used here (but being quite new
to FPGA and VHDL, I'm not even sure). The number of bits to be counted
is about 30, so a single look-up table is not the solution, using only a
Spartan II.
Any suggestions? Purpose is amongst others pattern matching, where I
count how many bits differ from the expected result.
Thanks,
Aart
Can anybody tell me a practical way (in VHDL) to count the number of
ones in a bit pattern? Counting should be done with combinatorial logic,
which means that a for-to loop cannot be used here (but being quite new
to FPGA and VHDL, I'm not even sure). The number of bits to be counted
is about 30, so a single look-up table is not the solution, using only a
Spartan II.
Any suggestions? Purpose is amongst others pattern matching, where I
count how many bits differ from the expected result.
Thanks,
Aart