Docsity

Computer Organisation - Memory Organization, Study notes of Computer Architecture and Organization

Partial preview of the text

Download Computer Organisation - Memory Organization and more Study notes Computer Architecture and Organization in PDF only on Docsity!

Memory Organization

Memory hierarchy

Magnetic tapes Magnetic disks^ processor^ I/O CPU

memory^ Main memory^ Cache

Auxiliary memory

Register Cache Main Memory Magnetic Disk Magnetic Tape

Connection of memory to CPU

CS1 CS2 RD

CS1^ WR^ AD7^ 128 x 8^ RAM^1 CS2 RD WR CS1^ AD7^ 128 x 8^ RAM^2 CS2 RD WR CS1^ AD7^ 128 x 8^ RAM^3 CS2 RD WR AD7^ 128 x 8^ RAM^4

3 Decoder 2 1 0

16-11^ Address bus 10 9 8 7-1 RD^ CPU WR Data bus

CS1 CS2 (^) 512 x 8 ROM 1- 7 98 AD

Data Data Data Data Data

Auxiliary storage Magnetic Disk drive

  • (^) Track
  • (^) Moving Head Disk Fixed Head Disk

Associative memory

  • (^) Accessed simultaneously and in parallel on the basis of data content rather than by specific address or location ▫Also called Content Addressable Memory (CAM)
  • (^) Word is written without specifying address
  • (^) Memory in itself allocate a free memory block
  • (^) To read, content of the word or part of

Block diagram of CAM

Argument register(A) Key register (K) Associative memory array and logic n bits per word^ m words

register^ Match Input Write^ Read^ M

Organization of CAM

Word 1^ C 11 Word i Word m Bit 1 Bit j Bit n

M 1

Mi Mm

A 1 An K 1 Kj Kn C1j C1n Ci1 Cij Cin Cm1 Cmj Cmn

A j

Cache Memory

  • (^) Fast small memory used to reduce average memory access time
  • (^) As more and more no. of access to memory, maps to cache, average memory access time
  • will approach access time of cacheLocality of reference ▫Reference to memory at any given time interval tend to be confined within a localized area

  Temporal LocalitySpatial Locality

Cache access

  • (^) All memory access are first directed to cache ▫If the word in cache – provide it to CPU ▫Else Bring a block containing required word to cache replacing a block already in cache
  • (^) Performance of cache ▫Hit ratio - % of memory access satisfied by Te =tc+(1-h)*tm^ cache memory system Where te is effective memory access time Tc is cache access time and h is hit ratio

Cache access

  • (^) Mapping – Specification of correspondence between main memory blocks and cache blocks ▫Associative mapping ▫ ▫Direct mapping Set-associative mapping

Associative mapping

Argument register^ address (15 bits) 0 1 0 0 0 0 2 7 7 7^ Address^ Data

CAM 2 2 2 3 5^ 3 4 5 0 6 7 1 0 1 2 3 4

Direct Mapping

  • (^) Each memory block has only one place to load in Cache
  • (^) Mapping Table is made of RAM instead of CAM
  • (^) n-bit memory address consists of 2 parts; k bits of Index field and n-k bits of Tag
  • fieldn-bit addresses are used to access main memory the Cache and k-bit Index is used to access

Direct mapping - operation

  • (^) CPU generates a memory request with (TAG;INDEX)
  • (^) Access Cache using INDEX ; (tag; data) Compare TAG and tag
  • (^) If matches -> Hit Provide CacheINDEX to CPU
  • (^) If not match -> Miss M[tag;INDEX] <- CacheINDEX Cache[INDEX] <- (TAG;M[TAG; INDEX]) CPU <- CacheINDEX

Direct Mapping

  • (^) with block size of 8 words Index 000 0 1tag 3 4 5 0data 007010017 0 1^ 6 5 7 8 770777 0 20 2 6 7 1 0

Block 0 Block 1

Block 63

Tag^6 Block^6 INDEX Word^3