Thursday, August 20, 2009

Computer literacy 101 -- what is memory?


We talked about the microprocessor, or CPU, of a computer last blog -- but what can it do without someplace to store, and retrieve, information (next entry will talk about how that information -- or data -- is used)?

The first thing to know about memory for computers is the idea of address space. Address space serves the same purpose for computers as postal addresses do for paper mail. Often that address space will start at zero (0) and continue to as large as the physical memory allows. As an example, you have a 4GB flash drive that you use for assignments -- carried between home and work, or classes. The addresses of the information on that flash drive will be from 0 up to 4 gigabyte - 1 (or
actually 4,294,967,295 but you can think of it as 4,000,000,000 units of information).

You also may have many different locations for memory -- these are called storage units. So, you may have a hard drive, a DVD-ROM drive, a USB flash card, and a set of backup files on a tape unit. Using the comparison to the paper mail system, let's say that each of these are in a different city -- so addresses consist of the information location (0 to 4 gigabyte on the flash drive) and storage location "G:flash_drive".

Alright, this is pretty cumbersome and it can really strain a microprocessor to directly address 4 gigabyte of memory (although it is possible for computers that describe themselves as "64-bit processors"). So, what most computer systems do is to break this memory down into separate "blocks" (or streets in the mail system). Each block may consist of 512 bytes. Therefore, we can now address a block as "G:flash_drive", "block 0 to 8,388,607" and a specific location as "G:flash_drive", "block 1,567", "byte 93".

OK. We see that by numbering the information and then breaking it down into separate groups we can effectively find all the information. But it is still rather clumsy talking about "G:flash_drive", "block 1,567", "byte 93". That is where the file system comes into play. A file system starts putting all of those numbers into friendlier terms. "Charles resume" is a lot easier to remember when one is doing a word processing program than telling it -- give me "C:CKS_hard_drive", "block 7,432 through 7,987", "bytes 0 (of first block) through 345 (of last block)".

Not only that, but this specific labeling of the location makes it very hard to move it -- what if I add something to the information (or file)? It will get bigger and the location will also get bigger -- do I now have to remember a whole new set of numbers? No. The file system will keep track of just where the file is now located and how large it is. (It also means that the file does not have to be contiguous -- the bytes can be located in different blocks and not come one after another.)

There are two other regions of memory that should be understood -- these are RAM and registers. Random Access Memory (RAM) is like your own pile of papers on your desk. It can be gotten to very quickly and is "right there". Registers are like "post-its" and are used for temporary copies of numbers to be used. RAM will often be addressed just by the byte numbers and registers will be referred to by special names (R1 for register 1) -- but these details aren't really important to most people.

Now that we have information in memory, how do we use it? That is the concept of data.

No comments:

To Waste or to Waist: That is the question

       As is true of many people growing up in the US, I was encouraged to always clean my plate (encouraged is putting it mildly -- I remem...