I need to write a constraint to randomize such a way that consecutive 2 bits are set to 1, other bits are 0 (i.e. 16'b0000_0000_0011, 16'b0000_1100_0000, etc.) for a 16-bit variable.
I tried using $countones. It is working for two bits but is not working consecutive 2 bits. Its display is
# Value is 10000000000100
# Value is 10000000010