function chr=genbin(bitl,numchr)
     maxc=2^bitl;
     numchr=min(numchr,maxc);
     chr=round(rand(numchr,bitl));
