Constraint

In reply to avpchandra:
OK, we are getting closer. I think what you are saying is that if the adjacent bits in AA are not the same, that is a transition. If AA[4] is 1’b1 and AA[5] is 0, that counts as a transition. There can only be 23 adjacent bits in a 24-bit variable.

But your transition counts do not match my understanding. If I re-write your examples using _ everywhere that should be counted as transition

  1. AA = 24’b00000000000000_1_0_1_0_111_0_1_0; // 8 transitions
  2. AA = 24’b000000000000_1_0_1_00_1_0_1_0_1_0_1; // 11 transitions
  3. AA = 24’b0_11_0_1_00_11_00_1_00_1_00_1_0_11_0_1_0_1_0_1_0_1_0_1_0 // this is a 32 bit literal, but there are 24 transitions. There could only be 19 transitions with the 1st 24 bits.