Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Chapter 3


Published on

Internal and External Memory

Published in: Engineering
  • Login to see the comments

  • Be the first to like this

Chapter 3

  1. 1. Er. Nawaraj Bhandari Topic 3 Internal and External Memory Computer Architecture
  2. 2. Computer Memory System  Computer memory is any physical device capable of storing information temporarily or permanently.  For example, Random Access Memory (RAM), is a volatile memory that stores information on an integrated circuit used by the operating system, software, and hardware.  The complex subject of computer memory is made more manageable if we classify
  3. 3. Computer Memory System  Key Characteristics of Computer Memory Systems
  4. 4. Computer Memory System  A memory is just like a human brain. It is used to store data and instructions.  The memory is divided into large number of small parts called cells.  Each location or cell has a unique address which varies from zero to memory size minus one. For example if computer has 64k words, then this memory unit has 64 * 1024=65536 memory locations.  The address of these locations varies from 0 to 65535.
  5. 5. Computer Memory System Generally memory are categorized in 4 different types.  Semiconductor Main Memory  Cache Memory  Magnetic disk  RAID  Optical Memory
  6. 6. Semiconductor Memory Types Memory Type Category Erasure Write Mechanism Volatility Random-access memory (RAM) Read-write memory Electrically, byte-level Electrically Volatile Read-only memory (ROM) Read-only memory Not possible Masks Nonvolatile Programmable ROM (PROM) Electrically Erasable PROM (EPROM) Read-mostly memory UV light, chip-level Electrically Erasable PROM (EEPROM) Electrically, byte-level Flash memory Electrically, block-level
  7. 7. Semiconductor Memory  RAM  Random access Memory  Read/Write  Volatile  Temporary storage DRAM(Dynamic RAM) SRAM(Static RAM)
  8. 8. RAM
  9. 9. Read Only Memory (ROM)  Permanent storage  Nonvolatile  Microprogramming (study later)  Library subroutines  Systems programs (BIOS)  Function tables
  10. 10. Types of ROM  Written during manufacture  Very expensive for small runs  Programmable (once)  PROM  Needs special equipment to program  Read “mostly”  Erasable Programmable (EPROM)  Erased by UV  Electrically Erasable (EEPROM)  Takes much longer to write than read  Flash memory  Erase whole memory electrically
  11. 11. Cache Memory  Cache memory is used in order to achieve higher performance of CPU by allowing the CPU to access data at faster speed.  It is placed closest to the processor in the computer assembly.  It is way too costly.  It is also a type of memory but keeping in mind the cost factor it cannot be used as a primary memory. What is Cache Memory?
  12. 12. Cache Memory
  13. 13. Cache write policies When we write ,should we write to cache or memory?  Write through cache – write to both cache and main memory. Cache and memory are always consistent.  Write back cache – write only to cache and set a “dirty bit”. When the block gets replaced from the cache ,write it out to memory
  14. 14. Levels of Cache Fastest Fast Less Fast Slow
  15. 15. Cache Organization Address Address buffer Control Control Data Data buffer System bus
  16. 16. Mapping Techniques  Direct mapping  Associative mapping  Set associative mapping
  17. 17. Direct mapping  Simplest technique  In this , each block of main memory is mapped into only one possible cache line . i = j modulo m where , i= cache memory j= main memory m=no. of lines in the cache
  18. 18. ASSOCIATIVE MAPPING It overcomes the disadvantage of direct mapping. It permits each main memory block to be loaded into any line of the cache .
  19. 19. SET ASSOCIATIVE MAPPING  The relationship which is followed here is m= v*k i= j modulo v Where , i= cache set no. j= main memory m= no. of lines in the cache v= no. of set k= no. of lines in each set This is called k-way set associative mapping .
  20. 20. Replacement algorithms  Optimizing instructions.  To manage cache information on computer.  In direct mapping. Each block only maps to one cache block .  Associative and set associative mapping.
  21. 21.  Least recently used(LRU)  First in first out(FIFO)  Least frequently used(LFU)  Random Replacement algorithms
  22. 22. Random  Randomly selects a block.  Discards it to make space.  Does not keep track of access history.  This eliminates the overhead cost of tracking page references.
  23. 23. Types of External Memory  Magnetic Disk  RAID  Removable  Optical  CD-ROM  CD-Recordable (CD-R)  CD-R/W  DVD  Magnetic Tape
  24. 24. Magnetic Disk  Disk substrate coated with magnetisable material (iron oxide…rust)  Substrate used to be aluminium  Now glass  Improved surface uniformity  Increases reliability  Reduction in surface defects  Reduced read/write errors  Lower flight heights (See later)  Better stiffness  Better shock/damage resistance
  25. 25. Read and Write Mechanisms  Recording & retrieval via conductive coil called a head  May be single read/write head or separate ones  During read/write, head is stationary, platter rotates  Write  Current through coil produces magnetic field  Pulses sent to head  Magnetic pattern recorded on surface below  Read (traditional)  Magnetic field moving relative to coil produces current  Coil is the same for read and write  Read (contemporary)  Separate read head, close to write head  Partially shielded magneto resistive (MR) sensor  Electrical resistance depends on direction of magnetic field  High frequency operation  Higher storage density and speed
  26. 26. Data Organization and Formatting  Concentric rings or tracks  Gaps between tracks  Reduce gap to increase capacity  Same number of bits per track (variable packing density)  Constant angular velocity  Tracks divided into sectors  Minimum block size is one sector  May have more than one sector per block
  27. 27. Disk Data Layout
  28. 28. Floppy Disk  8”, 5.25”, 3.5”  Small capacity  Up to 1.44Mbyte (2.88M never popular)  Slow  Universal  Cheap  Obsolete?
  29. 29. Winchester Hard Disk (1)  Developed by IBM in Winchester (USA)  Sealed unit  One or more platters (disks)  Heads fly on boundary layer of air as disk spins  Very small head to disk gap  Getting more robust
  30. 30. Winchester Hard Disk (2)  Universal  Cheap  Fastest external storage  Getting larger all the time  250 Gigabyte now easily available
  31. 31. Speed  Seek time  Moving head to correct track  (Rotational) latency  Waiting for data to rotate under head  Access time = Seek + Latency  Transfer rate
  32. 32. Timing of Disk I/O Transfer
  33. 33. RAID  Redundant Array of Independent Disks  Redundant Array of Inexpensive Disks  6 levels in common use  Not a hierarchy  Set of physical disks viewed as single logical drive by O/S  Data distributed across physical drives  Can use redundant capacity to store parity information
  34. 34. RAID 0  This configuration has striping but no redundancy of data.  It offers the best performance but no fault-tolerance  Data striped across all disks  Round Robin striping  Increase speed  Multiple data requests probably not on same disk  Disks seek in parallel  A set of data is likely to be striped across multiple disks
  35. 35. RAID 1  Also known as disk mirroring,  this configuration consists of at least two drives that duplicate the storage of data.  There is no striping.  Read performance is improved since either disk can be read at the same time.  Write performance is the same as for single disk storage.  Recovery is simple  Swap faulty disk & re-mirror  No down time  Expensive
  36. 36. RAID 2  Disks are synchronized  Very small stripes  Often single byte/word  Error correction calculated across corresponding bits on disks  Multiple parity disks store Hamming code error correction in corresponding positions  Lots of redundancy  Expensive  Not used
  37. 37. RAID 3  Similar to RAID 2  This technique uses striping and dedicates one drive to storing parity information.  Since an I/O operation addresses all drives at the same time,  RAID 3 cannot overlap I/O.  For this reason, RAID 3 is best for single-user systems with long record applications.  Very high transfer rates
  38. 38. RAID 4  This level uses large stripes, which means you can read records from any single drive.  This allows you to use overlapped I/O for read operations.  Since all write operations have to update the parity drive, no I/O overlapping is possible. RAID 4 offers no advantage over RAID 5.
  39. 39. RAID 5  The parity information is striped across each drive, allowing the array to function even if one drive were to failParity striped across all disks  Commonly used in network servers  RAID 5 requires at least three disks, but it is often recommended to use least five disks for performance reasons
  40. 40. RAID 6  Two parity calculations  The use of additional parity allows the array to continue to function even if two disks fail simultaneously.  However, this extra protection comes at a cost. RAID 6 arrays have a higher cost per gigabyte (GB) and often have slower write performance than RAID 5 arrays.
  41. 41. RAID 0, 1, 2
  42. 42. RAID 3 & 4
  43. 43. RAID 5 & 6
  44. 44. Optical storage • Optical storage is any storage method in which data is written and read with a laser for archival or backup purposes. • Typically, data is written to optical media, such as CDs and DVDs • Optical media is more durable than tape and less vulnerable to environmental conditions • On the other hand, it tends to be slower than typical hard drive speeds, and to offer lower storage capacities. • A number of new optical formats, such as Blu-ray and UDO (ultra density optical), use a blue laser to dramatically increase capacities.
  45. 45. Magnetic Disk Layout(Hard Disk)
  46. 46. Magnetic Disk Layout(Hard Disk)
  47. 47. Magnetic Disk Layout(Hard Disk)
  48. 48. Exam Questions Q: Assume you have a USB memory stick attached to your computer. After working with the files on the USB memory, a so called friend simply removes the USB memory from the computer. Now, how does your mood depend on the used update policy (write through or write back)? A: If my USB is a write-back, data is only updated in the cache and maybe not in the memory. Hence, my mood is towards anger. B. If my USB is a write-through, data is always updated. Hence, my mood is not changed if a so called friend removes the USB.
  49. 49. Exam Questions Q.Main types of technology utilized in computer memory system Ans: Primary and Seconday Memory System
  50. 50. ANY QUESTIONS?