Memory

When you think of memory you usually think of files stored inside your computer. However, this is a very narrow view of a computer's memory. There are many different types of computer memory, and here we shall explain the most common types.

Binary Number System
The most important part of the computer is the binary number system. The binary number system is like a code for the computer, and uses the digits one and zero to represent numbers. A computer uses this system to keep track of data; however, since it is an electrical device (and it has electrical devices inside it too), it cannot use the old-fashioned way of recording down this data with paper and pen. Instead, it uses voltages. A '1' is a high voltage, a '0' is a low voltage.

Every piece of data is represented by a different sequence of binary numbers. Counting in binary is simple: once you count past the highest digit (which in this case is '1'), you put a zero in the place and carry the one to the next column. For example, if you were counting from one to ten, the binary sequence would look like this:

 Binary 00000000, 00000001, 00000010, 00000011, 00000100,...00001001, 00001010

Numbers 0,       1,         2,        3,        4,...       9,        10

As you can see in the example above, the different sequences of binary numbers all represent different numbers. All of the tasks that a computer does are simply numbers that are converted into the binary system for the computer to understand and hence it can do the jobs you request it to. Otherwise, you would be bashing your machine for the rest of your life (well, either until you've read this article, or you realize that the computer you've been bashing has been broken the moment you start bashing it.) Anyway, in order to represent negative numbers, the last bit (the digit on the left-most column) is reserved for showing whether the number is positive or negative. For example, 11111111 would be -1 in plain English.

Bits and Bytes
Often in the computer world you would encounter terms such as bits and bytes, shown by the symbol 'b' and 'B' respectively. At first you might be confused about the two: they look like they have the same symbols, and they seem to be interchangeable. But they're not. Whilst both bits and bytes refer to data on computers, a bit is the smallest amount of data that can be transferred, and, as stated above, is stored as the binary numbers 1 and 0. A byte, however, is 8 bits sequenced together to represent a single unit of information. Bytes are often used by computers to store information.

Sizes
Bytes are needed to store information on a computer. If you look at your computer's hard drive, you'll find perhaps hundreds of gigabytes (shown as GB) in your computer. (See screenshot at right for an example.)

Today, the cost of storing large amounts of information is has fallen drastically low (see here for a table of the falling cost of hard drive space, though it is only up to 2004), and it would be absurd to express computer storage in millions of bytes. That would be confusing and stupid. Hence the following terms for the quantities of data:

Byte (B)
A byte is 8 bits, and to put it to comparison:
 * 0.125 bytes is enough for a yes/no decision
 * 1 byte is a character
 * 10 bytes is a word in human language
 * 100 bytes is enough for a telegram.

Kilobyte (KB)
A kilobyte is 1,024 bytes, and to put it to comparison:
 * A kilobyte is perhaps a few sentences
 * 2 kilobytes is a written page
 * 10 kilobytes is a page of a printed encyclopedia
 * 100 kilobytes is a very low quality image.

Megabyte (MB)
A megabyte is 1,048,576 bytes, and to put it to comparison:
 * 1 megabyte is the size of a typed novel with no formatting or graphics
 * 2 megabytes is the size of a high resolution paragraph
 * 5 megabytes is the complete works of Shakespeare, or 30 seconds of video
 * 10 megabytes is the size of a chest X-ray
 * 100 megabytes is two encyclopedia volumes
 * 700 megabytes is the storage capacity of a CD-ROM

Gigabyte (GB)
A gigabyte is 1,073,741,824 bytes, and to put it to comparison:
 * A gigabyte is around 90 minutes of video
 * 2 gigabytes is 20 yards of books on a shelf
 * 4 gigabytes is the average storage capacity of a USB flash drive
 * 16 gigabytes is the maximum capacity of an iPod nano (2009)
 * 20 gigabytes is the audio collection of the complete works of Beethoven
 * 100 gigabytes is a library floor of academic journals on shelves
 * 160 gigabytes can store up to 20,000 songs and 200 hours of video

File size terms larger than GB

 * A terabyte (TB) is 1,099,511,627,776 bytes
 * A petabyte (PB) is 1,125,899,906,842,624 bytes
 * An exabyte (EB) is 1,152,921,504,606,846,976 bytes
 * A zettabyte (ZB) is 1,180,591,620,717,411,303,424 bytes
 * A yottabyte (YB) is 1,208,925,819,614,629,174,706,176 bytes

Bit terms
In additions to the different terms for the number of bytes for storage, there are also different terms for the amount of bits involved, although the usage of such terms are very rare. But for information's sake it is included here.
 * A kilobit (Kb) is 1,024 bits
 * A megabit (Mb) is 1,048,576 bits
 * A gigabit (Gb) is 1,073,741,824 bits
 * A terabit (Tb) is 1,099,511,627,776 bits

The prefix for bit terms are similar to the prefixes for byte terms.

Video: How a computer stores you files

Although the video above is ancient compared to today, it's the same way computers store information today (and it gives you a look at how people in the 90s saw computing!) Also, the descriptions of the file size terms are rounded and therefore somewhat inaccurate.



Is more better?
Ultimately, the decision of wanting more hard storage space is up to you, the reader (and consumer). If you are only typing word documents for work, you won't need much hard drive space for your purposes. However, if you are dealing with large amounts of music, photos, design work and video, it's best to buy a hard drive with lots of space, and you can get them for very low prices nowadays. You can also install another hard drive to your computer by buying a naked hard disk drive and putting it into your computer yourself (see video below.) Although hard drive disks provide lots of room for storing your digital files, they aren't indestructible. Hitting them, cutting their power when they are being used, drowning them with water, shattering them and doing other nasty acts to a hard disk drive will cause all your files, precious photos, game achievements and so on so forth to disappear. So, it's a good idea to back up, or copy your files, to a second hard disk drive to prevent such a great loss. This can be achieved throughspecial software that allows you to do this automatically.

Video: How to install a hard drive to your computer



RAM
Random Access Memory, often know as RAM, provides space for your computer to temporarily store data that is in current use so the CPU can quickly access and read information. RAM is volatile, which means that there is data in the computer's RAM as long as the computer is turned on, so when the computer is shut down, all data stored in the RAM is lost. The reason why RAM is 'random' is because any piece of information can be circulated through it, regardless of its location or its relation to the other data stored already.

If more RAM is installed to your computer, the number of times your computer needs to read from your hard disk drive, or virtual memory, is reduced, making your computer run considerably faster. In addition, RAM itself is faster to read and write (get information) than other storage devices, such as flash drives and discs. However, it can only store a limited amount of data. If the RAM fills up, the CPU has the continually go back to the hard disk drive to overlay old data with the new, slowing down a computer's operations. The effects include the experience known as "lagging" in slang terms, where the screen feels jittery and everything doesn't go smoothly. However, RAM cannot be completely filled up: even in the times where your computer is running the slowest because you have so many programs open, it still continues to accept new data, which is unlike a hard disk drive, though, as mentioned, it runs very slowly.

You can, however, install more RAM onto the computer, and most computer manuals include instructions that teach you how to properly perform the installation. Make sure you follow it, or you might break essential components, or check out the video below. Though you can purchase RAM separately online or in a hardware store, the amount of RAM you can install onto a computer is limited by the motherboard. The most powerful computers can have dozens of gigabytes installed to the motherboard. It is now common to have computers that have at least 2-4 gigabytes of RAM installed, because of falling prices and the demanding power that software needs nowadays.

'

Video: How to install more RAM into your computer

''Every computer has RAM in different places. Consult your computer manual for more details.''



Monitoring RAM Usage
The reason why most computers lag is because their RAM is full. You can monitor your RAM usage using Windows Task Manager on a PC, or Activity Monitor on the Mac. A screenshot of RAM usage is provided on the right. As you can see, the RAM is split into 4 different states of usage. The first two, Wired and Active, can the portions where the RAM is used. The last two, Inactive and Free, indicated where the RAM is idle. The numbers beside the states of usage denote how much the RAM is in that state; here, for example, only 76MB of RAM is free. These four proportions change when you start or end programs: more data is stored on the RAM as you launch more programs, so the proportion of which the RAM is active or wired becomes larger, and data is deleted from the RAM when you close a program. Below the graph, the monitor shows the five larges programs, or processes, that are using the RAM, and below that, the monitor mentions 'Swap'. RAM swapping is a process where the computer temporarily uses part of the hard drive as memory. Check your computer's remaining hard drive space at time when you have lots of programs on, and you might see that your available space has decreased by at most 1 gigabyte, but returns the next time you reboot it. This happens when people need more memory than the RAM can offer. If a computer constantly swaps, it is known is "thrashing". Thrashing can slow down a computer, and to solve this problem, you need to install more RAM.

Types of RAM
Several types of RAM are used in modern computers. The most common types of RAM you can find is static RAM (SRAM), in which data is stored in the state of a flip flop, and is primarily used for cache (which you can read about in the next section. Another common type of RAM is dynamic RAM (DRAM), which stores data as a charge on a capacitor. Another widely used type of RAM is ROM, which uses a metal mask that can permanently disable or enable certain transistors, so no more data can be stored. This is also why DVD-ROMs and CD-ROMs cannot store any more data, and are commonly used for movie and music discs. VRAM, of Video RAM, is another common term to describe computer memory. This type of RAM is specifically designed for video adapters of 3D graphic engines, which determine the resolution and color depth of the displayed items allow you to play computer games or use an external cable to show videos stored on your hard disk in a TV screen. This type of RAM has two access ports instead of one, allowing the CPU and the graphics engine to access the RAM at the same time, so VRAM is often described as 'shared'. The graphics card can also have its own RAM, however, so graphics performance can be boosted, so that you can see your Sims being taunted in a pixel perfect screen.

Flash memory is also widely used as a non-volatile alternative to SRAM and DRAM, since they constantly need electricity to keep its data. Many new products, such as music players, scientific calculators, and mobile phones use this kind of technology to store their data.

More Information
The above was a brief guide to give you the very basics of RAM. For more information, check out the following links:
 * How Stuff Works: How RAM Works A comprehensive guide to RAM, including an exhaustive list on the types of RAM.
 * Kensington Technology Ultimate Memory Guide An even more exhaustive guide to RAM, and includes hard-to-understand jargon, tables and charts to make you a memory genius.

Cache
Cache, pronounced cash, is a form of extremely fast memory built into the CPU, or located next to it as a separate chip. The CPU uses cache memory to store instructions that the computer user commonly uses, reducing the number of times the processor needs to get the data and improving the overall speed of the computer. The advantage of cache memory is that the CPU does not need to motherboard to transfer data, as the motherboard is already loaded with other information. That way, the speed of the computer is further increased. When computer programs are stored in the memory cache, they can operate more quickly and efficiently. As a matter of fact, cache is so efficient at helping run programs that a computer with a fast processor but little cache is slower than a computer with a slower processor but more cache.

There are several types of cache you might hear when you look at a computer's specifications. Cache built into the CPU is called a Level 1 Cache (L1). Cache that is built outside the CPU is called a Level 2 Cache (L2). Some CPUs have both L1 and L2 cache built in and call it Level 3 Cache (L3). L1 cache is faster than L2 cache because it is closer to the processor and usually runs at the clock speed of the processor as well. L2 cache is relatively slower, but is still twice as fast as RAM. Although cache is very expensive, it is worth getting a computer with some cache built into the CPU to make sure the computer works quickly and efficiently.

Video: How Cache Works

For more information, check out this presentation below.



Virtual Memory
Sometimes, you can be running so much programs on your computer that your RAM runs out of space to store new data and the computer begins to run very slowly. This is when virtual memory kicks in. With virtual memory, the computer finds data on the RAM that has not been used recently and copies them onto the hard drive and is stored as a page file, freeing up space for the RAM to accept new data. The computer does this automatically when there is no more space in RAM.

Virtual memory is a cheap benefit to computer users, since it only uses the hard drive space in your computer and hard drives are much more cheaper than RAM. However, the read/write speed of the hard drive is slower than RAM, so when virtual memory is used, the computer will run slower. This system performance is even slower if there is not enough RAM in the computer, making the computer swap information between the RAM and the hard disk. Make sure enough RAM is installed on your computer so that the computer can run efficiently and use virtual memory as a compliment to RAM.