You are on page 1of 22

Memory

The memory unit is an essential component in any digital computer since it is needed for storing programs and data
CPU needs faster memory to process data. Not all accumulated information is needed by the CPU at the same time Therefore, it is more economical to use low-cost storage devices to serve as a backup for storing the information that is not currently used by CPU

Computer Memory: types


Primary Storage Secondary Storage

Evolution of Man and Storage

Memory Types
The memory unit that directly communicate with CPU is called the main memory Devices that provide backup storage are called auxiliary memory
The memory hierarchy system consists of all storage devices employed in a computer system from the slow by high-capacity auxiliary memory

to a relatively faster main memory, to an even smaller and faster cache memory

Memory hierarchy
Memory Hierarchy is to obtain the highest possible access speed while minimizing the total cost of the memory system

Kilobyte Megabyte Gigabyte Terabyte Petabyte Exabyte Zettabyte

Register

Cache

Main Memory

Magnetic Disk

Magnetic Tape

Primary Storage
Primary storage or main memory stores three

types of information for very brief periods of time: Data to be processed by the CPU; Instructions for the CPU as to how to process the data; Operating system programs that manage various aspects of the computers operation. Primary storage takes place in chips mounted on the computers main circuit board, called the motherboard.

Main Types of Primary Storage


Registers
Random access memory (RAM) Cache memory
Read-only memory (ROM)

Register

RAM

Cache

Cache memory
If the active portions of the program and data

are placed in a fast small memory, the average memory access time can be reduced, Thus reducing the total execution time of the program Such a fast small memory is referred to as cache memory The cache is the fastest component in the memory hierarchy and approaches the speed of CPU component The typical access time ratio between cache and main memory is about 1 to 7

Cache memory Mapping


The basic characteristic of cache memory is its fast access

time, Therefore, very little or no time must be wasted when searching the words in the cache The transformation of data from main memory to cache memory is referred to as a mapping process, there are three types of mapping:
Associative mapping Direct mapping Set-associative mapping

The operation of cache memory


1. Cache fetches data from next to current addresses in main memory 2. CPU checks to see whether the next instruction it requires is in cache

Main Memory (DRAM)

Cache

Memory
(SRAM)

CPU

4. If not, the CPU has to fetch next instruction from main memory - a much slower process

3. If it is, then the instruction is fetched from the cache a very fast position

= Bus connections

HIT / MISS concept


The performance of cache memory is frequently

measured in terms of a quantity called hit ratio When the CPU refers to memory and finds the word in cache, it is said to produce a hit Otherwise, it is a miss Hit ratio = hit / (hit+miss)

Types of main memory


There are two types of main memory, Random Access Memory (RAM) and Read Only Memory (ROM)

Random Access Memory (RAM)


holds its data as long as the computer is switched on All data in RAM is lost when the computer is switched off Described as being volatile It is direct access as it can be both written to or read from in any order Its purpose is to temporarily hold programs and data for processing. In modern computers it also holds the operating system

Random-Access Memory (RAM)


Static RAM (SRAM)
Each cell stores bit with a six-transistor circuit. Retains value indefinitely, as long as it is kept powered.

Dynamic RAM (DRAM)


Each cell stores bit with a capacitor and transistor. Value must be refreshed every 10-100 ms.

Tran. per bit SRAM DRAM 6 1

Access time Persist? Sensitive? 1X 10X Yes No No Yes

Cost 100x 1X

Applications cache memories Main memories, frame buffers

ROM
ROM holds programs and data permanently even when computer is switched off Data can be read by the CPU in any order so ROM is also direct access The contents of ROM are fixed at the time of manufacture

Stores a program called the bootstrap loader that helps start up the computer
Access time of between 10 and 50 nanoseconds

Types of ROM
1. Programmable Read Only Memory (PROM) Empty of data when manufactured May be permanently programmed by the user

2. Erasable Programmable Read Only Memory (EPROM) Can be programmed, erased and reprogrammed

The EPROM chip has a small window on top allowing it to be erased by shining ultraviolet light on it
After reprogramming the window is covered to prevent new contents being erased Access time is around 45 90 nanoseconds

3. Electrically Erasable Programmable Read Only Memory (EEPROM)


Reprogrammed electrically without using ultraviolet light Must be removed from the computer and placed in a special machine to do this Access times between 45 and 200 nanoseconds

Secondary Storage
Memory capacity that can store very large amounts of data for extended periods of time. Magnetic tape (sequential access) Magnetic disks (direct access)
Secondary Storage: It is nonvolatile. It takes much more time to retrieve data because of the electromechanical in nature. It is cheaper than primary storage. Auxiliary memory access time is usually 1000 times that of main memory

Magnetic Tape

Magnetic tape: A secondary storage medium on a large open reel or in a smaller cartridge or cassette. Sequential access: Data access in which the computer system must run through data in sequence in order to locate a particular piece of data.

Hard Drive
Hard drives: A form of secondary storage that stores data on platters divided into concentric tracks and sectors, which can be read by a read/write head that pivots across the rotating disks.

Optical Storage Devices


Compact Disk, Read-Only Memory (CD-ROM) Digital Video Disk (DVD) Blu-ray disc
Direct access: Data access in which any piece of data be retrieved in a non sequential manner by locating it using the datas address.

VS The Winner

Virtual memory
Uses backing storage e.g. hard disk as a temporary location for programs and data where insufficient RAM available Swaps programs and data between the hard-disk and RAM as the CPU requires them for processing A cheap method of running large or many programs on a computer system Cost is speed: the CPU can access RAM in nanoseconds but hard-disk in milliseconds (Note: a millisecond is a thousandth of a second) Virtual memory is much slower than RAM

TERMS : Memory
Main memory consists of a number of storage locations, each of which is identified by a unique address
The ability of the CPU to identify each location is known as its addressability Each location stores a word i.e. the number of bits that can be processed by the CPU in a single operation. Word length may be typically 16, 24, 32 or as many as 64 bits. The access time = seek time + transfer time Seek time: required to position the read-write head to a location Transfer time: required to transfer data to or from the device The average time required to reach a storage location in memory and obtain its contents is called the access time

You might also like