Random number results

After that week of trying to understand how random would work here are some results from my test:

Random number output from chip 12F629:

2 - 5- 11- 7- 15 - 14 - 13 - 10 -4 - 8- 0 - 1 - 2 - 5
11 - 6 - 13 - 10 - 5 - 11 - 6 - 13 - 10 - 4 - 8 - 0 - 1 - 3
7 - 15 - 15 - 15 - 14 - 13 - 11 - 7 - 15 - 15 - 15 - 15 - 15 - 15
14 - 12 - 9 - 2 - 5 - 10 - 5 - 11 - 6 - 12 - 8 - 0 - 0 - 1 - 3 - 6

There does seem to be some strange duplications of numbers in the above string that was generated.

0 - 4
1 - 3
2 - 2
3 - 2
4 - 1
5 - 4
6 - 4
7 - 3
8 - 3
9 - 1
10 - 4
11 - 5
12 - 2
13 - 4
14 - 3
15 - 10

Generally there is an even distribution of numbers in the above list except for number 15 which was generated at least twice as many times as any other number.

0 - 7 count is 23
8 - 15 count is 29

These numbers were generated using:

start:

<b>Random rannum
If rannum = 66535 then start ' get an even distribution of odd and even numbers
number = rannum & \$000F</b>

I think the same results would come with:

<b>Random rannum
if rannum=66535 then start ' get an even distrubution of odd and even numbers</b> because either way only the first four bits are going to be looked at anyway.

I used one LED per port on four ports that represented bits 0 to 3 that were generated.

Anyone have any idea what might be up with those long strings of 15? This did show me that I may need to include a routine to stop the same number from being generated twice in a row.

Overall I am quite pleased with myself. My test programs all eventually worked as planned after I did more reading. I compiled them on the free online demo version and now I think I will download the pbc so I can work on the bigger final program.

Thanks for the help to this point!

Bart