Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Generating random binary bits in C

Status
Not open for further replies.

seamusmcd

New Member
hi, i was wondering is there anyway i can write c code to generate random binary bits........ thanks[/quote]
 
ill elaborate,

No, computers cannot generate random numbers, they can generate psudo-random numbers but these are just long sequences and can be predicted.

IF you are using linux (or *Nix) as a devel platform, you can use the random-number generator service to get a continuous stream of random data.

IF you are using a fisher-price operating system then your only bet is to to do a simplified version of what the linux Random-generator does.


How it works is to take "seeds" from teh truely random thing in the universe.... Humans.
Thus I would recomend monitoring you soundcard MIC input, thus you will have white noise in your input register, XOR with say the continous read from say the mouse buffers and it get a bit more random, add a few more human interations and you can get better.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top