Chapter 2 - Part 1 - PPT - Mano & Kime

Download Report

Transcript Chapter 2 - Part 1 - PPT - Mano & Kime

Fundamentals Of Computer Organization
Chapter 7 – Introduction to
Memory and Storage
Devices
Overview








Memory definitions
Random Access Memory (RAM)
Basic Memory Cell
Static RAM (SRAM) integrated circuits
Dynamic RAM (DRAM) integrated circuits
DRAM Types
ROM
Magnetic Disk Memories
Memory Definitions
 Memory ─ A collection of storage cells together with
the necessary circuits to transfer information to and
from them.
 Memory Organization ─ the basic architectural
structure of a memory in terms of how data is accessed.
 Random Access Memory (RAM) ─ a memory
organized such that data can be transferred to or from
any cell (or collection of cells) in a time that is not
dependent upon the particular cell selected.
 Memory Address ─ A vector of bits that identifies a
particular memory element (or collection of elements).
Memory Definitions (Continued)
 Typical data elements are:
• bit ─ a single binary digit
• byte ─ a collection of eight bits accessed together
• word ─ a collection of binary bits whose size is a
typical unit of access for the memory. It is typically
a power of two multiple of bytes (e.g., 1 byte, 2
bytes, 4 bytes, 8 bytes, etc.)
 Memory Data ─ a bit or a collection of bits to
be stored into or accessed from memory cells.
 Memory Operations ─ operations on memory
data supported by the memory unit. Typically,
read and write operations over some data
element (bit, byte, word, etc.).
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.
A large word length improves system
performance, though may be less efficient
on occasions when the full word length is
not used
Memory
 Access time – The time required to locate and
read a word from memory is called the access
time.
 Random Access – Access to the information
stored is direct , so equal access time is required
for each location.E.g. Flip flop register
 Sequential Access – Arrival at location desired
may be preceded by sequencing through
through other locations, so that access time
varies according to location . E.g. Magnetic
tape.
Memory
 Static Storage – It is the one in which the
information does not change position. E.g., Flip
flop registers and even punched cards or tape
 Dynamic Storage – These are devices in which
the information stored is continually changing
position. E.g., Circulating registers utilizing
charge coupled device (CCD) delay lines.
Memory Hierarchy
• Memory hierarchy in a computer system.
 Main Memory : memory unit that communicates directly with the CPU
(RAM)
 Auxiliary Memory : device that provide backup storage (Disk Drives)
 Cache Memory : special very-high-speed memory to increase the
processing speed (Cache RAM) Auxiliary memory
Magnetic
tapes
• Multiprogramming
Magnetic
 enable the CPU to process a
disks
number of independent
program concurrently
• Memory Management System :
 supervise the flow of information
between auxiliary memory and main
memory
I/O processor
CPU
Main
memory
Cache
memory
Memory Block Diagram
n Data Input Lines
 A basic memory system is
n
shown here:
 k address lines are
Memory
k
Address
Lines
Unit
k
decoded to address 2k
2k Words
words of memory.
n Bits per Word
1
Read
 Each word is n bits.
1
Write
 Read and Write are single
control lines defining the
n
simplest of memory
n Data Output Lines
operations.
Memory Organization Example
 Example memory
contents:
• A memory with 3
address bits & 8
data bits has:
• k = 3 and n = 8 so
23 = 8 addresses
labeled 0 to 7.
• 23 = 8 words of 8-bit
data
Memory Address
Binary Decimal
000
001
010
011
100
101
11 0
111
0
1
2
3
4
5
6
7
Memory
Content
10001111
11111111
10110001
00000000
10111001
10000110
00110011
11001100
Basic Memory Operations
 Memory operations require the following:
• Data ─ data written to, or read from, memory as
required by the operation.
• Address ─ specifies the memory location to operate
on. The address lines carry this information into
the memory. Typically: n bits specify locations of 2n
words.
• An operation ─ Information sent to the memory and
interpreted as control information which specifies
the type of operation to be performed. Typical
operations are READ and WRITE. Others are
READ followed by WRITE and a variety of
operations associated with delivering blocks of data.
Operation signals may also specify timing info.
Basic Memory Operations (continued)
 Read Memory ─ an operation that reads a data value
stored in memory:
• Place a valid address on the address lines.
• Wait for the read data to become stable.
 Write Memory ─ an operation that writes a data value
to memory:
• Place a valid address on the address lines and valid data on the
data lines.
• Toggle the memory write control line
Linear Select IC Memory
Overview







Memory definitions
Random Access Memory (RAM)
Static RAM (SRAM) integrated circuits
Arrays of SRAM integrated circuits
Dynamic RAM (DRAM) integrated circuits
DRAM Types
Arrays of DRAM integrated circuits
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
Types of RAM
1. Dynamic Random Access Memory (DRAM)
• Contents are constantly refreshed 1000 times per second
• Access time 60 – 70 nanoseconds
Note: a nanosecond is one billionth of a second!
2. Synchronous Dynamic Random Access Memory (SDRAM)
• Quicker than DRAM
• Access time less than 60 nanoseconds
3. Direct Rambus Dynamic Random Access Memory (DRDRAM)
• New type of RAM architecture
• Access time 20 times faster than DRAM
• More expensive
Types of RAM
4. Static Random Access Memory (SRAM)
• Doesn’t need refreshing
• Retains contents as long as power applied to the chip
• Access time around 10 nanoseconds
• Used for cache memory
• Also for date and time settings as powered by small battery
5. Cache memory
• Small amount of memory typically 256 or 512 kilobytes
• Temporary store for often used instructions
• Level 1 cache is built within the CPU (internal)
• Level 2 cache may be on chip or nearby (external)
• Faster for CPU to access than main memory
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
Cache
Main
Memory
Memory
(SRAM)
CPU
(DRAM)
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
Types of RAM
6. Video Random Access memory
• Holds data to be displayed on computer screen
• Has two data paths allowing READ and WRITE to occur at the same time
• A system’s amount of VRAM relates to the number of colours and resolution
• A graphics card may have its own VRAM chip on board
7. 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
RAM Integrated Circuits
 Types of random access memory
• Static – information stored in latches
• Dynamic – information stored as electrical charges
on capacitors
 Charge “leaks” off
 Periodic refresh of charge required
 Dependence on Power Supply
• Volatile – loses stored information when power
turned off
• Non-volatile – retains information when power
turned off
Overview







Memory definitions
Random Access Memory (RAM)
Static RAM (SRAM) integrated circuits
Arrays of SRAM integrated circuits
Dynamic RAM (DRAM) integrated circuits
DRAM Types
Arrays of DRAM integrated circuits
Static RAM
 Two technologies are used :
Bipolar – It offers a speed advantage and bipolar components can
provide access time of under 10 ns.
MOS (Metal Oxide Semiconductor) – MOS devices have relatively
high capacitance and impedance, leading to longer time constants
and access time (PMOS – 300 ns or more, NMOS - 20 ns).
Static RAM
Static RAM
Cell
 Array of storage cells used to implement static RAM
Select
 Storage Cell
• SR Latch
• Select input for
control
• Dual Rail Data
Inputs B and B
• Dual Rail Data
Outputs C and C
B
B
S
Q
R
Q
C
C
RAM cell
Cell Arrays and Coincident Selection
(continued)
A3
Row decoder
2-to-4
Decoder
0
21
A2
20
RAM cell
0
RAM cell
1
RAM cell
2
RAM cell
3
RAM cell
4
RAM cell
5
RAM cell
6
RAM cell
7
RAM cell
8
RAM cell
9
RAM cell
10
RAM cell
11
RAM cell
12
RAM cell
13
RAM cell
14
RAM cell
15
Read/Write
logic
Read/Write
logic
Read/Write
logic
Read/Write
logic
1
Row
select
2
3
Data in
Data out
Read/
Bit
Write
select
Data in
Data out
Read/
Bit
Write
select
Data in
Data out
Read/
Bit
Write
select
Data in
Data out
Read/
Bit
Write
select
Data input
Read/Write
X
X
X
X
Column select
0
Column
decoder
1
2-to-4 Decoder
with enable
21
A1
20
2
3
Enable
A0
Chip select
Data
output
Static Memory Characteristics
Overview







Memory definitions
Random Access Memory (RAM)
Static RAM (SRAM) integrated circuits
Arrays of SRAM integrated circuits
Dynamic RAM (DRAM) integrated circuits
DRAM Types
Arrays of DRAM integrated circuits
Dynamic RAM (DRAM)
 Basic Principle: Storage of information
on capacitors.
 Charge and discharge of capacitor to
change stored value
 Use of transistor as “switch” to:
• Store charge
• Charge or discharge
Dynamic RAM (DRAM)
 These have individual cells composed of from one to
three MOS transistors plus a capacitor
 Cell state is determined by placing or not placing a
positive charge on the capacitor. If the capacitor has no
charge, the cell may represent a 0 and with a positive
charge the cell may represent a 1
 DRAMs are organized in the same manner as flip flop
memories. Two Dimensional selection with decoders is
standard
Dynamic RAM (DRAM)
Dynamic RAM (DRAM)
 Advantages
Individual cells are simpler than flip-flops
Require less area on the chips
Lower power consumption & cost
Widely used in present day systems
Power need not be applied to the cells when they are no
being read from or written into, so the power is conserved.
 Disadvantages
DRAMS are slower
Charge slowly leaks from the capacitor
Contents of each cell must be written into each cell
periodically (called memory refreshing)
Timing Diagram – Dynamic RAM
Dynamic RAM Read Timing
20 ns
Clock
Address
T1
Row
Address
T2
T3
T4
Column
Address
RAS
CAS
Output
enable
Read/
Write
Data
output
Data valid
65 ns
Read cycle
T1
Arrays of DRAM Integrated Circuits
 Similar to arrays of SRAM ICs, there are
differences typically handled by an IC called a
DRAM controller:
• Separation of the address into row address and
column address and timing their application
• Providing RAS (Row Address Strobe) and CAS
(Column Address Strobe) and timing their
application
• Performing refresh operations at required intervals
• Providing status signals to the rest of the system
(e.g., indicating whether or not the memory is active
or is busy performing refresh)
DRAM – Memory Characteristics
 Main Memory
Bootstrap Loader
 A program whose function is to start the computer software operating when
power is turned on
RAM and ROM Chips
Power-ON
 Typical RAM chip :
FFFF:0000
• 128 X 8 RAM : 27 = 128 (7 bit address lines)
(Reset Point)
Bootstrap Loader
 Typical ROM chip :
POST
Bootstrap ROM
• 512 X 8 ROM : 29 = 512 (9 bit address lines)
Boot ROM
System Init.
INT 19
Chip select 1
CS1
Chip select 2
CS2
Read
RD
Write
WR
7 bit address
AD7
Load Bootstrap Record
(Track 0, Sector 0)
128×8
RAM
8 bit data bus
(a) Block diagram
CS1 CS2 RD WR
0
0
1
1
1
1
0
1
0
0
0
1
×
×
0
0
1
×
×
×
0
1
×
×
Memory function
Inhibit
Inhibit
Inhibit
Write
Read
Inhibit
(b) Function table
State of data bus
High-impedance
High-impedance
High-impedance
Input data to RAM
Output data from RAM
High-impedance
Load Operating System
(IO.SYS, MSDOS.SYS, COMMAND.COM)
Chip select 1
CS1
Chip select 2
CS2
512×8
ROM
9 bit address
AD9
8 bit data bus
Read only memory (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
ROM
 It is a device with several input and output lines such that for each input value there is a
unique output value
 ROM physically realizes a truth table or table of combinations. The list of input / output
values shown is a list of binary to gray code values
ROM
 The list can be looked at in two ways.
As a table for a gating network with 4 inputs & 4 outputs
As a list of addresses from 0 to 15 given by the X values and the contents of each address,
given by the values of Z.
The fig below would give the correct Z output for each X input. The boxes with Ɵ are mod
2 adders
ROM
 ROM is constructed so that the user can electrically (or by using
other techniques) write in the contents of the memory, the
memory is called a programmable ROM or PROM.
 Memory chip is delivered with 1s in every position but 0s can be
introduced at the given position by placing a address on the
input lines and then raising each output line which is to be a 0 to
a specified voltage, destroying a connection to the selected cell.
 Devices are also manufactured which program PROMs by
reading paper tapes, magnetic tapes, punched cards, etc and
placing their contents into the PROM
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 ultra-violet light
on it
• After reprogramming the window is covered to prevent new contents being erased
• Access time is around 45 – 90 nanoseconds
Types of ROM
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
4. Flash ROM
• Similar to EEPROM
• However, can be reprogrammed while still in the computer
• Easier to upgrade programs stored in Flash ROM
• Used to store programs in devices e.g. modems
• Access time is around 45 – 90 nanoseconds
5. EAROMs (Electrically Alterable ROMs)
• Selected contents re-written while in place in a circuit by properly applying input voltages
Characteristics of some ROMs
Notes (Static & Dynamic RAM)
•
•
Your computer probably uses both static RAM and dynamic RAM at the same
time, but it uses them for different reasons because of the cost difference
between the two types. If you understand how dynamic RAM and static RAM
chips work inside, it is easy to see why the cost difference is there, and you can
also understand the names.
Dynamic RAM is the most common type of memory in use today. Inside a
dynamic RAM chip, each memory cell holds one bit of information and is made
up of two parts: a transistor and a capacitor. These are, of course, extremely
small transistors and capacitors so that millions of them can fit on a single
memory chip. The capacitor holds the bit of information -- a 0 or a 1 (see How
Bits and Bytes Work for information on bits). The transistor acts as a switch
that lets the control circuitry on the memory chip read the capacitor or change
its state.
Notes (Static & Dynamic RAM)
•
•
A capacitor is like a small bucket that is able to store electrons. To store a 1 in
the memory cell, the bucket is filled with electrons. To store a 0, it is emptied.
The problem with the capacitor's bucket is that it has a leak. In a matter of a
few milliseconds a full bucket becomes empty. Therefore, for dynamic memory
to work, either the CPU or the memory controller has to come along and
recharge all of the capacitors holding a 1 before they discharge. To do this, the
memory controller reads the memory and then writes it right back. This refresh
operation happens automatically thousands of times per second.
This refresh operation is where dynamic RAM gets its name. Dynamic RAM
has to be dynamically refreshed all of the time or it forgets what it is holding.
The downside of all of this refreshing is that it takes time and slows down the
memory.
Notes (Static & Dynamic RAM)
•
•
Static RAM uses a completely different technology. In static RAM, a form of
flip-flop holds each bit of memory (see How Boolean Gates Work for detail on
flip-flops). A flip-flop for a memory cell takes 4 or 6 transistors along with some
wiring, but never has to be refreshed. This makes static RAM significantly
faster than dynamic RAM. However, because it has more parts, a static memory
cell takes a lot more space on a chip than a dynamic memory cell. Therefore you
get less memory per chip, and that makes static RAM a lot more expensive.
So static RAM is fast and expensive, and dynamic RAM is less expensive and
slower. Therefore static RAM is used to create the CPU's speed-sensitive cache,
while dynamic RAM forms the larger system RAM space.
Magnetic Disk Memories
 Large storage capabilities
 Moderate operating speeds
 Store information on one or more circular platters or
disks which continuously spins
 Rotating disks are coated with a magnetic material and
stacked with space between them
 Information is recorded on the surface of the rotating
disks by magnetic heads( Fig 6.27)
 These heads are mounted on access arms
 Each band of information on a given disk is called a
track.
Magnetic Disk Memories
Chapter 8 49
Magnetic Disk Memories
Magnetic Disk Memories
 There can be several thousand data tracks on one side of a
typical disk
 Bits are recorded along a track at a density of 500 to 24,000
bits/in
 Sometimes the outer track contains more bits than the inner
tracks , because the circumference of an outer track is greater
than that of an inner track.
 Many disks have the same number of bits around each track.
 The rotational speed of the disks varies , with the manufacturer,
but typical speeds are on the order of 3600 rpm
Magnetic Disk Memories
 Each disk contains a number of tracks of information
 There may be several disks in a memory
 Several techniques are used for placing a magnetic read – write
head in the correct position on a selected track.
 There are two basic type of disk head placement systems.
Fixed head system – The heads are fixed in position
on
each track
Movable head system – One or more pair of read – write
heads exist for each pair of adjacent disk surfaces. These
read –write heads are mounted on arms which can be
moved in and out.
Magnetic Disk Memories
 Access time – The total time it takes to begin reading selected
data or to begin writing on a selected track in a particular place
is called the access time.
 Seek time – The time it takes to position a head on the selected
track is called the seek time. It is generally several milliseconds.
 Latency – The other delay in locating selected data is the latency
or rotational delay which is the time required for the desired
data to reach the magnetic head once the head is positioned.
 Total access time = seek time + latency
Magnetic Disk Memories
 In Fixed head systems, heads are arranged in groups of 8 or 9
 Head spacing in each group is typically 8-16 per inch, track
densities of 30-60 per inch can be achieved by interlacing groups
 Fixed head systems are faster
 Fixed head systems provide less storage capacity than moving
head systems
 Moving head systems have more tracks per inch
Magnetic Disk Memories
The read write heads on the magnetic disk memories are of type called flying heads
Chapter 8 55
Magnetic
Disk
Memories
As the medium
rotates, the head
writes the data.
Magnetic Storage Devices - Formatting
•
•
•
Before a magnetic disk can be used, it must be
formatted—a process that maps the disk's surface and
determines how data will be stored.
During formatting, the drive creates circular tracks
around the disk's surface, then divides each track into
sectors.
The OS organizes sectors into groups, called clusters,
then tracks each file's location according to the clusters
it occupies.
Formatted Disk
Magnetic Storage Devices - Disk Areas
When a disk is formatted, the OS creates four
areas on its surface:
•
•
•
•
Boot sector – stores the master boot record, a small
program that runs when you first start (boot) the
computer
File allocation table (FAT) – a log that records each
file's location and each sector's status
Root folder – enables the user to store data on the
disk in a logical way
Data area – the portion of the disk that actually
holds data
Magnetic Storage Devices - Hard Disks
•
•
•
Hard disks use multiple platters, stacked on a
spindle. Each platter has two read/write heads, one
for each side.
Hard disks use higher-quality media and a faster
rotational speed than diskettes.
Removable hard disks combine high capacity with
the convenience of diskettes.
Read/write heads