Your question is unclear due to being poorly worded, so I'll define what I'm answering.
You have a input signal that can vary from 0V to 4.5V, and you want a 0 or 5V logic signal out depending on the voltage of the input signal. For inputs of 2.24V or below, you want logic low output, and for inputs of 2.70V or higher you want logic high output.
This is easy, and is called a "comparator". There is actually little difference between a comparator and a opamp. Comparators tend to have open collector/drain outputs more often, but that is not inherent to being a comparator.
In your case, you can use 2.5V as the threshold. So put 2.5V into the negative input and your external signal into the positive input. The result will be high when above 2.5V and low below. This is all you need if you know for sure your input signal won't spend much time near the 2.5V switching threshold.
If the input signal might stay for a while near 2.5V, then you want to add something called "hysteresis". This is a little positive feedback such that the threshold level changes depending on what state the output is in. For example, when the output is low, the input must be above 2.6V to make the output go high. When the output is high, the input must go below 2.4V for the output to go low. Now the input can change slowly thru the transition region but you still get a single clear digital edge out. In this example, the input can have up to 200mV peak-peak noise on it and still guarantee to cause only a single output edge as it transitions from high to low.
Here is such a circuit with a switching threshold of 2.5V and about 100mV hysteresis. It should do what you want if I understand the question correctly.
R3 and R4 divide the 5V supply to make a 2.5V reference. C1 adds some filtering so that noise on the 5V supply won't get onto the 2.5V reference. This 2.5V result is fed into the negative input of the comparator (actually a opamp used in comparator role in this case). Since this value is fixed, the output will go high when the positive input is above 2.5V and low when below 2.5V.
C2 is the power supply decoupling capacitor for the opamp. It should be there, but can be ignored for the purpose of understanding how the comparator is used and how the hysteresis works.
Before jumping into hystersis, consider how the circuit would work if R2 weren't present. Since the opamp inputs are very high impedance, R1 basically does nothing in that case. The input voltage will be presented directly to the positive opamp input. So if the input is above 2.5V, the output will go high. If the input is below 2.5V, the output will go low. This is a straight forward comparator function.
Now consider the effect of adding R2. It adds a little bit of the 0 or 5 volt output to the input. You can think of R2 and R1 forming a voltage divider so that changes of the output show up attenuated at the positive input. The voltage divider ratio is R1 / (R1 + R2) = 0.021. The output always changes in 5V steps, so those steps will be 5V * .021 = 104mV at the opamp positive input. That means the input signal as the opamp sees it will have about 50mV added to it when the output is high, and 50mV subtracted from it when the output is low. This 100mV difference is the size of the hystersis band.