CoE EE 00142 Computer Organization Set 9 Memory - PowerPoint PPT Presentation

1 / 85
About This Presentation
Title:

CoE EE 00142 Computer Organization Set 9 Memory

Description:

Computer Organization. Set 9 Memory. Ron Hoelzeman. University of Pittsburgh ... Main working memory of computer. Used to hold programs and data. University of ... – PowerPoint PPT presentation

Number of Views:37
Avg rating:3.0/5.0
Slides: 86
Provided by: ronhoe
Category:

less

Transcript and Presenter's Notes

Title: CoE EE 00142 Computer Organization Set 9 Memory


1
CoE - EE 00142Computer OrganizationSet 9 Memory
  • Ron Hoelzeman

2
Five Computer Components
3
Memory and Storage
  • We have already seen memory
  • Registers, program memory, etc.
  • Lots of kinds
  • Primary memory
  • Cache
  • Hard disks
  • Removable disks, floppy
  • Optical - CDROM
  • Tapes
  • etc.

4
Memory Hierarchy
5
Memory Hierarchy
6
Basic Computer Organization
7
Memory Hierarchy
Data typically transferred a block at a time
Fig 7.2
8
Speed Size - Cost
Fig 7.1
9
Memory Tradeoff
10
Size Distance From CPU
Fig 7.3
11
Example Memory Structure
12
Internal Computer Memory
  • Two basic styles - RAM and ROM
  • RAM - Random Access Memory
  • Read and Write
  • ROM - Read Only Memory
  • PLD, PLA, CPLD, FPGA

13
Original Core Memory
14
Properties of RAM Memory
  • Static RAM - SRAM
  • Essentially a latch or FF
  • Dynamic RAM - DRAM
  • Uses charge on capacitor
  • Needs refreshing
  • Both are volatile
  • i.e. lose stored information when power is removed

15
Main Memory Block Diagram
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
16
Example 1024X16 Memory
1024 x 16 words x bits
17
Example Number Storage
  • Suppose that we want to store the 32-bit
    hexadecimal value 12345678, and that it is to
    stored in a 32-bit word in byte-addressed memory
    starting in location 184. The word will require
    4 bytes with the least significant byte
    containing 78 and the most significant byte
    containing 12.

18
Memory Data Byte OrderingThree Ways
  • Little-endian
  • Big-endian
  • Bi-endian

19
Byte Ordering Example
value 12345678
Little-endian
Big-endian
Intel x86, Vax
Motorola, Sun, RISC
20
Bi-endian
  • In a bi-endian machine, the data can be stored in
    either direction. The actual direction is
    determined by the operating system, but once
    established, all data is stored in the same
    direction.
  • Power PC is example

21
Memory Size
  • Words or Bytes, typically bytes
  • Measured in K, M, or G
  • K - kilo - 210 1,024
  • M - meg - 220 1,048,576
  • G - gig - 230 1,073,741,824
  • For example 64K 26 210 216

22
Basic Static RAM Cell Model
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
23
RAM Bit Slice Model
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
24
Address Decoder
25
Example Address Decoder
26
RAM Bit Slice Model Symbol
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
27
16 - Word by 1 - Bit Chip
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
28
Three State Buffer
When EN 1, output input When EN 0, output
Hi Impedance
Allows you to connect 64K single bit
lines together without worrying about
loading Also allows connection to BUS
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
29
Consider a two dimensional memory selection
30
16 X 1 RAM Using 4 X 4 Cell Array
Coincident Selection - use two k/2 input decoders
instead of one k input decoder
16 words by 1 bits but uses a row-column Coinciden
t Selection approach for addressing
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
31
Bit Plane Depiction of Memory
32
8X2 RAM using 4X4 Cell Array
Can also be arranged in other ways Same 16 bits
but arranged 8 words by 2 bits using a
row-column approach for addressing
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
33
Coincident Selection
  • Improves speed
  • Reduces complexity
  • Example - a realistic 32K X 8
  • Single decoder 15 inputs 32K outputs would need
    32,800 gates
  • With two decoders (6 and 9) would need 608 gates
  • Reduces gates (therefore improves speed) by
    factor of 50

34
64K X 8 RAM Chip
64K 216
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
35
256K X 8 RAM
256K 218
8 bit data
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
36
Alternatively - 64K X 16 RAM
16 bit data
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
37
RAM Conclusions
  • Typically constructed in arrays
  • Fabricated as chips
  • Can be arranged in several forms
  • Depending on machine configuration
  • Main working memory of computer
  • Used to hold programs and data

38
Error Detection and Correction
  • Used to check if data was written/read correctly
    - or if data is transmitted correctly
  • Parity check - simplest
  • even or odd
  • Hamming code - more complex
  • Detect and correct errors

39
Even or Odd Parity
  • 50/50 chance of detection
  • Presumes one bit error most likely
  • Detection only - no correction

40
Even Parity Example
Data is on bits 1, 2, 3, 4, 5, 6, 7, 8
P XOR of bits (1, 2, 3, 4, 5, 6, 7, 8) 0 ? 1
? 1 ? 1 ? 1 ? 0 ? 0 ? 1 1
This is what is transmitted or stored
41
Even Parity Example
If read correctly
P XOR of bits (1, 2, 3, 4, 5, 6, 7, 8, 9) 0 ?
1 ? 1 ? 1 ? 1 ? 0 ? 0 ? 1 ? 1 0
42
Even Parity Example
If read incorrectly (error in bit 2 from a 1 to 0)
P XOR of bits (1, 2, 3, 4, 5, 6, 7, 8, 9) 0 ?
0 ? 1 ? 1 ? 1 ? 0 ? 0 ? 1 ? 1 1
But it is not clear where the error occurred
43
Hamming Codes
  • Error detection and correction
  • Presumes one bit error most likely
  • Detects error and position
  • therefore allows for correction

44
Hamming Code Example
Data is on bits 3, 5, 6, 7, 9, 10, 11, 12
P1 XOR of bits (3, 5, 7, 9, 11) 1 ? 1 ? 0 ? 0
? 0 0 P2 XOR of bits (3, 6, 7, 10, 11) 1 ?
0 ? 0 ? 1 ? 0 0 P4 XOR of bits (5, 6, 7, 12)
1 ? 0 ? 0 ? 0 1 P8 XOR of bits (9, 10, 11,
12) 0 ? 1 ? 0 ? 0 1
This is what is transmitted or stored
Note that parity bits are in power of 2 positions
45
Hamming Code Example
If data received or read from memory is correct
4 check bits are evaluated as follows
C1 XOR of bits (1, 3, 5, 7, 9, 11) 0 ? 1 ? 1
? 0 ? 0 ? 0 0 C2 XOR of bits (2, 3, 6, 7, 10,
11) 0 ? 1 ? 0 ? 0 ? 1 ? 0 0 C4 XOR of bits
(4, 5, 6, 7, 12) 1 ? 1 ? 0 ? 0 ? 0 0 C8 XOR
of bits (8, 9, 10, 11, 12) 1 ? 0 ? 1 ? 0 ? 0 0
46
Hamming Code Example
If data received or read from memory is not
correct
If read incorrectly (change bit 3 from a 1 to 0)
4 check bits are evaluated as follows
C1 XOR of bits (1, 3, 5, 7, 9, 11) 0 ? 0 ? 1
? 0 ? 0 ? 0 1 C2 XOR of bits (2, 3, 6, 7, 10,
11) 0 ? 0 ? 0 ? 0 ? 1 ? 0 1 C4 XOR of bits
(4, 5, 6, 7, 12) 1 ? 1 ? 0 ? 0 ? 0 0 C8 XOR
of bits (8, 9, 10, 11, 12) 1 ? 0 ? 1 ? 0 ? 0 0
0 0 1 1 Error in bit 3
47
Programmable Logic Devices
  • ROM - Read only memory
  • PLA - Programmable logic array
  • PAL - Programmable array logic
  • CPLD - Complex programmable logic device
  • FPGA - Field-programmable gate array

48
Programmable Logic Devices
  • All permanent
  • Typically WORM
  • write once - read many
  • Typically use fuse, antifuse, or mask
  • Sometimes erasable

49
ROM - Read Only Memory
  • Non volatile
  • maintains information without power
  • Typically programmed by
  • blowing fuses
  • masking
  • Sometimes erasable - EPROM
  • E2PROM electrically erasable

50
Example ROM
51
32 X 8 ROM Un-programmed
52
Programmed ROM
Consider the above truth table or program
Note that this is how your BIOS is programmed
53
Programmed ROM
Consider the above truth table or program
Note that A7 is 1 for combinations 0, 2, 3, 29
54
Programmed ROM
Note that A7 is 1 for combinations 0, 2, 3, 29
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
55
Views of ROM
  • Can be used to store program
  • BIOS of computer
  • Can be used as a combinational logic device

Note in previous example that A7 ?m (0, 2, 3,
29)
56
Example ROM Logic Implementation
  • Consider a circuit which inputs a 3-bit binary
    number and which generates a binary number equal
    to the square of that input number.

57
Example Truth Table
Note output is square of input
58
ROM Implementation
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
59
Views of ROM
  • PROM - fixed ANDs and programmable ORs
  • Used for sum of minterm implementations
  • Example A7 ? m (0, 2, 3, 29)
  • PAL - fixed ORs and programmable ANDs
  • Used for product of maxterm implementations
  • Example A7 ? M (1, 4, 5, 28, 30, 31)
  • PLA - both ORs and ANDs programmable

60
Configuration of PLD Devices
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
61
More Complex Devices
  • VLSI Programmable Devices
  • CPLDs - Complex programmable logic arrays
  • FPGAs - Field programmable gate arrays
  • Structure varies by manufacturer

62
Memory Hierarchy - Disks, etc.
63
Mass Storage Devices
  • Typically involve physical motion
  • Spin (disks) or slide (tape)
  • Usually magnetic - hard disk, tape
  • Sometimes optic - CDROM
  • Involve three time-variables
  • Seek time - to find track
  • Latency time - to rotate to start of track
  • Transfer time - to read/write data

64
Disk Structure
65
Typical Disk Layout
etc.
etc.
Typically tracks of data are buffered through a
disk cache
66
Disk Storage Devices
  • Transfer blocks of data or pages
  • uses buffer or cache
  • overlays blocks of main memory - pages
  • appears as virtual memory
  • Disk cache issues
  • thrashing - program flips back and forth between
    data on two different pages

67
Disk Cache Concepts
  • Disk cache issues
  • Thrashing
  • Virtual Memory
  • Pages - Memory Blocks
  • Page faults

68
Virtual Memory
Fig 7.20
69
Virtual Memory Mapping
Fig 7.21
70
Cache Memory
  • Fast memory
  • Resides between devices
  • Main memory and CPU
  • Hard disk and main memory (buffering of pages)
  • Sometimes between main memory and screen

71
Typical Memory Hierarchy
72
Multiple Cache Hierarchy
73
Cache Memory
74
Locality of Reference
  • When executing an instruction
  • Most other program instructions are local
  • Most instructions are sequential
  • Most data is local
  • Most data is stored together (array)
  • Key aspect of cache

75
Principle of Locality
  • Spatial locality - if we got word i from memory,
    there is a good chance that we will want word i1
    soon
  • Temporal locality - if we got word i once, then
    we will probably want it again, soon

76
Principle of Locality
  • Therefore, if we copy a block of words into cache
    when we need one (i i15), we will likely use
    several before we need to do another copy
  • Eventually, we will have several non-contiguous
    blocks of memory in cache

77
Example Cache Scheme
78
Direct Mapped Cache
Note address 00000 011
79
Direct Mapped Cache
mod 8 cache
upper 2 add bits become tag
Fig 7.3
80
Direct Mapped Cache
Fig 7.7
81
Fully Associative Cache
82
Cache Concepts
  • Cache hit - processor reads or writes data and
    finds it in cache
  • Cache miss - not in cache
  • must go back to main memory
  • get whole block in process
  • Data write
  • write-through (both cache memory)
  • write-back (only cache)

83
Cache Memory
84
Memory Speed - Cost
85
End of Set
Write a Comment
User Comments (0)
About PowerShow.com