A great site to help you with your project and exam
Process: Comparators Zip File ©Christopher Leigh
Here are four teaching and learning handouts in Word format which may help you in using these system modules.  2c Using System Modules, 5a Electronic Switches, 6b System Module Capacitors, and 7b System Module Astables.  Check in the Handouts page for more useful handouts for teaching and learning.
Simple Comparator
An OpAmp (Operational Amplifier) can be used as a comparator very easily. Feed one of the OpAmp's inputs from the sensor block or other input block. Attach the other input to a variable resistor in a voltage divider arrangement. If the voltage on the + input to the OpAmp is higher than the voltage on the - input then the output of the comparator will be high, that is, around the battery voltage. If the + input is lower than the - input the output voltage will be nearly zero. If the output load (the next block) only needs a small amount of current then it can be connected between the output and one of the power lines. Otherwise you will need to use a transistor or FET driver. NB, if an LED is connected between output and zero and is on, one connected between output and battery voltage will be off. This circuit may need a voltage reducing block (see below) before a transistor driver if you are using an "old" OpAmp such as the 741.
Easy-Adjust Comparator
This circuit works exactly the same as the previous one, except that the extra resistors allow the precise switching point to be set far more easily. However, the previous block (eg sensor) needs to provide a voltage which is in the middle of the range. So with a 9 volt battery as the power source, this circuit can accept an input voltage of between 3 and 6 volts. Usually that does not cause a problem.
Schmitt Trigger
This extremely simple circuit can be used as a simple comparator. Its switching point is fixed and depends on the actual chip used. You can use a Schmitt Not gate (a 40106 as shown here) or, by joining the inputs, a Schmitt Nand gate (such as the 4093) or a Schmitt Nor Gate.
Adjustable Schmitt
You can construct a variable Schmitt trigger by constructing your own Schmitt Trigger from two Not gates using a feedback resistor and a variable input resistor.
In-Range Comparator
This circuit block provides a low output if the input voltage is between the values set by the two variable resistors. For example, if they are set at 4v and 5v then the output will be low if the input is between those two figures. The two LEDs shown will be lit if the input is either too high or too low. They can be omitted if you wish. The FET output stage needs a load connected to +V. The 10k resistor holds the output high when the input is not in range.
Voltage Reducer
If you are using the 741 OpAmp for your comparator then you will need a voltage reducer before your transistor driver. This is because the output of the 741 will only drop to about 2volts using a single battery. This means that a transistor driver block will never turn off. We need to reduce the voltage to less than the turn-on voltage of the transistor (about 0.7v). Either a 10k preset or two fixed resistors of 4k7 and 2k2 should do the trick. The high voltage of the 741 (say 7volts using a 9v PP3 battery) is still plenty high enough to make sure the transistor is turned fully on (saturated).
De-bouncer
Most switches use mechanical contacts that often don’t produce a nice clean output. They suffer from bounce. This is when the output switches up and down a few times before deciding what it should be and giving a stable output. The same thing can happen when the switch is released. To overcome this you can use a de-bounce circuit. The one shown here is a de-bounce circuit designed for an input that pulses high. It uses a double inverter to get the output high again. By careful design you would only need one inverter for most inputs and process blocks.