欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > DOC文档下载  

    Primary Memory.doc

    • 资源ID:3024191       资源大小:209.50KB        全文页数:34页
    • 资源格式: DOC        下载积分:8金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要8金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    Primary Memory.doc

    The Memory ComponentThe memory stores the instructions and data for an executing program.Memory is characterized by the smallest addressable unit:Byte addressablethe smallest unit is an 8bit byte.Word addressablethe smallest unit is a word, usually 16 or 32 bits in length.Most modern computers are byte addressable, facilitating access to character data.Logically, computer memory should be considered as an array.The index into this array is called the address or “memory address”.A logical view of such a byte addressable memory might be written in code as:ConstMemSize = byteMemoryMemSize / Indexed 0 (MemSize 1)The CPU has two registers dedicated to handling memory.The MAR(Memory Address Register) holds the address being accessed.The MBR(Memory Buffer Register) holds the data being written to thememory or being read from the memory. This is sometimescalled the Memory Data Register.Primary MemoryAlso called “core memory”, “store”, or “storage”.Beginning with the MIT Whirlwind and continuing for about 30 years, the basic technology for primary memory involved “cores” of magnetic material.A rather large picture of magnetic core memory (lots of kilobytes here) has been removed from the slide, so that it will download more quickly.Requirements for a Memory Device1.Random access by address, similar to use of an array. Byte addressable memory can be considered as an array of bytes.byte memory N/ Address ranges from 0 to (N 1)2.Binary memory devices require two reliable stable states.3.The transitions between the two stable states must occur quickly.4.The transitions between the two stable states must not occurspontaneously, but only in response to the proper control signals.5.Each memory device must be physically small, so that a large numbermay be placed on a single memory chip.6.Each memory device must be relatively inexpensive to fabricate.Varieties of Random Access MemoryThere are two types of RAM1.RAMread/write memory2.ROMreadonly memory.The double use of the term “RAM” is just accepted. Would you say “RWM”?Types of ROM1.“Plain ROM”the contents of the memory are set at manufactureand cannot be changed without destroying the chip.2.PROMthe contents of the chip are set by a special devicecalled a “PROM Programmer”. Once programmedthe contents are fixed.3.EPROMsame as a PROM, but that the contents can be erasedand reprogrammed by the PROM Programmer.Memory RegistersMARMemory Address RegisterThis specifies the address of the instruction or data item.For a byte addressable memory, each byte has a distinct address.For a word addressable memory, only the words have individual addresses.MBRMemory Buffer RegisterThis holds the data read from memory or to be written to memory.Occasionally called MDR for Memory Data RegisterIn a byte addressable memory, the MBR is usually 8 bits wide; that is, itholds one byte.In a 16bit word addressable memory, the MBR would be 16 bits wide.The size of the MBR is the size of an addressable item.Memory Control SignalsRead / Write Memory must do three actions:READcopy contents of an addressed word into the MBRWRITEcopy contents of the MBR into an addressed wordNOTHINGthe memory is expected to retain the contents written intoit until those contents have been rewritten.One set of control signals Select the memory unit is selected.if 0 the CPU writes to memory, if 1 the CPU reads from memory.SelectAction00Memory contents are not changed.01Memory contents are not changed.10CPU writes data to the memory.11CPU reads data from the memory.A ROM has only one control signal: Select.If Select = 1 for a ROM, the CPU reads data from the addressed memory slot.Another Notation for Control SignalsThere are several notations for control signals that are asserted low.Consider the signal Select, which we have assumed to be asserted high.Were this signal asserted low, it would be notated as eitherThe more modern notation uses a “#” after a signal name to indicate that it is asserted low.A similar notation is used with the “two option selector” control signals; e.g.,Here, the “#” notation indicates what the signal indicates when it is low.If R/W# = 0, a memory write is called for.If R/W# = 1, a memory read is called for.Memory Example with New NotationSuppose that a memory is selected with an active low signal and has another signal to indicate the operation.The two tables below convey the same information.Action10Memory contents are not changed.11Memory contents are not changed.00CPU writes data to the memory.01CPU reads data from the memory.Select#R/W#Action10Memory contents are not changed.11Memory contents are not changed.00CPU writes data to the memory.01CPU reads data from the memory.Memory TimingsMemory Access TimeDefined in terms of reading from memory. It is the time between the address becoming stable in the MAR and the data becoming available in the MBR.Memory Cycle TimeLess used, this is defined as the minimum time between two independent memory accesses.The Idea of an Address SpaceThe memory size is defined in terms of the amount of primary memoryactually installed.The address space, determined by the size of the MAR, indicates the rangeof addresses that actually can be generated.Absent such kludges such as Expanded Memory and Extended Memory (both obsolete, dating to about 1980), the memory size does not exceed the size of the address space.An Nbit MAR can address 2N distinct memory locations, 0 2N 1ComputerMAR bitsAddress RangePDP-11/20160 to 65 535Intel 8086200 to 1 048 575Intel Pentium320 to 4 294 967 295Memory Mapped Input / OutputThough not a memory issue, we now address the idea of memory mapped input and output. In this scheme, we take part of the address space that would otherwise be allocated to memory and allocate it to I/O devices.The PDP11 is a good example of a memory mapped device. It was a byte addressable device, meaning that each byte had a unique address.The old PDP11/20 supported a 16bit address space. This supported addresses in the range 0 through 65,535 or 0 through 0177777 in octal.Addresses 0 though 61,439 were reserved for physical memory.In octal these addresses are given by 0 through 167,777.Addresses 61,440 through 65,535 (octal 170,000 through 177,777) were reserved for registers associated with Input/Output devices.Examples:CR11 Card Reader177,160Control & Status Register177,162Data buffer 1177,164Data buffer 2Reading from address 0177162 would access the card reader data buffer. The Linear View of MemoryMemory may be viewed as a linear array, for example a byteaddressable memorybyte memory N ; / Addresses 0 . (N 1)This is a perfectly good logical view, it just does not correspond to reality.Memory Chip OrganizationConsider a 4 Megabit memory chip, in which each bit is directly addressable.Recall that 4M = 222 = 211 · 211, and that 211 = 2, 048.The linear view of memory, on the previous slide, calls for a 22to222 decoder,also called a 22to4,194,304 decoder. This is not feasible.If we organize the memory as a twodimensional grid of bits, then the designcalls for two 11to2048 decoders. This is still a stretch.Managing Pin-OutsConsider now the twodimensional memory mentioned above. What pins are needed?Pin CountAddress Lines22Address Lines11Row/Column0Row/Column2Power & Ground2Power & Ground2Data1Data1Control3Control3Total28Total19Separate row and column addresses require two cycles to specify the address.FourMegabyte MemoryDo we have a single fourmegabyte chip or eight fourmegabit memory chips?One common solution is to have bitoriented chips. This facilitates thetwodimensional addressing discussed above.For applications in which data integrity is especially important, one might add a ninth chip to hold the parity bit. This reflects the experience that faults, when they occur, will be localized in one chip.Parity provides a mechanism to detect, but not correct, single bit errors.Correction of single bit errors requires twelve memory chips. This scheme willalso detect all twobit errors.Memory InterleavingSuppose a 64MB memory made up of the 4Mb chips discussed above.We now ignore parity memory, for convenience and also because it is rarely needed.We organize the memory into 4MB banks, each having eight of the 4Mb chips. The figure in the slide above shows such a bank.The memory thus has 16 banks, each of 4MB.16 = 244 bits to select the bank4M = 22222 bits address to each chipNot surprisingly, 64M = 226.LowOrder InterleavingBits25 43 0UseAddress to the chipBank SelectHighOrder Interleaving (Memory Banking)Bits25 2221 0UseBank SelectAddress to the chipFaster Memory ChipsWe can use the “2 dimensional” array approach, discussed earlier, to create a fastermemory. This is done by adding a SRAM (Static RAM) buffer onto the chip. Consider the 4Mb (four megabit) chip discussed earlier, now with a 2Kb SRAM buffer.In a modern scenario for reading the chip, a Row Address is passed to the chip, followed by a number of column addresses. When the row address is received, the entire row is copied into the SRAM buffer. Subsequent column reads come from that buffer.Memory Technologies: SRAM and DRAMOne major classification of computer memory is into two technologiesSRAMStatic Random Access MemoryDRAMDynamic Random Access Memory (and its variants)SRAM is called static because it will keep its contents as long as it is powered.DRAM is called dynamic because it tends to lose its contents, even when powered.Special “refresh circuitry” must be provided.Compared to DRAM, SRAM isfastermore expensivephysically larger (fewer memory bits per square millimeter)SDRAM is a Synchronous DRAM.It is DRAM that is designed to work with a Synchronous Bus, one with a clock signal.The memory bus clock is driven by the CPU system clock, but it is always slower.SDRAM (Synchronous DRAM)Synchronous Dynamic Random Access MemorySuppose a 2 GHz system clock. It can easily generate the following memory bus clock rates: 1GHz, 500 MHz, 250MHz, 125MHz, etc. Other rates are also possible.Consider a 2 GHz CPU with 100 MHz SDRAM.The CPU clock speed is 2 GHz = 2,000 MHzThe memory bus speed is 100 MHz.In SDRAM, the memory transfers take place on a timing dictated by the memory bus clock rate. This memory bus clock is always based on the system clock.In “plain” SDRAM, the transfers all take place on the rising edge of the memory bus clock. In DDR SDRAM (Double Data Rate Synchronous DRAM), the transfers take place on both the rising and falling clock edges.More on SDRAM“Plain” SDRAM makes a transfer every cycle of the memory bus.For a 100 MHz memory bus, we would have 100 million transfers per second.DDRSDRAM is Double Data Rate SDRAMDDRSDRAM makes two transfers for every cycle of the memory bus,one on the rising edge of the clock cycleone on the falling edge of the clock cycle.For a 100 MHz memory bus, DDRSDRAM would have 200 million transfers per second.To this, we add wide memory buses. A typical value is a 64bit width.A 64bit wide memory bus transfers 64 bits at a time. That is 8 bytes at a time.Thus our sample DDRSDRAM bus would transfer 1,600 million bytes per second.This might be called 1.6 GB / second, although it more properly is 1.49 GB / second, as 1 GB = 1, 073, 741, 824 bytes.Byte Addressing vs. Word AddressingThe addressing capacity of a computer is dictated by the number of bits in the MAR.Suppose the MAR (Memory Address Register Contains) N bits.Then 2N items can be addressed.In a byte addressable machine, the maximum memory size is 2N bytes.If the machine supports longword addressing, but not byte or word addressing,the maximum memory size is 2N+2 bytes.Word and longword addressable machines might have their memory sized quoted in bytes, but they do not access individual bytes.Example: 256 KB PDP11/70 vs. the CDC6600 with 256 K words (60 bits each).The CDC6600 could have been considered to have 1,920 KB of memory. However, it was not byte addressable; the smallest addressable unit was a 60bit integer.Almost every modern computer is byte addressable to allow direct access to the individual bytes of a character string.A modern computer that is byte addressable can still issue both word and longword instructions. These just reference data two bytes at a time and four bytes at a time.Word Addressing in a Byte Addressable MachineEach 8bit byte has a distinct address.A 16-bit word at address Z contains bytes at addresses Z and Z + 1.A 32-bit word at address Z contains bytes at addresses Z, Z + 1, Z + 2, and Z + 3.Note that computer architecture refers to addresses, rather than variables.In a highlevel programming language we use the term “variable” to indicatethe contents of a specific memory address.Consider the statementY = XGo to the memory address associated with variable XGet the contentsCopy the contents into the address associated with variable Y.BigEndian vs. LittleEndian AddressingAddressBig-EndianLittle-EndianZ0104Z + 10203Z + 20302Z + 30401Example: “Core Dump” at Address 0x200Note:Powers of 256 are2560 = 1,2561 = 256, 2562 = 65536,2563 = 16,777,216Suppose one has the following memory map as a result of a core dump.The memory is byte addressable.Address0x2000x2010x2020x203Contents02040608What is the value of the 32bit long integer stored at address 0x200?This is stored in the four bytes at addresses 0x200, 0x201, 0x202, and 0x203.Big Endian:The number is 0x02040608. Its decimal value is2·2563 + 4·2562 + 6·2561 + 8·1 = 33,818,120Little Endian:The number is 0x08060402. Its decimal value is8·2563 + 6·2562 + 4·2561 + 2·1 = 134,611,970.NOTE:Read the bytes backwards, not the hexadecimal digits.Example 2: “Core Dump” at Address 0x200Note:Powers of 256 are2560 = 1,2561 = 256, 2562 = 65536,2563 = 16,777,216Suppose one has the following memory map as a result of a core dump.The memory is byte addressable.Address0x2000x2010x2020x203Contents02040608What is the value of the 16bit integer stored at address 0x200?This is stored in the two bytes at addresses 0x200 and 0x201.Big EndianThe value is 0x0204.The decimal value is 2·256 + 4 = 516Little Endian

    注意事项

    本文(Primary Memory.doc)为本站会员(文库蛋蛋多)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开