Computers: Memory

    Computers: Memory

      Memory can be deceiving. Just think about

      • when you walk into a room only to forget why you're there. 
      • when you drive around with a senior who can remember where everything used to be 50 years ago but has no idea where their glasses are today.
      • when you try to forget something. That’s when you find out how great your memory is.

      That sounds terrifying and…it kind-of is, but forgetting things is totally normal and important for brain functioning. Computer memory, though? That stuff never forgets.

      (Unless the file gets corrupted. Or the computer dies before you can save the file. Or the sun goes supernova and everything on Earth—including the Earth itself—gets destroyed by the explosion.)

      Computer memory is an all-encompassing term for any piece of data your computer keeps track of. Some of it's storage just like a closet at home. In it, data and programs can sit quietly until you need to use them again. Some of it's the part that's actively doing things like calculating numbers and drawing the screen onto the monitor.

      A triangle that represents the hierarchy of computer memory with the CPU above the cache and the cache above the RAM. Below that is Secondary Storage and Input Sources.

      Whatever type of memory you're dealing with, it's going to store each piece of data and each program instruction to a set of bits (the smallest pieces of computer memory). A bit can either be on or off. When you combine all those bits into different combinations of off (zero) and on (one), you can start saving meaningful data in the computer in the form of true (one, or on) or false (zero, or off) statements.

      In order to get to that specific, stored information, the computer assigns that data to an address—a number that matches a place in memory. Each address location is fixed in size, only holding two bytes of information. For context, each byte has eight bits of information, which means that every address has 16 bits of zeros and/or ones.

      16 bits of data means 216 different combinations, which is 65536 different ways you can save data. That still isn't enough for the vast majority of data.

      Since data and program instructions usually take up more than two bytes of space, it's going to take up more than one address. To handle that, the Central Processing Unit (CPU) just keeps track of the starting address—along with the length—of each piece of data or instruction. That way, when the CPU needs to grab that information, it knows where to go and how many bytes of information to pick up before it's no longer looking at the data.

      If it's off by a byte or two? Instant data corruption. But that doesn't happen too often.

      ROM

      Read Only Memory stores information that the computer needs to reference over and over. This information is permanent. Nothing can ever be overwritten or replaced, which means that everything in this area needs to be the kind of stuff that never changes. It stores things like the available character sets and symbols (including the Latin alphabet, the Cyrillic alphabet, all three Japanese alphabets, and any other language you can think of) and internal programs that run every time you start up your computer (like BIOS and POST).

      RAM

      Random Access Memory is completely different from ROM, so be careful with your vowels when you talk about them. This memory's only available when the computer's powered on. It'll temporarily store numbers, instructions, addresses, and any other information your software needs to save until it's ready to pick it up again and use it.

      Just be careful of how much you're storing there. It's like your kitchen counter. You can take things out of the cabinets for a cooking project any time you want, but if you leave things there after you're done, you won't have space for the next cooking adventure. To save that space for whatever you're currently working on, you'll want to move things back into the cabinets/fridge.

      RAM can be the deciding factor in how your computer runs. Just like if you only have a tiny square to make your dinner, a small amount of RAM to work with means that doing anything is going to take much more time than it should. For that reason, a computer with more RAM will run faster than the same computer with less RAM. When your computer runs out of RAM because all the memory's being taken, the CPU has to stop whatever it's doing to move around data so that it can put whatever it's working on in the RAM.

      Keeping track of all this? Good.

      Today’s microprocessors (CPUs) are so fast that the delay you experience with this kind of a swap out is unnoticeable, but you might want to think about it the next time you're browsing the computer section of your local Best Buy.

      To bring it back to software, device drivers sit in the ROM (the kitchen cabinet) but get loaded into RAM every time the computer's turned on.

      Internal Memory

      The hard disk drive (HDD), also called the hard drive, is the place where all the applications get saved. Any time you're dealing with your operating system, applications like Microsoft Word or Firefox, and even files in memory, you're actually accessing data from the hard drive.

      The hard drive looks pretty similar to a CD except it's—wait for it—hard. It's usually made from glass, ceramic or aluminum alloy, to be exact, and has multiple layers (called platters) coated in a magnetic material.

      That drive also has a head that moves across the disk, reading and writing data onto it. In order for that head to move, though, it needs a motorized arm that holds it a set distance above the disc. The disc itself also has a motor for spinning. While the disc spins, the arm moves back and forth across its radius.

      External Memory

      Sometimes one hard drive isn't enough for all the memory you want to take up. (We're looking at you, Excessively Detailed Video Game Art.) If your hard drive can't give you all the memory you want and deserve, you always have the option to look for some external memory. Like you probably guessed from the name, external storage, also called secondary storage, can be separated externally from the computer. Because it'll separate without freaking out, you don't have to use it all the time, just when you need it.

      This is also the kind of device you'll want to use to hold large volumes of data over long periods of time. Anything from a CD to a jump drive to an external hard drive counts as secondary storage.

      It's also the kind of storage that gets changed the most quickly. Ever heard of a Floppy disk or a LaserDisk? No? That's because they've been so thoroughly pommeled by better external storage options (except maybe in hipster cred).