In reply to avpchandra:
I think what you are asking is to look at a series of randomizations, and you are defining a transition as a change from one randomization to the next. Then what you want is
class A;
rand bit [23:0] AA;
constraint AA_C { $countones(const'(AA) ^ AA) == 16;}
endclass // A