Cmp 101 Set 7 Memory

Embed Size (px)

Citation preview

  • 8/4/2019 Cmp 101 Set 7 Memory

    1/35

    Fundamentals of Computer and

    programming in C

    (CMP 101 )

    MEMORY

  • 8/4/2019 Cmp 101 Set 7 Memory

    2/35

    Memory

    Main memory consists of a number of

    storage locations, each of which isidentified by a unique address

    The ability of the CPU to identifyeach location is known as itsaddressability

    Each location stores a word i.e. thenumber of bits that can be processedby 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 systemperformance, though may be lessefficient on occasions when the full wordlength is not used

  • 8/4/2019 Cmp 101 Set 7 Memory

    3/35

    Main Memory

    Storage Evaluation

    Criteria

    Explanation

    Storage capacity Maximum number of bytes/words.

    Access time Time required to locate and retrieved stored data.

    Cost per bit of storage Cost of a memory unit of a desired capacity.

    Volatile/Nonvolatile Volatile memory looses data when power source is

    turned off or interrupted. Nonvolatile memory retains

    data when power is turned off or interrupted.

    Random access In random access memory (RAM) every data item can

    be accessed independently at any instance of time.

    Main memory, primary memory or simply memory is usedby CPU to store/retrieve data and instructions temporarily.

  • 8/4/2019 Cmp 101 Set 7 Memory

    4/35

    Why more bits? Larger numbers

    and address space

    Mainmemory

    Interfacing

    device

    requeststo read or

    write

    contents

    Controller

    Addresses Contents

    0

    1

    2

    3

    4

    5

    -

    -

    -

    - 1 2 n

    Address buss: Sends thememory address of the data.Address space: Number of memorybyte or wordsAddress space = 2n where nis the

    number of bits in address bus.

    Data buss

    Bits

  • 8/4/2019 Cmp 101 Set 7 Memory

    5/35

    Fixed and variable length memory

    Word addressable memory: Where each word is offixed size 16-bits, 32-bits or 64-bit words. They canstore 2, 4 or 8 characters (or bits). Such memory isviewed as fixed length memory.

    Character (or byte) addressable memory is viewed asvariable length memory.

  • 8/4/2019 Cmp 101 Set 7 Memory

    6/35

    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. Inmodern computers it also holds the operating system

  • 8/4/2019 Cmp 101 Set 7 Memory

    7/35

    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

  • 8/4/2019 Cmp 101 Set 7 Memory

    8/35

    4. Static Random Access Memory (SRAM)

    Doesnt 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

    Types of RAM

  • 8/4/2019 Cmp 101 Set 7 Memory

    9/35

    The operation of cache memory

    1. Cache fetches datafrom next to currentaddresses in mainmemory

    2. CPU checks to seewhether the nextinstruction it requires is incache

    3. If it is, then theinstruction is fetched from

    the cache a very fastposition

    4. If not, the CPU has to

    fetch next instructionfrom main memory - amuch slower process

    Main

    Memory

    (DRAM)

    CPU

    Cache

    Memory

    (SRAM)

    = Bus connections

  • 8/4/2019 Cmp 101 Set 7 Memory

    10/35

    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 systems 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 programsand 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 inmilliseconds (Note: a millisecond is a thousandth of a second)

    Virtual memory is much slower than RAM

  • 8/4/2019 Cmp 101 Set 7 Memory

    11/35

    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

  • 8/4/2019 Cmp 101 Set 7 Memory

    12/35

    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 byshining ultra-violet light on it

    After reprogramming the window is covered to prevent new contents beingerased

    Access time is around 45 90 nanoseconds

  • 8/4/2019 Cmp 101 Set 7 Memory

    13/35

    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. ROM cartridges

    Commonly used in games machines

    Prevents software from being easily copied

  • 8/4/2019 Cmp 101 Set 7 Memory

    14/35

    Memory configurations for Intel CPUs

  • 8/4/2019 Cmp 101 Set 7 Memory

    15/35

    Read about the following Computer

    Memory Types

    L1 cache

    L2 cache

    RAM - the Main Memory

    DRAM

    Fast Page Mode DRAM

    EDO DRAM

    SDRAM

    PC133

    SDRAMDDR

    SDRAM

    DDR2 SDRAM

    Dual-channel DDR

    1T-SRAM

    Direct RDRAM

    SIMMs

    DIMMs

    RIMMs

    Presence detect

    Parity memory

    ECC memoryMemory upgrades

    Evolution

    Flash memory

    Magnetic RAM

    http://www.pctechguide.com/14Memory_L1_cache.htmhttp://www.pctechguide.com/14Memory_L2_cache.htmhttp://www.pctechguide.com/14Memory_Main_memory.htmhttp://www.pctechguide.com/14Memory_DRAM.htmhttp://www.pctechguide.com/14Memory_FPM_DRAM.htmhttp://www.pctechguide.com/14Memory_EDO_DRAM.htmhttp://www.pctechguide.com/14Memory_SDRAM.htmhttp://www.pctechguide.com/14Memory_PC133_SDRAM.htmhttp://www.pctechguide.com/14Memory_PC133_SDRAM.htmhttp://www.pctechguide.com/14Memory_DDR_DRAM.htmhttp://www.pctechguide.com/14Memory_DDR_DRAM.htmhttp://www.pctechguide.com/14Memory_DDR2_DRAM.htmhttp://www.pctechguide.com/14Memory_Dual-channel_DDR.htmhttp://www.pctechguide.com/14Memory_1T-SRAM.htmhttp://www.pctechguide.com/14Memory_Direct_RDRAM.htmhttp://www.pctechguide.com/14Memory_SIMMs.htmhttp://www.pctechguide.com/14Memory_DIMMs.htmhttp://www.pctechguide.com/14Memory_RIMMs.htmhttp://www.pctechguide.com/14Memory_Presence_detect.htmhttp://www.pctechguide.com/14Memory_Parity_memory.htmhttp://www.pctechguide.com/14Memory_ECC_memory.htmhttp://www.pctechguide.com/14Memory_Memory_upgrades.htmhttp://www.pctechguide.com/14Memory_Evolution.htmhttp://www.pctechguide.com/14Memory_Flash_memory.htmhttp://www.pctechguide.com/14Memory_Magnetic_RAM.htmhttp://www.pctechguide.com/14Memory_Magnetic_RAM.htmhttp://www.pctechguide.com/14Memory_Flash_memory.htmhttp://www.pctechguide.com/14Memory_Evolution.htmhttp://www.pctechguide.com/14Memory_Memory_upgrades.htmhttp://www.pctechguide.com/14Memory_ECC_memory.htmhttp://www.pctechguide.com/14Memory_Parity_memory.htmhttp://www.pctechguide.com/14Memory_Presence_detect.htmhttp://www.pctechguide.com/14Memory_RIMMs.htmhttp://www.pctechguide.com/14Memory_DIMMs.htmhttp://www.pctechguide.com/14Memory_SIMMs.htmhttp://www.pctechguide.com/14Memory_Direct_RDRAM.htmhttp://www.pctechguide.com/14Memory_1T-SRAM.htmhttp://www.pctechguide.com/14Memory_1T-SRAM.htmhttp://www.pctechguide.com/14Memory_1T-SRAM.htmhttp://www.pctechguide.com/14Memory_Dual-channel_DDR.htmhttp://www.pctechguide.com/14Memory_Dual-channel_DDR.htmhttp://www.pctechguide.com/14Memory_Dual-channel_DDR.htmhttp://www.pctechguide.com/14Memory_DDR2_DRAM.htmhttp://www.pctechguide.com/14Memory_DDR_DRAM.htmhttp://www.pctechguide.com/14Memory_DDR_DRAM.htmhttp://www.pctechguide.com/14Memory_DDR_DRAM.htmhttp://www.pctechguide.com/14Memory_PC133_SDRAM.htmhttp://www.pctechguide.com/14Memory_PC133_SDRAM.htmhttp://www.pctechguide.com/14Memory_PC133_SDRAM.htmhttp://www.pctechguide.com/14Memory_PC133_SDRAM.htmhttp://www.pctechguide.com/14Memory_SDRAM.htmhttp://www.pctechguide.com/14Memory_EDO_DRAM.htmhttp://www.pctechguide.com/14Memory_FPM_DRAM.htmhttp://www.pctechguide.com/14Memory_DRAM.htmhttp://www.pctechguide.com/14Memory_Main_memory.htmhttp://www.pctechguide.com/14Memory_Main_memory.htmhttp://www.pctechguide.com/14Memory_Main_memory.htmhttp://www.pctechguide.com/14Memory_Main_memory.htmhttp://www.pctechguide.com/14Memory_L2_cache.htmhttp://www.pctechguide.com/14Memory_L1_cache.htm
  • 8/4/2019 Cmp 101 Set 7 Memory

    16/35

    The basic rule--which states that the number

    of transistors on a chip doubles every 24

    months--has been the guiding principle of the

    high-tech industry since it was coined by Intel

    co-founder Gordon Moore in 1965.

  • 8/4/2019 Cmp 101 Set 7 Memory

    17/35

    Limitations of Primary Storage

    Limited Capacity: It cannot be used to store the large

    volumes of data items.

    Volatility: Looses data when electric power is turned

    off or interrupted. Data Portability: It cannot be used to port the data

    from one place to other.

    These limitations lead to the development of

    auxiliary memory or secondary storage devices.

  • 8/4/2019 Cmp 101 Set 7 Memory

    18/35

    Secondary Storage Devices

    Sequential

    Access Devices

    Direct Access

    Devices

    Magnetic Tape Magnetic Disk Optical Disk

    Hard

    Disk

    Floppy

    Disk

    CD-ROM WORM

    Disk

    ZIP

    Disk

    Disk

    Pack

    Winchester

    Disk

  • 8/4/2019 Cmp 101 Set 7 Memory

    19/35

    Magnetic Tape

    The first truly mass

    auxiliary storage device

    was the magnetic tape

    drive

    Tape drives have amajor problem; canyou describe it?

  • 8/4/2019 Cmp 101 Set 7 Memory

    20/35

    0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L N O P

    1

    1

    1

    0

    0

    0

    1

    7

    6

    5

    4

    3

    2

    1

    Numeric

    zone

    Parity bit

    Track/Channel

    numbers

    7 Track;6-bit BCD; Even parity (all tracks must have even number of 1)

    A frame

    6-bit BCD for letter A (Table 4.2 page 36

    Even parity (all tracks must have even number of 1)

    Error Checking

  • 8/4/2019 Cmp 101 Set 7 Memory

    21/35

    0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L N O P

    0

    0

    1

    1

    0

    0

    0

    1

    0

    9

    8

    7

    6

    5

    4

    3

    2

    1

    Track/Channel

    numbers

    9 Track;8-bit EBCDIC; Even parity (all tracks must have even number of 1)

    A frame

    8-bit EBCDIC for letter A (Table 4.3 page 8

    Odd parity (all tracks must have odd number of 1)Error Checking

    3s digit

    2s digit

    Added Zone

    Added Zone

    Zone

    Parity bit

    Zone

    Units digit

    4s digit

    1 1 0 0 0 0 0 1

    EBCDIC for the letter A

  • 8/4/2019 Cmp 101 Set 7 Memory

    22/35

    Terminologies

    Inter record gap (IRG)

    Blocking factor: # of records perblocks

    Inter Block gap (IBG)

    Blocks: Records are grouped into blocks

    Record: Group of characters separated by blank

    Storage capacity of tape= Data recording density x LengthData transfer rate (bytes/second to main memory

    Tape drive

    Tape controller

    Tape Types (Half-inch tape reel, Half-inch tape

    cartridge, Quarter-inch streamer tape and 4mm

    Digital Audio Tape (DAT)

  • 8/4/2019 Cmp 101 Set 7 Memory

    23/35

    Advantages & Limitations of Magnetic

    Tape

    Advantages

    Virtually unlimited

    storage capacity.

    Low cost. Easy to handle and store.

    Easy to port.

    Limitations

    The are not suitably for

    frequent data access.

    Must be operated industless environment.

    Must be operated in

    controlled environment.

    Must have properidentification labels

  • 8/4/2019 Cmp 101 Set 7 Memory

    24/35

    Uses of Magnetic Tape

    Good for applications that require sequential

    data processing.

    Data backup.

    Data archiving.

    Physically large data transfer

    Software distribution

  • 8/4/2019 Cmp 101 Set 7 Memory

    25/35

    Magnetic DisksA platter coated with iron oxide: A

    magnetizable material

    Generally 8 bit EBCDIC code

    is used to record the data

    items.Surface: 2 surfaces per disk.

    Tracks:000-199.

    Sectors: 8 sectors per track.

    Disk pack: 200 disks.

    Cylinder: Each track from

    all recording surfaces in adisk pack form a cylinder.

    Storage capacity = # of

    surfaces # of tracks per

    surfacex # of sectors per

    track x# of bytes per sector.

    Access mechanism:Read/write head moves to

    an address by specifying the

    (disk #, track #, sector #,

    byte #)

  • 8/4/2019 Cmp 101 Set 7 Memory

    26/35

    Magnetic Disks

    Seek Time: Time to move the R/W head to the desired track.Latency or Rotational Delay Time: Time to rotate the disk to thedesired sector of a track.

    Average Latency Time?Transfer Rate:Rate at which data to be written/read. Transfer rate =n x r /60 where n is the # of bytes per track and r is the revolution per

    second.

    Disk Formatting: Formatting prepares a disk to be used by differentdisk drives. Formatting creates file allocation table (FAT) that specifies

    the track and sector of the data items.

    Important: Magnetic Disks are direct or random access devicebecause data items can be accessed by specifying its address.

    Disk drives with interchangeable disks.Disk drives with fixed disks.Disk Controller: Controls the movement of R/W heads, and disk

    rotation.

  • 8/4/2019 Cmp 101 Set 7 Memory

    27/35

    Magnetic

    Disk

    FloppyDisk (1.4 MB)

    HardDisk

    Zip Bernoulli

    Disk

    (Portable/Fixed)

    Disk

    Packs

    Winchester

    Disk

    Magnetic Disk Type

  • 8/4/2019 Cmp 101 Set 7 Memory

    28/35

    Advantages & Limitations

    Advantages

    Direct Access.

    Simultaneous sharing.

    On-line/Off-line access. Unlimited disk may be

    added.

    Low cost.

    Portable Fast

    Limitations

    Inefficient for sequential

    data processing.

    Sharing make dataunsecured

    Disk failure.

    Cost of magnetic tape is

    lower Must be operated in

    dustless environment

  • 8/4/2019 Cmp 101 Set 7 Memory

    29/35

    Uses of Magnetic Drives

    Random access applications

    Shared on-line secondary storage.

    Data backup. Data archiving

    Data and software transportation.

    Software distribution.

  • 8/4/2019 Cmp 101 Set 7 Memory

    30/35

    OPTICAL DISK

    In the optic readable CD-ROM, the data

    storage consists of millions of indentations

    burnt into light reflecting silver surface. The

    burnt dents reflect less light than the shinysurface.

  • 8/4/2019 Cmp 101 Set 7 Memory

    31/35

    Tracks

    The CD-ROM has onlyone track, a spiralwinding its way from

    the center to the outeredge. The spiral trackis ideal for readinglarge block of serial

    data.

  • 8/4/2019 Cmp 101 Set 7 Memory

    32/35

    Access MEchanism

    A weak laser beam is sent to the disk through

    a two-way mirror and the sensor registers the

    difference in light reflection from the burnt

    and shiny areas as zeros and ones.

    Access time: 100-300 millisecond.

    CD-ROM (Compact disk read only memory).

    WORM (Write once read memory)

    R/W CD (Read/Write compact disk)

  • 8/4/2019 Cmp 101 Set 7 Memory

    33/35

    Advantages & Limitations

    Advantages

    Low cost

    Ideal for reading large

    volumes of data. No mechanical R/W

    heads.

    Long life data storage.

    Easy to handle, store andport.

    Limitations

    Slower than magnetic

    disk.

    Complicated drive thanmagnetic disk.

    Uses of optical disk

    Distribution of large

    amount of data andMulltimedia.

  • 8/4/2019 Cmp 101 Set 7 Memory

    34/35

    Mass Storage

    Disk Array: It uses a set of magnetic disks.

    Automated tape library: Uses a set of

    magnetic tapes.

    CD-ROM jukebox: Uses a set of CDROM

  • 8/4/2019 Cmp 101 Set 7 Memory

    35/35

    Cache

    Memory

    Main Memory

    Hard DiskMagnetic tape, Floppy,

    Mass Storage

    Memory Hierarchy