24
What’s inside your computer? Session 3 Peter Henderson [email protected] 1

What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

What’s inside your computer?Session 3

Peter [email protected]

1

Presenter
Presentation Notes
- Show the memory youtube clip NOW (about 5 minutes)
Page 2: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

Time & Space/Size & Speed• Time – How long does it take to do

something? (retrieve data from memory, execute a computer instruction, send msg NY to LA, etc)

• Space/Size – How much space does something take? (Moore’s Law) How big? (500 megabytes DRAM memory, 1 TB hard drive)

• Speed – How fast can something be achieved? (1 gigahertz CPU, speed of DRAM or hard drive, execute an algorithm)

2

Presenter
Presentation Notes
Might take 20 nanosecond to retrieve a byte (8 bits) from DRAM, algorithm – sort in alphabetical order all the CWA participants
Page 3: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

3

VIDEO Computer Memory1. DRAM & SRAM

2. Hard drive

3. Optical (CD/DVD)

4. Flash Drive & SSD

Page 4: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

TimeMillisecond 1/1,000 (stopwatch accuracy)

Microsecond 1/1,000,000 Nanosecond 1/1,000,000,000Picosecond 1/1,000,000,000,000- Sound travels 1.3 milliseconds per mile

- Light travels 5.38 microseconds per mile- Electric pulse thru wire 3.5 micro sec per mile- Hard drive average seek time 5 to 10 milli sec- DRAM (modern) access time is ~15 nano sec- SRAM read or write time is ~1 to 5 nano sec

Latency - time delay between the cause and the effect 4

Presenter
Presentation Notes
Modern Hard drive transfer rate is about 6 gig bits per second
Page 5: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

Space/Size

• Physical space – How many transistors in 1 square centimeter on a chip? Density!!

(Moore’s Law)

• Conceptual Space/Size – How many bits in a byte?– How many data values can one byte represent?

0000 0000, 0000 0001, …, 1111 1111– How many bytes are there in 1 gigabyte of

RAM memory? 5

Presenter
Presentation Notes
Density – Moore’s law, 256 = 2^8, 1,000,000,000 or 1000 million (Answer is NO)
Page 6: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

Space/size

One ‘thing’Kilo - One thousand ‘things’Mega - One million ‘things’Giga – One billion ‘things’Tera – One thousand billion ‘things’Peta – One thousand thousand billion ‘things’

The fastest supercomputer in 2016 is China’s Sunway TaihuLight running at 93 Peta FLOPS

6

Presenter
Presentation Notes
FLOPS : FLOating Point Operations Per Second.
Page 7: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

Computer Memory – a simple visual model

7

Memory Addresses: 0, 1, 2, 3, 4, etc

In modern computers each memory addressidentifies one Byte (8 bits) of memory storage

Here the value 7 is stored in memory address 13( in binary 7 is 0000 0111 )

Random access means the CPU can ‘access’ any bytedirectly, retrieve(read) or store(write)

A 32/64 bit computer reads/writes 4/8 bytes at a time – # bits used to represent integer data values

A Gigabyte is 1,073,741,824 (230) bytes

Presenter
Presentation Notes
Exercise – fill in this memory with the ASCII character ‘H’ in memory address 0 ( 0100 1000 ) Next, the ASCII character ‘e’ in memory address 1 ( 0110 0101 ) Complete this by filling in the sequence of characters ‘Hello!’ starting at address 0 Called a ‘string’ of characters!!
Page 8: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

Data and Instructions are stored in memory as sequences of bits

Integers: 0, +235, -19087 [ 32 or 64 bits ]Characters: ASCII or Unicode [ 8 or 16 bits ]Strings: Sequence of characters (eg, Hello!)Decimal: 23.467, -876.3453 [ 32 or 64 bits ]Floating Point: scientific notation

6.563092 x 1015

32 bits single precision - ~7 decimal place accuracy 64 bits double precision - ~16 decimal place

8

Presenter
Presentation Notes
32 bit computer VS 64 bit computer Decimal places is the accuracy
Page 9: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

2016 China's 'Sunway-TaihuLight' is world's fastest supercomputer 7th year in a row

9

The fastest supercomputer running at 93 Peta FLOPS. One thousand billion Floating Point Operations Per Second

Page 10: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

10

Hierarchy of memory in a modern stored program computer

‘Registers’ – temporary storageStatic RAM – SRAM

Super high speed transistors

Cache Memory – SRAM Very high speed transistors

(Associative Memory)

A 32 bit computer might have 32, 32 bit registers R0, R1, …, R31

Dynamic Random AccessMemory (DRAM) Up to 32 Giga Bytes

Several kilobytes to several megabytes

Up to one Terabyte

Up to 10 Terabytes

Instructions & Data Locality

Faster Memory

Handout full page

Presenter
Presentation Notes
Typical 64 bit computer has 64 64 bit registers (SRAM) Permanent vs non-permanent data Memory speed vs memory cost Associative memory searches by content/context rather than individual addresses Talk about speeding things up using parallism (while CPU is doing an operation, North Bridge transfers information to/from physical memory (RAM) to/from CPU Cache AND South Bridge transfers information from Hard Drive and other I/O devices to/from physical memory (RAM)
Page 11: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

11

Microprocessor CPU – Intel Pentium

Presenter
Presentation Notes
64 bit processor, many electrical pin connectors, address lines, data lines, control lines, electric power, etc.
Page 12: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

Main Memory – DRAM

12

8 one bit DRAM chips9 one bit DRAM chips – error detecting using parity check12 one bit DRAM chips – Error Correcting Code [ ECC ]

Presenter
Presentation Notes
Notice there are 8 DRAM chips, each accesses one bit (8 for a byte). Some may have one more (parity check) or 3 more (error correcting code [ECC] )
Page 13: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

13

Registers –super high speed local temporary memory

Cache - very high speed memory

Instruction Decoder –logic circuits

Presenter
Presentation Notes
Add registers and cache to this picture SRAM (Static RAM). Reference previous slide of hierarchy
Page 14: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

14

Expanded view of CPU – Cache memory not shown

Presenter
Presentation Notes
Registers are SRAM – fast. They can store instructions, data, results & memory addresses. Internal data bus moves data (memory addresses and data to be processed) inside the CPU .
Page 15: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

15

564386

Execution of one computer instruction (every CPU has an ‘instruction set’)

Presenter
Presentation Notes
Instruction is a sequence of bits, 0’s and 1’s which specify an action the CPU does. Every CPU has an “instruction set”
Page 16: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

Example of the operation of the CPU (sequence of computer instructions)

Compute:TemporaryValue1 F - 32

The value of TemporaryValue1 becomes the value of F - 32

FORTRAN – FORmula TRANslation Programming Language

TemporaryValue1 = F - 32

16

Presenter
Presentation Notes
X, Y and Z are symbols representing Integer values, a simple algorithm for computing the value of X given the values of Y and Z.
Page 17: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

Sequence of instructions the CPU ‘executes’ for this subtraction

17

1.Get the value of F from memory and write it down

2.Get the value 32 from memory and write it down

3.Subtract the value 32 from F, write down the result

4.Update the value of TemporaryValue1 in memory with the value of the result

Here, “write it down” & “write down result” means put the value into one of the registers in the CPU

Presenter
Presentation Notes
Move slowly from the sequence of instructions understood by humans, to one used by the computer (binary)
Page 18: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

Sequence of CPU instructions the CPU ‘Executes’ using the model of memory shown

on the handout – RAM & registers

18

1. Load value from memory address 53 into R3LOAD R3 with value in MA 53

2. Load value from memory address 86 into R5LOAD R5 with value of MA 86

3. Subtract R5 from R3 storing result in R3SUBTRACT R3, R5

4. Store R3 into memory address 55STORE R3 in MA 55

Presenter
Presentation Notes
Handout showing memory, registers, and instructions
Page 19: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

19Result Bus Memory Data Bus

Subtraction Operation R3 <- R3-R5 in the CPU

Presenter
Presentation Notes
While CPU is executing this operation, the computer is doing other things, like transferring info between (to/from) the CPU and RAM (North Bridge), AND South bridge between I/O devices and RAM
Page 20: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

So far the model shown includes data stored in memory; what is missing?Hint: Stored Program Computer

20

Presenter
Presentation Notes
Instructions stored in memory !!
Page 21: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

Store this sequence of CPU instructions in main memory (RAM) starting at byte address 11

21

Addresses Instruction # bytes

11 & 12 LOAD R3 with value of MA 53 2

13 & 14 LOAD R5 with value of MA 86 2

15 SUBTRACT R3, R5 1

16 & 17 STORE R3 value into MA 53 2

18 STOP or HALT

Presenter
Presentation Notes
LOAD, ADD and STORE are machine instructions understood by the CPU, STOP is a new instruction which halts the computation, total of 4 instructions
Page 22: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

22

Page 23: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

23

VIDEO CPU

Fetch/Decode/Execute cycle

for a simple addition X <- a + b

Page 24: What’s inside your computer? Session 3...Picosecond 1/1,000,000,000,000-Sound travels 1.3 milliseconds per mile- ... Here the value 7 is stored in memory address 13 ( in binary 7

24