0% found this document useful (0 votes)
5 views

Module 6_Memory

Uploaded by

velitario.seph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Module 6_Memory

Uploaded by

velitario.seph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Memory

CPE131-1: Computer Architecture and Organization

William Stallings
Computer Organization
and Architecture
8th Edition
¤ Most computers are built using the von Neumann model, which is
centered in memory
~ Programs that perform the processing are stored in memory
¤ New technologies continue to be introduced in an attempt to match
the improvements in CPU design
~ The speed of memory has to keep pace with the CPU
¤ Two basic types of memory:
~ RAM (Random Access Memory)
~ ROM (Read-Only Memory)
¤ RAM (Random Access Memory):
~ A read-write memory, known as the “main memory”
~ The memory to which computer specifications refer
~ Used to store programs and data that the computer needs when executing
programs
~ Volatile memory
~ Loses information once the power is turned off
¤ General types of RAM:
~ SRAM (Static RAM)
~ holds its contents as long as power is available
~ Consists of circuits similar to D flip-flops
~ Faster, more expensive
~ DRAM (Dynamic RAM)
~ Composed of tiny capacitors that leak electricity
~ Requires a recharge every few milliseconds to maintain its data, but uses less power (thus,
generates less heat)
~ Much denser (can store many bits per chip)
¤ BOTH technologies are often used in combination:
~ DRAM
~ Used as main memory
~ SRAM
~ Used as cache memory
¤ Types of DRAM:
~ Multibank DRAM (MDRAM)
~ Fast-Page Mode (FPM) DRAM
~ Extended Data Out (EDO) DRAM
~ Burst EDO (BEDO) DRAM
~ Synchronous Dynamic RAM (SDRAM)
~ Synchronous Link (SL) DRAM
~ Double Data Rate (DDR) SDRAM
~ Direct Rambus (DR) DRAM
¤ Types of SRAM:
~ Asynchronous SRAM
~ Synchronous SRAM
~ Pipeline Burst SRAM
¤ ROM (Read-Only Memory):
~ Stores critical information necessary to operate the system (such as the
program necessary to boot the PC)
~ Non-volatile memory
~ Always retains its data even without power
~ Used in embedded systems or any system where the program does not need to change
¤ Types of ROM:
~ ROM
~ PROM (Programmable ROM)
~ EPROM (Erasable PROM)
~ EEPROM (Electrically Erasable PROM)
~ Flash Memory
¤ PROM (Programmable ROM)
~ A variation on ROM
~ Can be programmed by user with the appropriate equipment
~ ROMs are hardwired; PROMs have fuses that can be blown to program the chip
~ Once programmed, the data and instructions cannot be changed
¤ EPROM (Erasable PROM)
~ Programmable with the added advantage of being reprogrammable
~ Erasing an EPROM requires a special tool that emits ultraviolet light
~ To reprogram EPROM, the entire chip must be first erased
¤ EEPROM (Electrically Erasable PROM)
~ No special tools are required for erasure
~ This is performed by applying an electric field, erasing only portions of the chip, one byte at
a time
¤ Flash Memory
~ Essentially EEPROM with the added benefit that data can be written or erased
in blocks, removing one-byte-at-a-time limitation
~ This makes flash memory faster than EEPROM
¤ Not all memory is created equal, and some types are far less efficient
and cheaper than others
~ Today’s computer systems use a combination of memory types to provide the
best performance at the best cost
~ This approach is called hierarchical memory
¤ Hierarchical Memory
~ As a general rule, the faster memory is, the more expensive it is per bit of
storage
~ By using a hierarchy of memories, each with different access speeds and storage
capacities, a computer system can exhibit performance above what would be possible
without combination of the various types
¤ Hierarchical Memory
~ The base types that normally constitute the hierarchical memory system
include:
~ Registers
~ Cache
~ Main memory
~ Secondary memory
¤ Hierarchical Memory
~ Today’s computers each have small amount of very high-speed memory, called
a cache:
~ Data are stored in cache from frequently used memory locations temporarily
~ This cache is connected to a much larger main memory
~ Main memory is typically a medium-speed memory
~ Main memory is complemented by a very large secondary memory
~ Composed of hard disks and various removable media
¤ Hierarchical Memory
~ We classify memory based on its “distance” from the processor
~ Distance is measured by the number of machine cycles required for access
~ The closer memory is to the processor, the faster it should be
~ As memory gets further, we can afford longer access times
¤ Terminologies:
~ Hit – the requested data reside in a given level of memory
~ Miss – the requested data is not found in the given level of memory
~ Hit rate – the percentage of memory accesses found in a given level of memory
¤ Terminologies:
~ Miss rate – the percentage of memory accesses not found in a given level of
memory (Miss Rate = 1 – Hit Rate)
~ Hit time – the time required to access the requested information in a given level
of memory
~ Miss penalty – the time required to process a miss, which includes replacing a
block in an upper level of memory, plus the additional time to deliver the
requested data to the processor
~ The time to process a miss is typically significantly larger than the time to process a hit
¤ Cache memory is a small, high-speed type of memory that serves as
a buffer for frequently accessed data
~ Main purpose is to speed up memory accesses by storing recently used
data closer to the CPU, instead of storing it in main memory
~ Cache is not accessed by address; it is accessed by content
~ Cache is typically composed of SRAM, providing faster access with a much shorter cycle
than DRAM (about 10ns)
¤ The size of cache memory vary enormously
~ A typical PC’s level 2 (L2) cache is 256K or 512K
~ Level 1 (L1) cache is smaller, typically 8K or 16K
~ L1 cache resides on the processor, whereas L2 cache resides between the CPU and
main memory
~ L1 is therefore, faster than L2 cache
¤ Another important concept inherent in the hierarchy is virtual
memory
~ The purpose of virtual memory is to use the hard disk as an extension of RAM,
thus increasing the available address space a process can use
~ Computer addresses more main memory than it actually has, and it uses the
hard drive to hold the excess
~ This area in the hard drive is called page file
¤ The most common way to implement virtual memory is by using
paging
~ A method in which main memory is divided into fixed-size blocks and programs
are divided into the same size blocks
¤ Basic idea of paging:
~ Allocate physical memory to processes in fixed size chunks (page frames) and
keep track of where the various pages of the process reside by recording
information in a page table
~ Every process has its own page table that typically resides in main memory, and the page
table stores the physical location of each virtual page of the process
¤ Terminologies:
~ Virtual address – the logical or program address that the process uses.
Whenever the CPU generates an address, it is always in terms of virtual address
space
~ Physical address – the real address in physical memory
~ Mapping – the mechanism by which virtual addresses are translated into
physical ones
¤ Terminologies:
~ Page frames – the equal-size chunks or blocks into which main memory
(physical memory) is divided
~ Pages – the chunks or blocks into which virtual memory (the logical address
space) is divided, each equal in size to a page frame. Virtual pages are stored on
disk until needed
¤ Terminologies:
~ Paging – the process of copying a virtual page from disk to a page frame in
main memory
~ Fragmentation – memory that becomes unusable
~ Page fault – an event that occurs when a requested page is not in main
memory and must be copied into memory from disk
¤ Paging is not only way to implement virtual memory. A second
method employed by some systems is segmentation
~ Instead of dividing the virtual address space into equal, fixed-size pages, and
the physical address space into equal page frames, the virtual address space is
divided into logical, variable-length units, or segments
~ Physical memory isn’t really divided or partitioned into anything. When a
segment needs to be copied into physical memory, the OS looks for a chunk
of free memory large enough to store the entire segment
Thank you for listening.

You might also like