Docsity

Computer Systems: A Programmer's Perspective - Memory Hierarchies and Caching, Study notes of Geometry

Partial preview of the text

Download Computer Systems: A Programmer's Perspective - Memory Hierarchies and Caching and more Study notes Geometry in PDF only on Docsity!

The Memory Hierarchy

15-­‐213: Introduc;on to Computer Systems

11 th^ Lecture, Oct. 6, 2015

Instructors:

Randal E. Bryant and David R. O’Hallaron

Today

¢ Storage technologies and trends

¢ Locality of reference

¢ Caching in the memory hierarchy

SRAM vs DRAM Summary

Trans. Access Needs Needs

per bit time refresh? EDC? Cost Applications

SRAM 4 or 6 1X No Maybe 100x Cache memories

DRAM 1 10X Yes Yes 1X Main memories,

frame buffers

NonvolaCle Memories

¢ DRAM and SRAM are volaCle memories

§ Lose informa;on if powered off.

¢ NonvolaCle memories retain value even if powered off

§ Read-­‐only memory (ROM): programmed during produc;on

§ Programmable ROM (PROM): can be programmed once

§ Eraseable PROM (EPROM): can be bulk erased (UV, X-­‐Ray)

§ Electrically eraseable PROM (EEPROM): electronic erase capability

§ Flash memory: EEPROMs. with par;al (block-­‐level) erase capability

§ Wears out aZer about 100,000 erasings

¢ Uses for NonvolaCle Memories

§ Firmware programs stored in a ROM (BIOS, controllers for disks,

network cards, graphics accelerators, security subsystems,…)

§ Solid state disks (replace rota;ng disks in thumb drives, smart

phones, mp3 players, tablets, laptops,…)

§ Disk caches

Memory Read TransacCon (1)

¢ CPU places address A on the memory bus.

ALU

Register file

Bus interface

A

x A

Main memory I/O bridge

%rax

Load operation: movq A, %rax

Memory Read TransacCon (2)

¢ Main memory reads A from the memory bus, retrieves

word x, and places it on the bus.

ALU

Register file

Bus interface

x^0

x A

Main memory

%rax

I/O bridge

Load operation: movq A, %rax

Memory Write TransacCon (1)

¢ CPU places address A on bus. Main memory reads it and

waits for the corresponding data word to arrive.

y

ALU

Register file

Bus interface

A

Main memory 0

A

%rax

I/O bridge

Store operation: movq %rax, A

Memory Write TransacCon (2)

¢ CPU places data word y on the bus.

y

ALU

Register file

Bus interface

y

Main memory 0

A

%rax

I/O bridge

Store operation: movq %rax, A

What’s Inside A Disk Drive?

Spindle

Arm

Actuator

Platters

Electronics

(including a

processor

and memory!)

SCSI

connector

Image courtesy of Seagate Technology

Disk Geometry

¢ Disks consist of plaXers, each with two surfaces.

¢ Each surface consists of concentric rings called tracks.

¢ Each track consists of sectors separated by gaps.

Spindle

Surface

Tracks

Track k

Sectors

Gaps

Disk Capacity

¢ Capacity: maximum number of bits that can be stored.

§ Vendors express capacity in units of gigabytes (GB), where

1 GB = 10^9 Bytes.

¢ Capacity is determined by these technology factors:

§ Recording density (bits/in): number of bits that can be squeezed

into a 1 inch segment of a track.

§ Track density (tracks/in): number of tracks that can be squeezed

into a 1 inch radial segment.

§ Areal density (bits/in2): product of recording and track density.

Recording zones

¢ Modern disks parCCon tracks

into disjoint subsets called

recording zones

§ Each track in a zone has the same

number of sectors, determined

by the circumference of

innermost track.

§ Each zone has a different number

of sectors/track, outer zones

have more sectors/track than

inner zones.

§ So we use average number of

sectors/track when compu;ng

capacity.

Spindle

Disk OperaCon (Single-­‐PlaXer View)

The disk surface spins at a fixed rotational rate

By moving radially, the arm can position the read/write head over any track.

The read/write head is attached to the end of the arm and flies over the disk surface on a thin cushion of air.

spindle spindle

spindle

spindlespindle

Disk OperaCon (MulC-­‐PlaXer View)

Arm

Read/write heads move in unison from cylinder to cylinder

Spindle