20
CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, and Sirer.

CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

  • Upload
    others

  • View
    20

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

CS3410:ComputerSystemOrganizationandProgramming

AnneBracyComputerScienceCornellUniversity

The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, and Sirer.

Page 2: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

TheAnalyticalEngine• DesignedbyCharlesBabbagefrom1834–1871

• Consideredtobethefirstdigitalcomputer

• Builtfrommechanicalgears,whereeachgearrepresentedadiscretevalue(0-9)

• Babbagediedbeforeitwasfinished

2

http://history-computer.comhttp://wikimedia.com

Page 3: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

AlanTuringTuringMachine

1936=abstractmodelforCPUthatcansimulateanyalgorithm

3

Page 4: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

TheBombeusedbytheAlliestobreaktheGermanEnigmamachineduringWorldWarII

EnigmamachineUsedbytheGermansduringWorldWarIItoencryptandexchangesecretmessages

4

Page 5: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

ENIACElectronicNumerical

IntegratorAndComputer

5

1946JohnMauchlyJ.Presper Eckert

Page 6: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

Whoareyou?

“Sometimesitisthepeoplethatnooneimaginesanythingofwhodothethingsthatnoonecan

imagine.”– AlanTuring

• TuringAwardWinners?• EckertMauchly AwardWinners?

6

Page 7: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

CourseObjective• UnderstandtheHW/SWinterfacesoftware

§ Howaprocessorworks§ Howacomputerisorganized

• Establishafoundationforbuildingapplications§ Howtowriteagoodprogram

• Good=correct,fast,andsecure§ Howtounderstandwheretheworldisgoing

• Understandtechnology(past,present,future)

7

Page 8: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

Whatisthis?#include <stdio.h>

int main() {printf("Hello world!\n");return 0;

}

Howdoesitwork?I’mgladyouasked…15weekslaterandyou’llknow!“IknowKungFu.”

8

Page 9: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

Compilers&Assemblersint x = 10;x = 2 * x + 15;C

compiler

addi r5, r0, 10muli r5, r5, 2addi r5, r5, 15

MIPSassemblylanguage

001000000000010100000000000010100000000000000101001010000100000000100000101001010000000000001111

MIPSmachinelanguage

assembler

r0=0

r5=r0+10r5=r5*2r5=r5+15

op=addi r0r510

op=addi r5r5 15Everythingisanumber!9

Page 10: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

HowtoDesignaSimpleProcessor

10

memory

inst

32

pc

200

new pccalculation

register file

control

5 5 5

alu

00: addi r5, r0, 1004: muli r5, r5, 208: addi r5, r5, 15

r0r5

0

10

1032

Page 11: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

InstructionSetArchitecture(ISA)• abstractinterfacebetweenhardwareandthelowestlevelsoftware

• userportionoftheinstructionsetplustheoperatingsysteminterfacesusedbyapplicationprogrammers

11

Page 12: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

Overview

I/O systemInstr. Set Proc.

Compiler

OperatingSystem

Application

Digital DesignCircuit Design

Instruction SetArchitecture

Firmware

Memory system

Datapath & Control

12

Page 13: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

Compiler Firmware

Coveredinthiscourse

I/O systemCPU

OperatingSystem

Application

Digital DesignCircuit Design

Instruction SetArchitectureMemory

system

Datapath & Control

13

Page 14: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

Wherediditbegin?

• ElectricalSwitch§ On/Off§ Binary

• Transistor

ThefirsttransistoronaworkbenchatAT&TBellLabsin1947

Transistors 14

Page 15: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

Moore’sLaw• 1965

§ #oftransistorsintegratedonadiedoublesevery18-24months(i.e.,growsexponentiallywithtime)

• Amazinglyvisionary§ 2300transistors,1MHzclock(Intel4004)- 1971§ 16Milliontransistors(UltraSparc III)§ 42Milliontransistors,2GHzclock(IntelXeon)– 2001§ 55Milliontransistors,3GHz,130nmtechnology,250mm2 die(Intel

Pentium4)– 2004§ 290+Milliontransistors,3GHz(IntelCore2Duo)– 2007§ 721Milliontransistors,2GHz(Nehalem)- 2009§ 1.4Billiontransistors,3.4GHzIntelHaswell (Quadcore)– 2013

15

Page 16: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

16

Page 17: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

ProcessorPerformanceIncrease

SUN-4/260 MIPS M/120MIPS M2000

IBM RS6000

HP 9000/750DEC AXP/500

IBM POWER 100DEC Alpha 4/266

DEC Alpha 5/500DEC Alpha 21264/600DEC Alpha 5/300

DEC Alpha 21264A/667

Intel Xeon/2000

Intel Pentium 4/3000

17

Page 18: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

ThenandNow

• Intel Haswell• 1.4 billion transistors• 177 square millimeters• Four processing cores

http://techguru3d.com/4th-gen-intel-haswell-processors-architecture-and-lineup/

• The first transistor• One workbench at AT&T Bell Labs• 1947• Bardeen,Brattain,andShockley

What are we doing with all these transistors? 18

Page 19: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

ComputerSystemOrganization

19

Page 20: CS 3410: Computer System Organization and Programming · CS 3410: Computer System Organization and Programming Anne Bracy Computer Science Cornell University The slides are the product

ReflectWhytakethiscourse?• Basicknowledgeneededforall otherareasofCS:operatingsystems,compilers,...

• Levelsarenotindependenthardwaredesign↔softwaredesign↔performance

• Crossingboundariesishardbutimportantdevicedrivers

• Gooddesigntechniquesabstraction,layering,pipelining,parallelvs.serial,...

• Understandwheretheworldisgoing

TheMysteriesofComputingwillberevealed!20