I took this from talking electronics website and it didn't work .. I found the problem and fixed it and here it is..
This thing is what i was searching for for along time.
It's more complex whit logic gates (i think)
I couldn't find any circuit by the others that actualy work .. This one does..