发新话题
打印

计算机存储系统

计算机存储系统

Memory System Desiderata/ ~4 q: h. K4 z! c
   
/ D2 [/ @5 e/ v; B/ F2 Z  1,The memory system has three desiderata.  (1)Size:infinitely large,no constraints on program or data set size.
6 o. F7 s1 b, {3 U% C2 a$ H  (2)Speed:infinitely fast,latency equal to the fastest memory technology available[1]., ?: y2 Y8 ?! ^7 B9 l
  (3)Cost:the per bit cost should approach the lowest-cost technology available.* {2 M- v6 K) {, T. B2 ^9 s5 m
Clearly these specifications cannot all be achieved as they are mutually exclusive.However,with the semiconductor and magnetic memory technology of today,these specifications are closely approximated.
% Z' f. \( d  T, q( w# ]  2.Hierarchical Memory6 o( B: h( L* n' ]! t8 c7 t
  In this section it is shown how designers implement a practical memory that approaches the performance of an ideal memory at reasonable cost.This memory system has a hierarchy of levels:The memory closest to the processor is fast and relatively small,but has a high cost per bit.This level is called the cache;The real memory,sometimes known as main memory,is slower,larger,and has a lower cost per bit than the cache;The lowest level in the hierarchy is usually a magnetic disk that has the longest latency and the lowest bandwidth;however,it can be very large and has a very low cost per bit.This hierarchy is illustrated in Fig. 1-9.! C0 F- }' V" i: i! j, k- m* r

' \7 v8 p* g# R/ t( T  Note that Fig. 1-9 does not include the processor register file in the memory hierarchy.[2] The register file is a program-managed cache and is generally not included in the memory system. Also,there can be more than one cache in the hierarchy.; E! y7 ~2 w$ n8 X1 x
  3.Paged Virtual Memory7 f9 a) {9 j0 w) D- k2 w# t+ X5 L
    9 T/ w4 Z. f$ G; e  L5 J6 i
  Paged virtual memory provides the solution to the first desideratum of a very large memory’ s being available to the processor.Because of the importance of this desideratum,the relationship between virtual and real memory is discussed first.  With virtual memory,the processor addresses the disk,the large,slow end of the hierarchy.[3]  The memories between the processor and the disk are there to increase the effective performance(reduced latency and increased bandwidth)of the very slow disk.If every instruction and data reference were made to the disk,the processor performance would be slow indeed.( }% l4 J- L/ T; [
Then why is virtual memory so important?Large memory is needed for large programs and data sets. Early computers with small real memory required that the transfer of data between real memory and disk be managed explicitly by the operating system or the user. Virtual memory provides for automatic management of this portion of the memory hierarchy through a combination of hardware and software aids.: C% M% l- M% U$ _: E3 a
The virtual memory interface is shown in Fig. 1-10. A real memory of 16M bytes and a virtual memory of 2G bytes are shown for illustration;many modern virtual-memory systems are much larger than this.Virtual-memory space is divided into equal-sized groups called pages. A page in a modern computer is 1K,2K,or 4K bytes. Real memory is also divided into the same equal-sized groups,called page frames. When information is moved between virtual-memory space and real-memory space,a complete page is moved.# K8 q& j) t# Q5 `& c4 ^5 b/ t
  存储系统
, J0 F+ p  X" F2 W- h; j: a9 a; J
   
/ \4 y( _. ^$ e3 w* z 1.存储系统的需求
( e! D7 O9 \9 n& y1 }7 b# ^  存储系统有以下3项需求。  C( H: f9 m4 T; X& _2 l6 Y
    (1)容量:无限大,对程序和数据集大小没有任何约束。2 \1 }' Q: E  k. Q  H1 {
    (2)速度:无限快,等待时间在现有存储器技术下是最短的。
4 {( Y; D# A4 k: x+ W    (3)价格:每位的价格在可使用的技术中应接近最低。
& n& A: w7 }3 |     很明显,由于这3个需求相互制约,所以很难全部满足。不过随着半导体和磁存储技术的发展,这些需求几近满足。# p0 f' Q- [  r8 A9 J
   2.存储的层次结构% ?6 c6 j4 O2 U+ _2 b" v
  下面说明设计者如何在合理的价格下设计出性能理想的实际存储器。这一存储系统具有下述层次结构:最靠近处理器的是快速、容量相对小,但每位价格高的存储器,这一级叫做高速缓冲存储器;下一级是实存储器,有时也称为主存储器,是速度较低、容量较大、每位价格比高速缓存低的存储器;层次结构中最低一层通常是等待时间最长,带宽最窄的磁盘;但它的容量非常大,每位价格非常低,如图1-9所示。
( L; Y1 X) k. S     请注意,图1-9中没有包括存储器层次结构中的处理器寄存器组。寄存器组是程序控制的高速缓存,一般不包括在存储系统中。此外,在存储器层次中可以有不只一个高速缓存。( a( ?2 B1 W% J7 t7 ]
   3.页式虚拟存储器+ ?, N; X5 {6 T" t( V
   页式虚拟存储器为处理器可用的超大的存储器容量的需求提供了解决办法。由于这一需求很重要,故先讨论虚拟存储器与实存储器之间的关系。处理器以虚拟存储器的方式访问位于层次结构最底层的大容量、低速磁盘。在处理器和磁盘之间放置存储器是为了提高低速磁盘的有效性能(减少等待时间和增加带宽)。如果每条指令和数据引用都要访问磁盘,则处理器的性能必定很差。& L% t9 P7 e, O' K* q
    那么为什么虚拟存储器如此重要?大型程序和数据集需要大容量存储器。早期的计算机实存储器容量很小,要求由*作系统或用户直接管理实存储器和磁盘之间的数据传送。虚拟存储器通过硬件和软件的结合自动地管理存储器层次结构的这一部分。
, h( d  B# v7 P% T2 i1 Q    虚拟存储器接口如图1-10所示,图中画出了16MB实存储器和2GB虚拟存储器;现在很多虚拟存储器系统的容量都比它大很多。虚拟存储器空间被分成多个相同容量的组,称为页面。现在计算机的页面大小是1KB、2KB或4KB。实存储器也被分成多个容量相同的组,叫做页帧。信息是整页整页地在虚拟存储器和实存储器之间传送的。
IT动力源欢迎您

TOP

4.Caches
  l) n# ?, i1 i, D  L( j; K   
2 A2 w; F2 r0 ^( |  I# n, c  Section 3 discussed how virtual memory extends the address space of a processor.However,the latency of real memory is too long to support high-performance processors. Even with the high-speed DRAMS used today for real memory,something must be done to overcome this latency problem.% @! W1 y3 {4 b
  The solution to this performance problem is to add another level to the memory hierarchy,called a cache,shown in Fig. 1-9.The allocation of spaces in a three-level memory is shown in Fig. 1-11.As discussed in Section 3,the virtual-address space is divided into equal-sized pages.These pages are placed in real-memory frames of the same size.Because a page can be placed in any vacant frame,there is no particular order to the allocation of pages to frames.With the addition of a cache,blocks of 16-32 bytes are taken from the page frames in real memory and placed into a block slot for access by the processor.For modern processors the cache usually has a latency of one processor clock,so that instructions and data may be fetched without delay except when the referenced item is not in the cache.
9 s; f/ l5 f: W5 f. ~, y, |4 b) W  I: N  h
  5.Memory Devices
# }6 M- O& S& L  g9 e  1)RANDOM-ACCESS MEMORY
0 x. t' W$ S& O6 z9 R% i% ^- mRandom-access memory,or RAM,is the kind of memory we usually refer to when we speak of computer memory.It is the most widely used type,and consists of rows of chips with locations established in tables maintained by the control unit[4].
) m! Y) |: i! ~As the name suggests,items stored in RAM can be gotten(accessed)both easily and in any order(randomly)rather than in some sequence.RAM relies on electric current for all its operations;moreover,if the power is turned off or interrupted,RAM quickly empties itself of all your hard work.Thus,we say RAM is-volatile,or nonpermanent.  D6 d1 x5 w- ^* }$ D3 g
  2)READ-ONLY MEMORY7 v, {0 n( \1 a+ v
  Read-only memory,or ROM,typically holds programs.These programs are manufactured,or“hard-wired”in place on the ROM chips.For example,a microcomputer has a built-in ROM chip(sometimes called ROM BIOS,for ROM basic input/output system)that stores critical programs such as the one that starts up,or“boots”,the computer.ROM is“slower”than RAM memory,and as a result,items in ROM are transferred to RAM when needed for fast processing.
; @1 u7 M. A+ g1 {% d3 JItems held in ROM can be read,but they cannot be changed or erased by normal input methods.New items cannot be written into ROM.The only way to change items in most forms of ROM is to change the actual circuits.2 v8 Y- e. |# s8 a7 O: @, U; q% ]
  3)MAGNETIC DISKS
' e0 T# k) s4 ~8 L/ c; x  The magnetic disk is a circular platter with a smooth surface and a coating that can be magnetized.Data is stored on it as magnetized spots.The reading and recording device,the disk drive,spins the disk past read/write heads that detect or write the magnetized spots on the disk.: U. M& g* |8 Z* h6 C/ H
  4)CD-ROMS) [- i: t0 c/ _
  Optical disks need thin beams of concentrated light to store and read data.It is a form of laser storage,called CD-ROM.& @, J; v; l! n9 s3 F, A
There are two types of optical disks that can he user-recorded:WORM and erasable optical.WORM stands for“write once,read many”:Data can be written to this disk just one time,but the data can be read many times.Erasable optical disks can be written to,read,and erased.
+ U: j8 H; f7 J7 K  5)MAGNETIC TAPE0 T3 i0 o2 B4 v! T
  A magnetic tape is a narrow plastic strip similar to the tape used in tape recorders.The tapes are read by tape drive moving the tape past a read/write head,which detects or writes magnetized spots on the iron-oxide coating of the tape.Each pattern of spots matches the byte code for character being stored.! w4 R. E6 W& ~9 }) e+ ^1 J
  4.高速缓冲存储器
( W3 J! S4 E6 @; X  @$ i7 }& i  第3部分讨论了虚拟存储器如何扩展处理器的地址空间。但是实存储器的等待时间对高性能处理器来讲仍然太长。即使在目前很多实存储器采用高速动态随机存储器(DRAM)的情况下,为了克服这一等待时问题,还得做一些工作。
4 C% u6 X* q0 Y, {+ b     解决这一性能问题的方法是在存储层次结构中加入另外一层,称为高速缓冲存储器,如图1-9所示。图1-11显示了3级存储空间分配。正如在第3部分中所讨论的,虚拟地址空间被分为大小相同的页,这些页放在大小相同的实存储器的帧中。因为一页可以放在任何空帧中,因而对于帧而言页的放置没有具体顺序的要求。当加入了高速缓存之后,实存储器中的页帧就分成多个16~32B的数据块,这些块放到高速缓存中的块存取窗口中供处理器访问。现在的处理器中,高速缓存的等待时间只占一个处理器时钟周期,所以取数和取指令没有时延,除非要访问的数据项不在高速缓存中。" Y# T  ]( r. f. Y% [4 T% J
  5.存储器
( D% H8 C' b. _- Q. H4 ]   1)随机存储器6 o4 A: n% k9 Q$ T8 o, B9 ?: f7 H
     随机存储器或称RAM,是人们常说的计算机存储器。它是使用最广的一种类型,由一组芯片构成,其存储单元由控制部件中的地址表管理。
; x. a3 W/ {9 Z     顾名思义,RAM中的内容可以很容易地以任意顺序(随机地)读出(或称访问),而不用考虑什么先来后到。RAM始终靠电流进行*作;而且,如果电源关闭或中断,RAM会很快丢失,人们辛辛苦苦存入的内容。因此人们把RAM称为易失性或非永久性的存储器。
  K0 ?3 g0 v" O1 }+ x6 S: J     2)只读存储器; t# l! X& o2 W4 P9 [4 G6 R% C. l; G
     只读存储器或ROM,主要用来存储程序。这些程序是做在ROM芯片中或者说通过硬连线实现的。例如在微型计算机中就有内置ROM芯片(有时称为ROM BIOS,即ROM基本输入输出系统),该芯片存储一些关键的程序,如计算机的启动或引导程序。ROM的读取速度比RAM慢,因此如果需要快速处理,则将ROM中的内容传送到RAM中。
6 i, M% Z* d' h     ROM中的内容可以读,但不能用一般的输入方法更改或擦除。新的内容也不能写入ROM。在大多数型号ROM中改变内容的惟一方法是更换实际电路。
) U) N- |  B, C( c1 [     3)磁盘
. M9 S4 Q& X" @. y. {     磁盘是一个表面光滑且涂敷可磁化材料的圆盘。数据在磁盘上作为磁化点存入。读出与记录设备即磁盘驱动器驱动磁盘转动,当通过读写磁头时,磁头从磁盘上的磁化点检测出或写入信息。% W( {8 A) E; g# u9 E7 ^
     4)只读光盘4 ^4 }/ Z9 F, ]5 d. q7 G7 ^  v
     光盘用细聚光光束去存储和读出数据。CD-ROM是激光存储器的一种形式。
; S0 l. s$ z6 |0 t     用户使用的可读写光盘有两种类型:WORM和可擦除的光盘。WORM代表一次写多次读:数据只能写入一次但可读出多次。可擦除光盘可以读、写和擦除。8 A6 f9 `1 {7 N0 ~% @
     5)磁带. Y6 O5 b$ s' a9 ?# E
     磁带是一种类似于录音磁带的窄塑料带。由磁带驱动器去读磁带的内容。驱动器驱动磁带,由读写磁头检出或写入由氧化铁涂敷的磁化点,以各磁化点的不同极性表示所存储字符的二进制代码。
IT动力源欢迎您

TOP

NOTES. T, a- J' [) y  D9 i
[1]latency等待时间,潜伏时间。此处指存储器访问时间。! r, i9 i9 R; P
[2]register file寄存器组。是作为指令或数据临时存放的一种多位寄存组,有时称为栈。6 h2 _* y( @% ~4 y# g
[3]the processor addresses the disk处理器对磁盘编址。实际上使用的是虚拟地址。& k2 `( I3 F3 x7 `# Q& v
[4]在控制器中有一张内存地址列表,此处locations翻译成为存储单元。5 E* p/ o( D' ?
KEY WORDS
5 J% I; z) O3 h! \9 p' m
hierarchical memory 存储器层次结构   
/ v1 h2 F0 L! O+ n4 C) [3 B6 Gcache   高速缓冲存储器,高速缓存* e7 k5 \' b# B% k/ Z
magnetic disk  磁盘
$ z( I& B& Q. K6 m* p: Q# Cmain memory  主存储器/ y, L: x8 F- j# L
paged virtual memory 页式虚拟存储器5 U5 m$ e9 s5 c9 Y
Random-Access Memory(RAM)    随机(访问)存储器6 [) I0 j" G: h) r) k7 ?  a
Read-Only Memory(ROM)       只读存储器
2 R8 E, a3 P% |: S8 f' VCompact Disk ROM(CD-ROM)    只读光盘
0 j- Q. h1 y. [8 U. Edisk drive     磁盘驱动器: V: ~, }4 M0 l' [6 S
floppy disk(diskette)    软磁盘
6 d2 U% x( a/ t: u4 C/ Kwrite once,read many(WORM) 一次写多次读- D" v1 V& @- y$ w3 j
magnetic tape 磁带* o5 Z! t6 P- V4 X7 v- l$ \
register file 寄存器组! s+ V) x8 E4 _2 X+ O
latency   潜伏时间、等待时间
9 |+ ~2 D8 }; c6 Y" \4 @: X* Z* ppage frame 页帧
( A  m" c8 o. {3 y& d: |  U7 creal memory(storage) 实存储器
( H, [4 d4 C& D4 P$ k' S" rDynamic RAM(DRAM) 动态随机存储器
  ]. b$ R+ r/ |. _+ _EXERCISES& _3 I7 R9 e) Q9 V5 F; }: i
1.Fill in the blanks from using the sentences and definitions found on text.! ?' F/ T6 ]' G5 I1 E
(1)There are three desiderata in the memory system,they are_____ .
( @. d* z8 B/ i. Z. y" |; ]) W(2)Even with the high-speed DRAM as real memory,the high-performance processors still have the         _____problem.1 q- V5 ~$ d+ v- {
(3)A microcomputer has a built-in ROM chip,it is called sometimes _____ .
% G% ?; n5 \( \7 O, M% Y(4)Items stored in RAM can be accessed both easily and in _____.
% S6 k% w0 q+ K+ W% m(5)Magnetic disk has two types,they are _____ .
8 ~2 n& P) {& L(6)CD-ROM is abbreviated from _____ .7 P7 N* x# A3 v; v, w$ G" q& \
(7)_____detects or writes magnetized spots on the iron-oxide coating of the tape.. S' y2 {/ N# ]$ Q1 F# A
(8)The locations of a RAM are maintained by _____.
1 W, {" U! G4 ^; d( s  n2 X(9)Main memory is known as_____sometimes.* V2 E. A/ @7 k6 o6 D0 j3 a
(10)The processor addresses the disk with _____.
& i2 Z7 M9 Q4 g      a.ROM BIOS      b.the control unit
$ J' l% ?( [1 w      c.Compact Disk-ROM    d.size,speed and cost
6 ?  n0 j$ P/ A  C      e.virtual memory     f.any order(randomly)
0 d7 i1 r& g3 G  ]! u  c+ y      g.real memory     h.latency
6 B- ^' L- ^  u4 U2 s      i.read / write head    j.hard disks and floppy disks
8 o4 \3 y$ `1 Q  F. ?' u6 r+ q2.Multiple choices.& p4 C/ m# }% R6 D8 X
(1)Cache is_____ .
$ M6 Z1 Z  j4 |9 V: f# T  r     a.fast        b.slow( F- S7 O8 r5 _: M+ \5 [7 ?
     c.relatively small     d.high cost8 O: Q; F" _$ H
(2)Information stored in semiconductor RAM is_____.) Z/ n) N# x4 J7 P
     a.permanent      b.nonpermanent, k1 _$ s9 S# j+ c% J, {
     c.volatile       d.non-volatile# x/ C# O6 |( g1 T5 O
(3)We use paged virtual memory to_____.
4 T8 I( O. O& a* \8 z! B     a.extend the size of memory   b.increase bandwidth of the disk$ |& z0 F3 K$ A2 y
     c.reduce latency of the disk   d.store large program and data set" |2 s/ R: L( D
(4)We read data on the disk by _____ .
9 G! y8 }# S2 s) s4 @! h     a.detecting the magnetized spots randomly        
6 o# x- {' F* U     b.writing the magnetized spots: \  A5 N" G: l0 y$ J! J0 c( R+ [3 H
     c.detecting the magnetized spots sequentially
0 ]. ?8 M, b1 Y- V! C     d.moving the read / write head$ K% h9 o  a$ M5 O2 c& [2 }6 u  D
(5)The three desiderata of memory system are_____.$ J8 G: [3 M0 p- [, A4 l8 _8 ]# i
     a.independent    b.exclusive/ Z. `+ d+ H# X' X3 z1 |/ M
     c.closely approximated today   d.less approximated tomorrow: `1 Y; G4 F* G. T! R; e1 {# Q$ E0 S
(6)The processor performance would be high as we reference instructions and data from1 r7 {/ n7 C& s! ^; o( D% L$ d& i# y
     _____.8 j! H2 G. c: }/ E$ V$ r$ I
     a.hard disk      b.cache# ^7 {5 q8 |1 ]  o9 v  v
     c.floppy disk      d.memory
+ o. f# x* U8 Q1 Y9 M(7)Page frame is used in _____.
, {0 m$ c1 q+ O4 v" k" Q     a.real memory      b.virtual memory% t6 D1 W7 ^% f- s6 I/ d% b" B* y
     c.disk       d.cache
9 S/ X. e  H2 L* I2 f9 h(8)The register file is_____.5 r+ t$ ^% A7 Z8 M" u
     a.included in the memory system     b.a program-managed cache: p: S0 V1 a. f& j  A# H
     c.called as a stack sometimes     d.included in the CPU$ K4 b( `! L+ _- ^. B( N

2 L/ b" `1 l- O' y. w& K' A1.(1)d (2)h (3)a  (4)f(5)j(6)c(7)i(8)b(9)g(10)e
. s0 I/ ^6 E" h) C 2.(1)a,c ,d(2)b,c(3)a,b,c,a (4)a,d* z* \$ P2 C* ]1 @# R/ ?
    (5)b,c (6)b,d(7)a (8)b,c,d
IT动力源欢迎您

TOP

发新话题