A transistor converts an electrical signal into a 0 or 1 based on the amount of voltage going through it.
Main memory or RAM (Random Access Memory), is only used for temporary storage of data.
Introduction to Hardware and Software (incl operating systems)