Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17261 Discussions

Calculating no. of transitions

Altera_Forum
Honored Contributor II
1,283 Views

How can i identify the no. of transition (0->1 or 1->0) in a sequence and the number of non transitions in that sequence(1->1 or 0->0)..... 

 

for example..... 

consider a 8 bit sequence 01101001 

no. of transitions 5 

no. of non transitions 2 

 

anyone know to solve this in vhdl.....pls help me
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
559 Views

what have you got so far and where are you stuck?

0 Kudos
Altera_Forum
Honored Contributor II
559 Views

One 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?
0 Kudos
Reply