Memory
Memory
Computer Memory
Main Memory
Main memory (RAM and ROM) stores programs and data while the computer is
operating. Memory used to be soldered onto the system board of the processor
(motherboard). The need to provide more readily upgradable computers led to the
development of Single In-Line Memory Modules (SIMMs) and later Dual In-Line
Memory Modules (DIMMs). These plug into a SIMM socket on the motherboard and so
makes it extremely easy to increase the amount of memory a computer has.
Random Access Memory (RAM) is a volatile memory. This means that the contents of
RAM are lost when power is no longer supplied to the chip. RAM can be written to
and read from. There are two types of RAM, namely static and dynamic (SRAM and
DRAM)
DRAM chips are more widely used. They are much cheaper to produce, can hold larger
amounts of data in a smaller physical area and require less power. They are dynamic,
requiring a constant current to retain information and therefore needs to be refreshed
hundreds of times per second. During this process of refreshing the memory cannot be
accessed thus making it slow to read or write data.
Read Only Memory (ROM) is a non-volatile store, which means that the contents
are held permanently. The software and data stored on the ROM are fixed at the
time of manufacture. Once programs and data have been entered into the ROM they
cannot be subsequently altered.
ROMs are used to store programs and data that do not change during the
operation of the system.
Where different software and/or data is needed on a ROM chip, manufacturers produced
a chip that allows existing data to be erased and new data written. These are known
as electrically programmable read-only memory chips (EPROMs). Shining ultraviolet
light onto the chip erases data.
EPROMs have the disadvantage that all the chip contents are removed during erasure.
The entire chip has to be reprogrammed, even if only a single memory word needs to
be changed.
Cache Memory
Program instructions are usually read sequentially. From one instruction it would be
reasonable to assume that the next instruction required will be in the next memory
location. This assumption is used to increase processor efficiency.
SRAM chips are very fast but are not suited for very large amounts of memory. They are
more suited to cache memory, where only small amounts are required.
When data or an instruction is read from memory, the memory locations following are
copied into the cache memory. At the next read instruction the cache memory is read
first. If the data is in cache the access time will be much lower than going to main
memory. If the data is not in cache then main memory will be accessed, and although
there is a slight loss of time from reading twice, the overall time saving in this method is
quite significant.
Virtual Memory
Virtual memory is a feature of an operating system that allows a computer
to compensate for shortages of physical memory by temporarily transferring
data from random access memory (RAM) to a portion of the hard drive. It
treats this as though it were main memory.
Eventually, the OS will need to retrieve the data that was moved to temporarily to disk
storage -- but remember, the only reason the OS moved pages of data from RAM to disk
storage to begin with was because it was running out of RAM. To solve the problem, the
operating system will need to move other pages to hard disk so it has room to bring back
the pages it needs right away from temporary disk storage. This process is known as
paging or swapping and the temporary storage space on the hard disk is called a page
file or a swap file.
Using virtual memory slows the computer down because copying to a hard disk takes
much longer than reading and writing RAM.
Registers
Registers are internal to the CPU and are areas used for temporary storage
of data and instructions that are being worked on by the processor. There
are several specific registers as well as general-purpose registers.
Secondary Memory
This can also be referred to as external memory or backing storage.
Secondary memory is the slowest and cheapest form of memory. It cannot be processed
directly by the CPU. It must first be copied into primary storage (also known as RAM).
Secondary memory devices include magnetic disks like hard drives and floppy disks;
optical disks such as CDs and CDROMs, USB drives, flash memory, etc.
The ROM technology where the contents of the chip can be altered is the
electrically erasable programmable read-only memory (EEPROM). By
applying suitable electrical pulses, this chip can be selectively reprogrammed
which means that the entire contents do not be erased. This is the
technology typically used for USB drives, compact flash memory and SD
cards.
Memory Hierarchy
Further Learning
Use the following websites to learn more about the topics we have covered.
http://computer.howstuffworks.com/cache.htm
http://computer.howstuffworks.com/computer-memory.htm
http://computer.howstuffworks.com/virtual-memory.htm
http://www.sqa.org.uk/e-learning/COS101CD/page_26.htm
http://www.sqa.org.uk/e-learning/FirstLine01CD/page_16.htm