Memory

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Unit Title: Computer Systems Architecture

Unit No: FW03 12

Computer Memory

Date: September 2016


Computer Systems Architecture FW03 12 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.

We will look at SRAM later when considering cache memory.

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.

© City of Glasgow College September 2016 2


Computer Systems Architecture FW03 12 Computer Memory

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.

Although the movement of data within the processor


is getting faster and faster, the system buses are not
keeping up. This leads to wasted time while the
processor waits for data to be fetched from main
memory. To reduce this problem most computers now
have a second, smaller, area of memory known as
cache memory. SRAM is usually used for this.

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.

© City of Glasgow College September 2016 3


Computer Systems Architecture FW03 12 Computer Memory

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.

The CPU contains a number of special-purpose registers:


• Instruction Register (IR): holds the instruction currently being executed.
• Memory Data Register (MDR): holds the piece of data that has been fetched from
memory.
• Memory Address Register (MAR): holds the address of the next piece of memory to
be fetched.
• Program Counter (PC): holds the location of the next instruction to be fetched from
memory.
• Accumulator: an internal CPU register used as the default location to store any
calculations performed by the arithmetic and logic unit.

© City of Glasgow College September 2016 4


Computer Systems Architecture FW03 12 Computer Memory

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

© City of Glasgow College September 2016 5


Computer Systems Architecture FW03 12 Computer Memory

Further Learning
Use the following websites to learn more about the topics we have covered.

• How caching works.

http://computer.howstuffworks.com/cache.htm

• How computer memory works.

http://computer.howstuffworks.com/computer-memory.htm

• How virtual memory works.

http://computer.howstuffworks.com/virtual-memory.htm

• SQA website about virtual memory and how it works.

http://www.sqa.org.uk/e-learning/COS101CD/page_26.htm

• SQA website about memory types and speed.

http://www.sqa.org.uk/e-learning/FirstLine01CD/page_16.htm

© City of Glasgow College September 2016 6

You might also like