1. The method comprising: electronically detecting a corresponding bit-width of each rank of a memory, each rank comprising memory devices; selecting an error correction algorithm from a plurality of error correction algorithms for each rank of the memory based upon the corresponding bit-width of a memory device in the rank, the plurality of error correction algorithms implemented by error correction logic associated with the memory; and correcting an error in the memory device using the selected error correction algorithm.