30
MODULE 5: MAIN MEMORY

MODULE 5: MAIN MEMORY. Type of Main Memory 2 main type Read Only Memory (ROM) contents are not lost also called non-volatile memory Random Access

Embed Size (px)

Citation preview

Page 1: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

MODULE 5:MAIN MEMORY

Page 2: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Type of Main Memory

2 main type Read Only Memory (ROM)

contents are not lost also called non-volatile memory

Random Access Memory (RAM) contents of memory are lost if the machine is switched

off Also called volatile memory

Page 3: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Type of ROM

Programmable ROM (PROM) Programmed after manufacture Once they are programmed, cannot be changed

(One Time Programmable) Erasable Programmable ROM (EPROM)

can be erase by exposing to Ultraviolet (UV) radiation for a few minutes

can be reprogrammed Electrically Erasable and Programmable ROM

(EEPROM) Erase electrically not UV No need to take out the IC to erase

Flash memory Erase whole memory electrically

Page 4: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

4

ROM Usage

Permanent storage Nonvolatile

Microprogramming (see later) Library subroutines Systems programs (BIOS) Function tables

Page 5: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

TYPE OF RAM

There are 3 basic types of RAM Dynamic RAM (DRAM)

Commonly used as main memory Use capacitor to store data, 1- charged, 0 –

discharged Capacitor will lose it charge with time need to

recharge (refresh) Static RAM (SRAM)

Using flip-flop to store data – no need refresh Compare to DRAM – faster but more expensive, more complex and low capacity

Non-volatile RAM (NVRAM) RAM that is not volatile use internal power source to keep data in RAM during

power off

Page 6: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Memory: Comparison

Page 7: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Dynamic RAM (DRAM)

Bits stored as charge in capacitors Charges leak Need refreshing even when powered Simpler construction Smaller per bit Less expensive Need refresh circuits Slower Main memory Essentially analogue

Level of charge determines value

Page 8: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Static RAM (SRAM) Bits stored as on/off switches No charges to leak No refreshing needed when powered More complex construction Larger per bit More expensive Does not need refresh circuits Faster Cache Digital

Uses flip-flops

Page 9: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

SRAM v DRAM

Both volatile Power needed to preserve data

Dynamic cell Simpler to build, smaller More dense Less expensive Needs refresh Larger memory units

Static Faster Cache More expensive

Page 10: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Synchronous DRAM (SDRAM) Access is synchronized with an external clock Address is presented to RAM RAM finds data (CPU waits in conventional

DRAM) Since SDRAM moves data in time with system

clock, CPU knows when data will be ready CPU does not have to wait, it can do something

else Burst mode allows SDRAM to set up stream of

data and fire it out in block DDR-SDRAM sends data twice per clock cycle

(leading & trailing edge)

Page 11: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Synchronous DRAM (SDRAM)

Page 12: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

DDR SDRAM

SDRAM can only send data once per clock

Double-data-rate SDRAM can send data twice per clock cycle Rising edge and falling edge

Page 13: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Main Memory Capacity

Memory locations/words can be grouped into block.

 Memory capacity usually measured in bits: Total no. of memory locations/words * size of

memory word

Page 14: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Main Memory Capacity Example A

Main memory is divided into blocks. If a memory word is 8 bit and the size of a block is

8 words.

Page 15: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Main Memory Capacity Example A What is the capacity of the main memory, if the

total number of blocks in the memory is 128. 128 blocks * 8 words * 8 bits = 27 * 23 * 23 = 213

= 1K * 8 = 8 Kbit

 How many blocks in the main memory if the memory capacity is 32 Kbit.

Total number of words = 32 Kbit / 8 bit = 215 / 23 = 212

words Total number of blocks = 212 word / 8 words =

212 / 23 = 29 = 512 blocks

Page 16: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Main memory contains 8K blocks of 512 words each. Each word is 8 bit (1 byte).

Memory capacity = 512 * 8K = 4096 Kbytes (4096 Kwords)= 4096 x 8 Kbit = 212 X 23 X 210 bit =25 X 220

bit = 32 Mbit

Main Memory Capacity Example B

Page 17: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Memory Interleaving

Organize memory chips in modules/banks and issue memory requests to all banks at the same time.

Hence if you buy memory to upgrade you buy a Memory Module/Bank.

Access is more efficient when memory is organized into banks of chips with the addresses interleaved across the chips

Low-order interleaving, the low order bits of the address specify which memory bank contains the address of interest.

High-order interleaving, the high order address bits specify the memory bank/module.

Page 18: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Memory Interleaving

Memory Banks/Modules Memory usually implemented in module/interleave

(SIMM and DIMM) SIMM is single in-line memory module while DIMM is

dual in-line memory module. A DIMM (dual in-line memory module) is a double SIMM.

Page 19: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Low-Order Interleaving (LOI)

word in the bank/module(n-m) bits

bank/module addressm bits

Module 0 0

4

8

12

Module 1 1

5

9

13

Module 2 2

6

10

14

Module 3 3

7

11

15

Address Format

n bits

Page 20: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Example 1

60

M040

63

M373

61

M151

62

M262

000100

000000

111100

000101

000001

111101

000110

000010

000111

000011

111110 111111

These bits are same in all 4

modules.

Since these are low order bits, therefore its called LOI

Memory capacity = 64 or 26 no of address bit = 6Total main module/bank = 4 or 22 2 bits to address module/bankNo of bits for word in module/bank = 6 – 2 = 4 module/bank capacity = 24 = 16

Page 21: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Example 2

Given a memory address as 29Ch (10 bits) and there are 4 memory banks/modules. Determine the memory bank/module address and the address of the word in the bank/module.

Memory address = 29Ch = 1010 0111 00 There are 4 memory banks/modules 22 2 bit

for the banks/modules address.1010 0111 00

Page 22: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

M0 (00) M1 (01) M2 (10) M3 (11)

0 1 2 3

No of bits for word in module/bank = 10-2=8, module/bank capacity is 28 = 256Memory bank/module address = 00Address of the word in the bank/module = 1010 0111 = A7h

Example 2

000h

3FFh

0A7h

003h

3FCh 1020 1021 1022 1023

0000 0000 00b

1111 1111 00b 1111 1111 11b

0000 0000 11b

Page 23: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Advantages & Disadvantages (LOI) Advantages

It produces memory interference. Disadvantages

A failure of any single module would be catastrophic to the whole system.

Page 24: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

High-Order Interleaving (HOI)

bank/module address m bits

word in the bank/module(n-m) bits

Module 0

0

1

2

3

Module 1

4

5

6

7

Module 2

8

9

10

11

Module 3

12

13

14

15

Address Format

n bits

Page 25: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Example 3

15

M0

0

63

M3

48

31

M1

16

47

M2

32

000001

000000

001111

010001

010000

011111

100001

100000

110001

110000

101111 111111

These bits are same in all 4

modules.

Since these are high order bits, therefore its called HOI

Memory capacity = 64 or 26 no of address bit = 6Total main module/bank = 4 or 22 2 bits to address module/bankNo of bits for word in module/bank = 6 – 2 = 4 module/bank capacity = 24 = 16

Page 26: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Example 4

A main memory has 32 Mwords. There are 16 memory banks (modules). Draw the modular memory address format if the system is implemented with high-order interleaving.

Main memory has 32 Mwords 25 * Mwords = 25 * 220 = 225

Therefore main memory address size = 25 bits 16 memory modules/banks 24, module/bank address size

= 4 bits Word in the module/bank bits = 25 – 4 = 21 bits

bank/module address word in the bank/module

4 bits 21 bits

Page 27: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Advantages of HOI

Easy memory extension by the addition of one or more memory modules to a maximum of M-1.

Provides better reliability, since a failed module affects only a localized area of the address space.

This scheme would be used w/o conflict problems in multiprocessors if the modules are partitioned according to disjoint or non-interleaving processes( programs should be disjoint for its success).

Page 28: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Disadvantages of HOI

Scheme will cause memory conflicts in case of pipelined, vector processors. The sequentiality of instructions and data to be placed in the same module. Since memory cycle time is much greater than pipelined clock time, a previous memory request would not have completed its access before the arrival of next request, thereby resulting in a delay.

Process interacting and sharing instructions and data in multiprocessor system will encounter considerable conflicts.

This technique is useful only in one single user system/ single user multitasking system.

Page 29: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Error Correction

Hard Failure Permanent defect

Soft Error Random, non-destructive No permanent damage to memory

Detected using Hamming error correcting code

Page 30: MODULE 5: MAIN MEMORY. Type of Main Memory  2 main type  Read Only Memory (ROM) contents are not lost also called non-volatile memory  Random Access

Error Correcting Code Function