help in making engine digital RPM meter

Joy:
and in option 2. are you telling me to write to the eeprom in this way...??

{

for (int i = 0; i < 512; i++)
    EEPROM.write(i, i);
}

Yes, that's the basic idea. Since the number of km is monotonically increasing, the highest value in the region you are writing to must be the most recent one. When you want to store a new value, store it in the cell containing the lowest existing value.