30
Memory Systems Slides Created By Kevin Ulin

Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Embed Size (px)

Citation preview

Page 1: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Memory Systems

Slides Created By Kevin Ulin

Page 2: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

What is Main Memory?

1) Sometimes called primary memory

2) Stores machine instructions for the CPU

3) Stores addresses to other commands and values.

Page 3: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Primary vs. Secondary

Primary active data typically volatile fast usable as secondary

memory RAM

Secondary stored data typically non-volatile not as fast as primary hard disk

Page 4: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Implementations (Old)

Williams-Kilburn Tubecathode ray tubemeasure electrical charges at points on tubeunreliable

Drumpaper tape/punchcardsdrum rotated while row of heads wait for data

Page 5: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores
Page 6: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Implementations (Old)

Delay Line Memorymercury with piezo crystal transducersmercury has similar pressure/velocity ratios of

piezo crystalsmercury kept at 40 degrees Celsius later moved on to wires which twisted when it

received a bit

Page 7: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores
Page 8: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Implementations (Old)

Core Memory (1949 An Wang) ceramic rings hold magnetic field hand crafted Wires running through each ring (x, y, sensor)

Twistor Memory (late 1960’s Bell Labs) similar to core involved wrapping magnetic tape around wires

Bubble Memory (1970s Andrew Bobeck) tape that held magnetized areas called “bubbles” stored data even when power was removed

Page 9: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores
Page 10: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Implementations (Current)

Integrated Circuits RAM (Random Access Memory)

content accessed in any order flip-flop (SRAM)

maintains information as long as there is power capacitor (DRAM)

needs to be refreshed (leakage) ROM (Read Only Memory)

difficult to write to maintains information after losing power closely resembles hardware ex: BIOS

Page 11: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores
Page 12: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Addresses

Static addresses determined at assembly time (globals and static locals)

Relative addresses cannot be determined at assembly time (stacks)

Addresses might be changed during execution

Page 13: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Main Memory’s Purpose/Goals

CPU Retrieves information from Main Memory

Main Memory must be well designed to prevent CPU from becoming idle.

Maintain memory addresses efficiently Must be fast and not put too much pressure

on the CPU to manage and maintain it

Page 14: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Main Memory Address Handling Techniques

1) Simple Static Addresses

2) Relative Addresses

3) Relocation Register

Page 15: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Memory Systems “Multiprogramming”

Multiple programs in memory at one time

When one program is waiting (typically IO), another is running

“Uniprogramming” One program in

memory at one time When the one

program is waiting, the CPU is wasted

Page 16: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Uniprogramming

Page 17: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Static Address

Memory is composed of addresses. If we simply define the addresses for each

command in memory, one inescapable problem arises. Conflicts in memory. Two Programs could fight for a location.

Page 18: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Propagation of Addresses

When defining a program you can specify relative addresses for each of the statements.Header contains relative addressesUpside: You can start the program at any

point in memory.Downside: Program cannot be moved once

started. (Variables may contain addresses)

Page 19: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Multiprogramming

Page 20: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores
Page 21: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

CPU-I/O Overlap

When one program is waiting for input, the CPU runs another

Separate Input ProcessorDirect Memory Access (DMA)Cycle Stealing

Because both DMA and CPU use Main Memory, DMA’s use is called ‘Cycle Stealing’

Page 22: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Timesharing

A multiprogramming system Each program given control short periods

of timeTimesliceOnly MillisecondsRegular Intervals

Page 23: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Issue with Multiprogramming

Programs will start and end at different times

Programs will need various sized blocks of memory

Page 24: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores
Page 25: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Relocation Register

‘Logical Address’ goes to an adder, then to memory (Dynamic Address Translation)

Register is initially set with load point of program Ex: You load a program at a load point of 200 into

memory, at the same time the relocation register receives the value 200.

Page 26: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Relocation Register (Cont.)

The program is stored as if it were at address 0.

Whenever a logical address is used, the relocation register’s value is added to the logical address, giving the true (physical) address.

Page 27: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores
Page 28: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

Relocation Register (Cont.)

Prevents memory fragmentation by allowing entire programs to be moved in memory by only changing the register’s value. (In addition to the actual move)

Speed cost is very high due to copying entire program.

Page 29: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

What’s Next?

Virtual Memory Cache Memory

Page 30: Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory 2) Stores machine instructions for the CPU 3) Stores

References

Assembly Language And Computer Architecture using c++ and Java by Anthony J. Dos Reis

www.wikipedia.com www.columbia.edu (images) www.vintagecalculators.com (images) www.cedmagic.com (images) www.zdnet.com (images)