Nonvolatile Memory Design: Magnetic, Resistive, and Phase Change