Memory Systems Slides Created By Kevin Ulin. What is Main Memory? 1) Sometimes called primary memory...

Preview:

Citation preview

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 to other commands and values.

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

Implementations (Old)

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

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

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

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

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

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

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

Main Memory Address Handling Techniques

1) Simple Static Addresses

2) Relative Addresses

3) Relocation Register

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

Uniprogramming

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.

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)

Multiprogramming

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’

Timesharing

A multiprogramming system Each program given control short periods

of timeTimesliceOnly MillisecondsRegular Intervals

Issue with Multiprogramming

Programs will start and end at different times

Programs will need various sized blocks of memory

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.

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.

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.

What’s Next?

Virtual Memory Cache Memory

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)

Recommended