Presentation on theme: "What is memory? Memory is used to store information within a computer, either programs or data. Programs and data cannot be used directly from a disk or."— Presentation transcript:
What is memory? Memory is used to store information within a computer, either programs or data. Programs and data cannot be used directly from a disk or CD, but must first be moved in memory. This week are going to look at: RAM and ROM Virtual memory concept Brief introduction to cache (more next week) Memory Hierarchies
Each part of memory has a separate memory location, which can be referred to using a memory address. Size of memory is measured in bytes (or multiples such as kilobytes (KB) or megabytes (MB)). The two main types of memory (RAM and ROM) act as if they were two parts of a continuous list of memory addresses.
Read only Memory (ROM) This is memory whose contents are not lost if the machine is switched off. This is also called non-volatile memory. There are variations on this basic idea. Programmable ROM: Programmed after manufacture. Once they are programmed, the basic ROM and PROM cannot be changed.
Erasable Programmable ROM (EPROM) where the physical links that are altered to store programs/data the PROM can be reset by exposing them to Ultraviolet (UV) radiation for a few minutes. The device can be reprogrammed. Electrically Erasable and Programmable ROM (EEPROM). This does not need UV to overwrite what is already stored; it can be done electrically. Therefore, the chip does not need to be taken out of the computer to reprogram it.
Random Access Memory (RAM) For most PCs, main memory is stored using RAM chips. These are volatile so switch the machine off and the contents in this form of memory are lost. There are 3 basic types of RAM – Dynamic RAM (DRAM) – Static RAM (SRAM) – Non-volatile RAM (NVRAM)
Commonly used in main memory. A logical '1' is used to charge a capacitor, and this holds the device in its switched on (or positive state). The capacitor will lose it's charge with time so the capacitor has to constantly refreshed to keep the switched on state. If a logical '0' is to be stored the capacitor is discharged. Dynamic RAM (DRAM)
Static RAM (SRAM) Each bit (or the cell that stores the bit) is represented by a flip-flop. The cell's output is maintained until either altered to a new value or the power is turned off. Compared to dynamic RAM More complex More expensive.
Non-volatile RAM (NVRAM) This is a type of RAM that is non-volatile. A variety of different technologies are used to implement NVRAM. Can be found in applications such as digital camera, MP3 players.
Examples of RAM EDO RAM: Extended Data Output RAM used in both main memory and video cards. SDRAM: Synchronous DRAM, the processor and the memory are in step with each other. This eliminates some of the operations needed to communicate between the two devices. (Double Data Rate) DDR SDRAM: Similar to SDRAM but theoretically could transmit data on the rise and fall of the clock. In practice this unlikely to occur.
Cache Cache is faster type of memory than is found in main memory. In other words, it takes less time to access something in cache than in main memory. It ‘sits’ between external memory (main memory) and the processor.
Registers A memory location with the processor. Play an important role (see later in the module) in carrying out instructions.
Virtual Memory In its simplest form: virtual memory uses a portion of the hard disk as extra memory. This is slower than using RAM. Virtual memory is useful when the programs and data in use are bigger than main memory’s capacity. We will meet this in more detail later in the module.
Memory Hierarchies Memory systems (a collection of various forms of memory) are constructed in a hierarchy. As a rule of thumb the faster the memory the higher the cost in terms of price, making it very expensive to make all the memory out of the fastest memory devices. Slower technologies are less expensive, making it more practical to make larger memories out of these devices.
At the top of hierarchy is a type of memory called registers these are fast, – but only provide a very limited and temporary storage – usually part of the processor. – expensive. The next level is cache memory which is – expensive – fast access time (time taken to access the data stored). – The amount that can be stored (capacity) in cache is greater than is stored in the registers, but is slower than the registers to access.
The next level is main memory. This has a greater capacity than cache, but is slower than cache to access. At the bottom of the hierarchy is virtual memory. This has potentially the greatest capacity, but is the slowest to access.
So the higher level in the hierarchy a device the less that can be stored in but the quicker it is to access. The goal of a memory hierarchy is to keep the data that is accessed most high up the hierarchy, so it can be accessed quickly, the least used at the bottom of the hierarchy.
Summary Bits of memory can be accessed by unique addresses. ROM is memory whose contents do not disappear when the power is turned off. RAM is memory whose contents do disappear once the power is turned off.
There are 3 basic types of RAM – Dynamic RAM (DRAM) Commonly used in main memory. A logical '1' is used to charge a capacitor, and this holds the device in its switched on or positive state. Capacitor has to be constantly refreshed to keep the switched on state. If a logical '0' is to be stored the capacitor is discharged.
Summary (cont.) Static RAM (SRAM) - – Each bit (or the cell that stores the bit) is represented by a flip-flop. – The cell's output is maintained until either altered to a new value or the power is turned off. – More complex and expensive than dynamic RAM. Non-volatile RAM (NVRAM): – A variety of different technologies are used to implement NVRAM.
Summary There is hierarchy of memory. The higher level in the hierarchy a device the more expensive, less that can be stored, but it is but the quicker to access. Registers quick memory locations with the processor. Cache ‘sits’ between external memory (main memory) and the processor.
Virtual memory uses a portion of the hard disk as extra memory. This is slower than using RAM. Virtual memory is useful when the programs and data in use are bigger than main memory’s capacity.
Sources for further reading Chalk et al (2004) pages 89-98 – Includes an alternative diagram for the memory hierarchy. Burrel (2004) Chapter 7 - pages 113-118