L/O/G/O Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

47
L/O/G/O www.themegallery.com Computer Memory Computer Memory Chapter 3 (a) Chapter 3 (a) CS.216 Computer Architecture and CS.216 Computer Architecture and Organization Organization

Transcript of L/O/G/O Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

Page 1: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

L/O/G/Owww.themegallery.com

Computer MemoryComputer MemoryChapter 3 (a)Chapter 3 (a)

CS.216 Computer Architecture and OrganizationCS.216 Computer Architecture and Organization

Page 2: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

2

Overview (1/2)

• Historically, the limiting factor in a computer’s performance has been memory access time– Memory speed has been slow compared to th

e speed of the processor

– A process could be bottlenecked by the memory system’s inability to “keep up” with the processor

Page 3: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

3

Overview (2/2)

• Our goal in this section is to study the development of an effective memory organization that supports the processing power of the CPU– General memory organization and performan

ce

– “Internal” memory components and their use

– “External” memory components and their use

• Reading: Text, chapters 4 and 5

Page 4: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

SIT, KMUTT Section 3a 4

Terminology (1/7)

• Capacity: the amount of information that can be contained in a memory unit -- usually in terms of words or bytes

• Word: the natural unit of organization in the memory, typically the number of bits used to represent a number

• Addressable unit: the fundamental data element size that can be addressed in the memory -- typically either the word size or individual bytes

Page 5: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

5

Terminology (2/7)

• Unit of transfer: The number of data elements transferred at a time -- usually bits in main memory and blocks insecondary memory

• Transfer rate: Rate at which data is transferred to/from the memory device

Page 6: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

6

Terminology (3/7)

• Access time:– For RAM, the time to address the unit and p

erform the transfer

– For non-random access memory, the time to position the R/W head over the desired location

• Memory cycle time: Access time plus any other time required before a second access can be started

Page 7: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

7

Terminology (4/7)

• Access technique: how are memory contents accessed– Random access:

• Each location has a unique physical address

• Locations can be accessed in any order and all access times are the same

• What we term “RAM” is more aptly called read/write memory since this access technique also applies to ROMs as well

• Example: main memory

Page 8: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

8

Terminology (5/7)

–Sequential access:• Data does not have a unique address

• Must read all data items in sequence until the desired item is found

• Access times are highly variable

• Example: tape drive units

Page 9: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

9

Terminology (6/7)

–Direct access:• Data items have unique addresses• Access is done using a combination of moving

to a general memory “area” followed by a sequential access to reach the desired data item

• Example: disk drives

Page 10: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

10

Terminology (7/7)

– Associative access:• A variation of random access memory• Data items are accessed based on their contents

rather than their actual location• Search all data items in parallel for a match to a

given search pattern• All memory locations searched in parallel without

regard to the size of the memory – Extremely fast for large memory sizes

• Cost per bit is 5-10 times that of a “normal” RAM cell

• Example: some cache memory units

Page 11: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

11

Memory Hierarchy (1/10)

• Major design objective of any memory system–To provide adequate storage capacity

at–An acceptable level of performance–At a reasonable cost

Page 12: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

12

Memory Hierarchy (2/10)

• Four interrelated ways to meet this goal– Use a hierarchy of storage devices– Develop automatic space allocation methods f

or efficient use of the memory– Through the use of virtual memory techniques

, free the user from memory management tasks

– Design the memory and its related interconnection structure so that the processor can operate at or near its maximum rate

Page 13: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

13

Memory Hierarchy (3/10)

• Basis of the memory hierarchy– Registers internal to the CPU for temporary

data storage (small in number but very fast)

– External storage for data and programs (relatively large and fast)

– External permanent storage (much larger and much slower)

Page 14: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

14

Memory Hierarchy (4/10)

• Characteristics of the memory hierarchy– Consists of distinct “levels” of memory comp

onents

– Each level characterized by its size, access time, and cost per bit

– Each increasing level in the hierarchy consists of modules of larger capacity, slower access time, and lower cost/bit

Page 15: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

15

Memory Hierarchy (5/10)

• Goal of the memory hierarchy–Try to match the processor speed with

the rate of information transfer from the lowest element in the hierarchy

Page 16: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

16

The memory hierarchy

Page 17: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

17

Typical memory Parameters

Page 18: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

18

Memory Hierarchy (8/10)

• The memory hierarchy works because of locality of reference

– Memory references made by the processor, for both instructions and data, tend to cluster together

• Instruction loops, subroutines• Data arrays, tables

– Keep these clusters in high speed memory to reduce the average delay in accessing data

Page 19: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

19

Memory Hierarchy (9/10)– Over time, the clusters being referenced wil

l change -- memory management must deal with this

Example:

– Two-level memory system

– Level 1 access time of 1 us

– Level 2 access time of 10us

– Ave access time = H(1) + (1-H)(10+1) us

Page 20: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

SIT, KMUTT Section 3a 20

2-level memory performance

Page 21: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

SIT, KMUTT Section 3a 21

Memory Technology (1/15)• Core memory

– Used in generations 2 and 3– Magnetic cores (toroids) used to store logical 0 or 1 state by inducing an

E-field in them (hysteresis loop)• 1 core = 1 bit of storage

– Required addressing and sensing wires ran through each core– Destructive readout– Obsolete

• Replaced in the 1970s by semiconductor memory

Page 22: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

22

Memory Technology (2/15)

Organization of Memory 16x1 bit

Coil Capacitor Transistors

Wired Fuse

1-bit Data

0

1

2

3

10 2 3

A0

A1

A2

A3

0

0

1

0

Addr = A3..A0Addr = 0100

RAS

CAS

Page 23: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

23

Memory Technology (3/15)

• Semiconductor memory– Typically random access– RAM: actually read-write memory

• Dynamic RAM – Storage cell is essentially a transistor acting a

s a capacitor– Capacitor charge dissipates over time causing

a 1 to flip to a zero – Cells must be refreshed periodically to avoid t

his– Very high packaging density

Page 24: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

24

Memory Technology (4/15)

• Static RAM: basically an array of flip-flop storage cells

– Uses 5-10x more transistors than similar dynamic cell so packaging density is 10x lower

– Faster than a dynamic cell

Page 25: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

25

–Read Only Memories (ROM)• “Permanent” data storage

• ROMs– Data is “wired in” during fabrication at a chip m

anufacturer’s plant– Purchased in lots of 10k or more

Memory Technology (5/15)

Page 26: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

26

Memory Technology (6/15)

• PROMs– Programmable ROM– Data can be written once by the user employing a P

ROM programmer– Useful for small production runs

• EPROM– Erasable PROM– Programming is similar to a PROM– Can be erased by exposing to UV light

Page 27: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

27

Memory Technology (7/15)

• EEPROMS– Electrically erasable PROMs– Can be written to many times while remaining i

n a system– Does not have to be erased first– Program individual bytes– Writes require several hundred usec per byte– Used in systems for development, personalizati

on, and other tasks requiring unique information to be stored

Page 28: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

28

Memory Technology (8/15)

•Flash Memory– Similar to EEPROM in using electrical erase – Fast erasures, block erasures– Higher density than EEPROM

Page 29: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

29

Memory Technology (9/15)

–Organization• Each memory chip contains a number of 1-

bit cells– 1, 4, and 16 million cell chips are common

• Cells can be arranged as a single bit column (e.g., 4Mx1) or in multiple bits per address location (e.g., 1Mx4)

• See Slide 22

Page 30: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

30

Memory Technology (10/15)

• To reduce pin count, address lines can be multiplexed with data and/or as high and low halves

– Trade off is in slower operation

• Typical control lines– W* (write), OE* (output enable) for write and read operations

– CS* (chip select) derived from external address decoding logic

– RAS*, CAS* (row and column address selects) used when address is applied to the chip in 2 halves

Page 31: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

31

Memory Technology (11/15)

Organization of Memory 16x1 bit

Coil Capacitor Transistors

Wired Fuse

1-bit Data

0

1

2

3

10 2 3

A0

A1

A2

A3

0

0

1

0

Addr = A3..A0Addr = 0100

RAS

CAS

Page 32: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

32

Figure 4.8 256Kx8 memory from 256Kx1 chips

Page 33: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

33

Figure 4.9 1Mx8 memory from 256Kx1 chips

AA BB CC DD

Page 34: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

34

Memory Technology (14/15)

–Improvements to DRAM• Basic DRAM design has not changed m

uch since its development in the 70s

• Cache was introduced to improve performance

– Limited to no gain in performance after a certain amount of cache is implemented

Page 35: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

35

Memory Technology (15/15)

• Enhanced DRAM– Add fast 1-line SRAM cache to DRAM chip

– Consecutive reads to the same line are from this cache and thus faster than the DRAM itself

– Tests indicate these chips can perform as well as tradition DRAM-cache combinations

• Cache DRAM– Use larger SRAM cache on the chip as a true multi-line cac

he

– Use it as a serial data stream buffer for block data transfers

Page 36: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

36

Error Correction (1/11)

• Semiconductor memories are subject to errors– Hard (permanent) errors

• Environmental abuse• Manufacturing defects• Wear

– Soft (transient) errors• Power supply problems• Alpha particles

– Problematic as feature sizes shrink

Page 37: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

37

Error Correction (2/11)

–Memory systems include logic to detect and/or correct errors• Width of memory word is increased

• Additional bits are parity bits

• Number of parity bits required depends on the level of detection and correction needed

Page 38: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

38

Error Correction (3/11)

Basic error detection and correction circuitry

D’D

P P’

P”

Page 39: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

39

Error Correction (4/11)

• General error detection– A single error is a bit flip.– Even Parity Error Detection

• Function f as follow:

D D’ P P’ P” Events Notes

1011 1011 1 1 1 No error P=P’=P”1111 1 0 1-bit error Detected1101 1 1 2-bit error Cannot be Detected

3210 DDDDP

Page 40: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

40

• General error detection and correction– A single error is a bit flip -- multiple bit flips can o

ccur in a word– 2M valid data words– 2M+K codeword combinations in the memory– Distribute the 2M valid data words among the 2 M

+K codeword combinations such that the “distance” between valid words is sufficient to distinguish the error

Error Correction (5/11)

Page 41: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

41

Error Correction (6/11)

Page 42: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

42

• Single error detection and correction– For each valid codeword, there will be 2K-

1 invalid codewords

– 2K-1 must be large enough to identify which of the M+K bit positions is in error

– Therefore 2K-1 > M+K• 8-bit data, 4 check bits• 32-bit data, 6 check bits

– Arrange bits as shown in Figure 4.12

Error Correction (7/11)

Page 43: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

43

Error Correction (8/11)

87658

84324

764312

754211

MMMMC

MMMMC

MMMMMC

MMMMMC

Figure 4.12

PreStore Codeword (C’)

PostStore Codeword (C”)

Bit Position in Error

Error Detection EquationError Detection Equation

Codeword ComputationCodeword Computation

Page 44: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

44

– Bit position n is checked by bits Ci such that the sum of the subscripts, i, equals n (e.g., position 10, bit M6, is checked by bits C2 and C8)

– To detect errors, compare the check bits read from memory to those computed during the read operation (use XOR)• If the result of the XOR is 0000, no error• If non-zero, the numerical value of the result i

ndicates the bit position in error– If the XOR result was 0110, bit position 6 (M3) is in error

Error Correction (9/11)

Page 45: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

45

Error Correction (10/11)• Example

111018

011114

0101112

1111111

C

C

C

C

PreStore:PreStore:M8..M1 = 1101 1111M8..M1 = 1101 1111

01001"8

01111"4

100111"2

001111"1

C

C

C

C

PostStore:PostStore:M8..M1 = 1M8..M1 = 10001 111101 1111

1 0 0 1

0 0 1 0

1 0 1 1

Error Detection Equation (When C’=C)Error Detection Equation (When C’=C)

Bit Position 11 = M7Therefore M7 is error.

C8’ C4’ C2’ C1’

C8” C4” C2” C1”

E8 E4 E2 E1

Page 46: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

46

Error Correction (11/11)

– Double error detection can be added by adding another check bit that implements a parity check for the whole word of M+K bits

• SED and SEC-DED are generally enough protection in typical systems

Page 47: L/O/G/O  Computer Memory Chapter 3 (a) CS.216 Computer Architecture and Organization.

L/O/G/Owww.themegallery.com

Question!Do you have any