Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
9 years ago

Representing only a set of bits in a binary number

Hello,

I need a clarification regarding this topic. I have a binary number, say "00000011111111100......" and I need to write a VHDL code such that it calculates the number of 0s and 1s for a single sequence. What I mean by a single sequence is that after all the 1's are checked and calculated, the operation or the checking should be terminated. For instance, in our example we have 9 1's and once the next bit is checked, obviously we have zero as the next bit. So, we need to stop the operation of checking and the process should be terminated. Can anyone help me to solve this issue. Thanks in advance.

12 Replies