Hi
You can go for Schmitt trigger, it will help you to derive square wave from sin wave with the same frequency. Schmitt trigger nothing but a comparator, which will compare zero voltage. If you are using op-amp for Schmitt trigger "note that" give only +5VDC for powering the op-amp, because you required TTL logic. Here is a useful link for more information.
http://en.wikipedia.org/wiki/Schmitt_trigger