Forum Discussion
Altera_Forum
Honored Contributor
13 years agoOne way to do it would be to XOR each bit with its neighbor on the right, append some zeros on the left to each result (in the example case 2 zeros would be sufficient since you are never going to have more than 7) then add them all up. This will give you the number of transitions. Subtract this from the total# bit -1 and you have the number of non-transitions. If it isn't very many bits and it is the same number of bits every time then this should work.
How many bits are we talking about here?