Constraint number generated with bits control

In reply to juhi_p:

Am I missing something?

Yes, your for-loop re-constructs a1 every iteration. So addr starts from 0 every randomization. Move the call to new() before the for-loop.