How to generate a random 16 bit number , having fixed number of "1" s in it . Like 16bit number with 5 "1"s in it, example "0000-1010-1110-0000"

item is the variable in which the sum of the array is stored. Please refer to section 18.5.8.2 of LRM for more details.

In reply to roopanandakumaran:

Dave,
I also have a simialr issue and have a new post for the same.
But what is “item” you are referring to here ??
Thanks!