The ATmega8 has a built in analog comparator in it that you can utilize. You just have to initialize it in your programming. Check the data sheet for more info and instructions.
I would do this as opposed to using a discrete device for this purpose. This way you get to learn more ATmega8 feature and build up your programming repertoire.