33
ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization and Design, 4 th edition, Patterson and Hennessy, and classes taught by Patterson at Berkeley, Ryan Kastner at UCSB and Mary Jane Irwin at Penn State

ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

ECE 15B Computer OrganizationSpring 2011

Dmitri Strukov

Lecture 1: Introduction

Partially adapted from Computer Organization and Design, 4th edition, Patterson and Hennessy, and classes taught by Patterson at Berkeley, Ryan Kastner at UCSB and Mary Jane Irwin at Penn State

Page 2: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Course Logistics : InstructorCourse Logistics : Instructor

Dmitri Strukov [email protected]

Office :  HFH 5153

Office hours:       Wednesday 3:00 – 5:00 pm  or by appointment

l h d l liplease see my schedule online http://www.ece.ucsb.edu/~strukov/DmitriWebPage_files/calendar.htm

ECE 15B Spring 2011

Page 3: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Course Logistics : TAsCourse Logistics : TAs

Sam Masooman  [email protected] hours: Phelps 1435, Available time slots: Thursday 12:30 am 1:30 pmAvailable time slots: Thursday 12:30 am ‐1:30 pmDiscussion session: Girvetz Hall 2119, Monday 5:00‐5:50 pm

Jian Zhen [email protected] h ECI L b ( ill i )Office hours: ECI Lab (still tentative)Available time slots: Friday 10:00 am – 11:00 amDiscussion session: Phelps 1448, Friday 9:00‐9:50 pmDiscussion session: Phelps 1448, Friday 9:00 9:50 pm

ECE 15B Spring 2011 

Page 4: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Course Logistics: MaterialCourse Logistics: Material

• URL– http://www.ece.ucsb.edu/~strukov/ece15bSpring201

1/ECE15bSpring2011.htm

• Software: MIPS‐32bit simulator (“SPIM”)– Both software and documentation available online forBoth software and documentation available online for 

free– Can be installed on any common platform– See instructions on web for MACs– Try to install that software early 

ECE 15B Spring 2011 

Page 5: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Course Logistics: TextbooksCourse Logistics: Textbooks

• Required: Computer Organization and Design: The• Required: Computer Organization and Design: The Hardware/Software Interface, Fourth Edition, Patterson and Hennessy (COD). The third edition is also accepted.

• Recommended: MIPS Assembly Language Programming, Robert L. Britton, 2003.

• Additional (not required): The C Programming Language, Kernighan and Ritchie (K&R), 2nd edition

• C language manual webpage from Stanford University  

• UCSB book store should have them all

ECE 15B Spring 2011 

Page 6: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Course Logistics: GradingCourse Logistics: Grading

• Homework Assignments (excluding HW #0):Homework Assignments (excluding HW #0): 10%

• Projects: 20%• Projects:  20%

• Quiz 1: 15%

• Quiz 2: 15%

• Final:  40%

• Class Participation: 5%– Attendance & discussion in class– Attendance & discussion in class

ECE 15B Spring 2011 

Page 7: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Course Logistics: Approximate Schedule

• Approximate schedule on class syllabusApproximate schedule on class syllabus– 1 hw/project/quiz per week

Hw/projects typically due Fridays at 11:00 pm in– Hw/projects typically due Fridays at 11:00 pm in HFH, 3rd floor (box labeled ECE15B)

• Last year lecture viewgraphs will be replaced• Last year lecture viewgraphs will be replaced with newest one on the day of lecture

H j d i i d l i ill b• Hw, projects description, and solutions will be posted on the web

(HW#0 already online)ECE 15B Spring 2011 

Page 8: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Course Logistics: Approximate ScheduleCourse introduction  1Overview of computer organization (hw)  1Arithmetic instructions  1Data transfer instructions 1Control flow instructions  1Logic/shift/overflow  1 Procedures 2Procedures  2 Instruction representation  1Memory addressing modes  1Floating point arithmetic 1Floating point arithmetic  1Pointers and arrays   1 String, lists, stacks  1Memory management  2y gCompiling, assembling, linking and loading  1History of computing   1 Final review  1 In class quiz  2 

ECE 15B Spring 2011 

Page 9: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Key milestones in semiconductor i d t d t tindustry and computer systems

• 1946 First digital electronic programmable• 1946 First digital electronic programmable computer by John Mauchy and J.P. Eckert (UPenn) ,  ENIAC (1,800 sq ft, 18,000 vacuum tubes, 50 tones( , q , , ,

• 1954 First silicon transistor by TI

• 1958 First integrated circuit by Jack Kilby by TI

• 1971 First (single chip) microprocessor – Intel 4004 by Ted Hoff and others, 10‐um, 2300 transistors

• 2006 Intel Core 2 Duo

now 45 nm, up to 1 billion transistors

ECE 15B Spring 2011 

Page 10: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Technology and scaling

ECE 15B Spring 2011 

Page 11: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Technology Scaling Road Map (ITRS)

Year 2004 2006 2008 2010 2012

Feature size (nm) 90 65 45 32 22

Intg Capacity (BT) 2 4 6 16 32Intg. Capacity (BT) 2 4 6 16 32

Page 12: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Gordon MooreIntel CofounderB.S. Cal 1950!.S. Ca 950!

Page 13: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

ECE 15B Spring 2011 Source: Prof. N Cheung, UCB

Page 14: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Average price per transistor (source: Intel) 

ECE 15B Spring 2011 Source: Moore’s law at Forty, Chapter 7 from Understanding Moore’s Law: Four decades of Innovation, Edited by David C. Brock, 2006

Page 15: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

ECE 15B Spring 2011 Source: Prof. N Cheung, UCB

Page 16: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

More fun facts about semiconductor industryMore fun facts about semiconductor industry

30 illi fit th h d f i– 30 million can fit on the head of a pin– You could fit more than 2,000 across the width of a human hairhuman hair

– If car prices had fallen at the same rate as the price of a single transistor has since 1968, a new car gtoday would cost about 1 cent

– More transistor produced each year than the b f i f i l b llnumber of grains of rice globally

ECE 15B Spring 2011 

Page 17: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Technology Trends: Uniprocessor Performance (SPECint)Uniprocessor Performance (SPECint)

0)

3X“Sea change” in chip design: multiple “cores”

1 52x/year

1.20x/year

‐11/78

0 design: multiple cores or processors per chip

1.52x/year

(vs. VAX

1.25x/year

rman

ce (

• VAX : 1 25x/year 1978 to 1986

Perfor

VAX : 1.25x/year 1978 to 1986• RISC + x86: 1.52x/year 1986 to 2002• RISC + x86: 1.20x/year 2002 to presentECE 15B Spring 2011 

Page 18: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

ECE 15B Spring 2011 

Page 19: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Other computing platforms (why not everything from silicon are(why not everything from silicon are 

microprocessors?)I l NRE tInvolves NRE cost

Cost Nonrecurring engineering cost/volume + Production cost

ECE 15B Spring 2011 

Cost  =   Nonrecurring engineering cost/volume + Production costProduction cost        =   (1+Defect density * Area/ alpha) alpha, where alpha = 1 to 5

Page 20: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Other computing platforms ( h h )(why not everything microprocessors?)

μPmanufacturing cost (at small volumes)

ASIC

performance

Market size:‐ Semiconductor industry >$1000B‐Microprocessor (w embedded) > $100BMicroprocessor (w. embedded) > $100BFor comparison: USA GDP ~ $14000B (24% of worlds total) 

Page 21: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Other computing platforms ( h h )(why not everything microprocessors?)

FPGA

μPmanufacturing cost (at small volumes)

ASIC

FPGA

GPU

performance

Page 22: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Layers of AbstractionsLayers of Abstractions

Application (ex: browser)

CompilerOperatingSystem(Mac OSX)Software Assembler

I/O systemProcessorInstruction SetArchitecture

Datapath & Control 

MemoryHardware

Digital Design

Circuit Design

p

transistors

Computation is implemented using 

ECE 15B Spring 2011 

p p gmany layers of abstractions – WHY?

Page 23: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Layers of Abstraction

A li ti ( b )

This class is aboutthis region

CompilerOperatingSystem(Mac OSX)

Application (ex: browser)

f

this region

I/O systemProcessor

(Mac OSX)

Instruction SetArchitectureMemoryHardware

Software Assembler

Digital Design

Circuit Design

Datapath & Control 

transistors

Need Many Layers to Handle ComplexityECE 15B Spring 2011 

Page 24: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Below the Program• High‐level language program (in C)

swap (int v[], int k)(int temp;

temp = v[k];v[k] = v[k+1];v[k+1] = temp;

) C compiler

one‐to‐many

• Assembly language program (for MIPS)swap: sll $2, $5, 2

add $2, $4, $2$ , $ , $lw $15, 0($2)lw $16, 4($2)sw $16, 0($2)sw $15, 4($2)j $31

one‐to‐one

jr $31

• Machine (object, binary) code (for MIPS)000000 00000 00101 0001000010000000

assembler

000000 00100 00010 0001000000100000. . .

ECE 15B Spring 2011

Page 25: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Below the Programtemp = v[k];

$ ($ )

High Level Language Program (e.g., C)

Compiler

temp = v[k];

v[k] = v[k+1];

v[k+1] = temp;

lw $t0, 0($2)lw $t1, 4($2)sw $t1, 0($2)sw $t0, 4($2)

Assembly  Language Program (e.g.,MIPS)

Compiler

AssemblerMachine  Language 

Program (MIPS)

Assembler

Machine

0000 1001 1100 0110 1010 1111 0101 10001010 1111 0101 1000 0000 1001 1100 0110 1100 0110 1010 1111 0101 1000 0000 1001 0101 1000 0000 1001 1100 0110 1010 1111

Hardware Architecture Description (e.g., block diagrams)

Machine Interpretation

0101 1000 0000 1001 1100 0110 1010 1111

g )

Architecture Implementation

Logic Circuit Description(Circuit Schematic Diagrams)

Page 26: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

ECE 15B: So what’s in it for me?ECE 15B: So what s in it for me?

• Learning computer systems from aLearning computer systems from a programmer’s point of view– What the programmer writes– What the programmer writes

– How it is converted to something the computer understandsunderstands

– How computer interprets the program

What makes programs go slow– What makes programs go slow

ECE 15B Spring 2011 

Page 27: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

The Rise of Embedded ComputersIn millions 

Intel Atom, ~ 50 M Tran.

Population 6.4B in 2004, i.e. ~ 1PC, 2.2 cell phones, and 2.5 televisions for every 8 people on the planet ECE 15B Spring 2011 

Page 28: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

Advantages of Higher‐Level Languages ?h l l l• Higher‐level languages

Allow the programmer to think in a more natural language and for their intended use (Fortran for scientific computation, Cobol for b i i Li f b l i l ti J f bbusiness programming, Lisp for symbol manipulation, Java for web programming, …)

Improve programmer productivity – more understandable code that is easier to debug and validatethat is easier to debug and validate

Improve program maintainability

Allow programs to be independent of the computer on which they are developed (compilers and assemblers can translate high levelare developed (compilers and assemblers can translate high‐level language programs to the binary instructions of any machine)

Emergence of optimizing compilers that produce very efficient assembly code optimized for the target machine

• As a result, very little programming is done 

assembly code optimized for the target machine

today at the assembler levelECE 15B Spring 2011 

Page 29: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

ECE 15B: So what’s in it for me?ECE 15B: So what s in it for me?

• Learn big ideas in computer engineeringLearn big ideas in computer engineering– Principle of abstraction used to build systems as layers

– 5 classic components of a computer– Data can be anything (integers, floating point, characters): program determines what it is

– Stored program concept: instructions just dataP i i l f l li l i d i– Principle of locality, exploited via memory hierarchy

– Greater performance by exploiting parallelism– Greater performance by exploiting parallelism

ECE 15B Spring 2011 

Page 30: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

ECE 15B: can also help youECE 15B: can also help you

• Assembly Language Programmingy g g g g– This is a skill you will pick up as a side effect of understanding big ideas

• Hardware Design• Hardware Design– Hardware at the abstract level with only a little bit of physical implementation details to give perspective

• Understand Language Concept– If you know one, you should be able to learn another “low” level programming language on your ownlow  level programming language on your own

– C constructs used in many other “higher” level programming languages

ECE 15B Spring 2011 

Page 31: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

ECE 15B: Does Not TeachECE 15B: Does Not Teach

• A specific assembler languagespec c asse b e a guage– 486 instruction set– ARM instruction set (i.e. Apple A5 processor with ARM Cortex‐A9 in iPad2, or iPhone) 

– PowerPC  instruction set

B t h l i h d ti ll• Because technologies change so dramatically – Learning the concepts is more important that learning the languagethe language

– Learning abstract ideas is more important that learning the specific features

ECE 15B Spring 2011 

Page 32: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

My Own Background...

MMT Simulator

• Features– Assembler & Debug

C l i l i– Cycle‐accurate simulation 

– GUI and Script support

– Detailed statistics including runtime conflictsruntime conflicts

• Implementation– C  ‐ 35 K lines of code

– TCL ‐ 7 K lines of code

ECE 15B Spring 2011 

Memory latency reduction with fine‐grain migrating threads in NUMA shared‐memory multiprocessors” (with M. Dorojevets) in: Proc.  PDCS’02, Cambridge, MA, Nov. 2002, pp. 762‐767

Page 33: ECE 15B Spring 2011 › ~strukov › ece15bSpring2011 › ...ECE 15B Computer Organization Spring 2011 Dmitri Strukov Lecture 1: Introduction Partially adapted from Computer Organization

SummarySummary

• Continued rapid improvement in computingContinued rapid improvement in computing– May end up soon but new paradigms and concept will likely inherit a lot from traditional computerwill likely inherit a lot from traditional computer implantation, e.g. multi core

• Hardware/software interface is important layer in the hierarchy to understand howlayer in the hierarchy to understand how computing is implemented

ECE 15B Spring 2011