Generating random N random events in M clock cycle (N less than M)

In reply to dave_59:

Hi Dave,

Sorry for late reply and leaving a lot of details undeclared. But your solution helped me solve my problem.

Thanks.