2^5=32. So 0-31. 2^3=8. So 0-7. I.e. for 3 bit: 000 - 0 001 - 1 010 - 2 011 - 3 100 - 4 101 - 5 110 - 6 111 - 7 Chen Xiao Fan wrote: > Sorry but I think 3 bit of random number is not > the same as 0-7 and 5 bit of random number is not > the same as 0-31. Do I miss something obvious? > > Regards, > Xiaofan > -- Hector Martin (hector@marcansoft.com) Public Key: http://www.marcansoft.com/hector.asc -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist