28
CS222: Computer Organization and Architecture and Architecture Dr. A. Sahu Dept of Comp. Sc. & Engg. Dept of Comp. Sc. & Engg. Indian Institute of Technology Guwahati 1

CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

CS222: Computer Organization and Architectureand  Architecture

Dr. A. Sahu

Dept of Comp. Sc. & Engg.Dept of Comp. Sc. & Engg.

Indian Institute of Technology Guwahati

1

Page 2: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

OutlineOutline• Course Attendance Reference Book• Course, Attendance, Reference Book

• What do we study in this course?

• Why should this be studied?

• What is “Computer Architecture” ?• What is  Computer Architecture  ?

• How is the course structured?

2

Page 3: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

CS222 CourseCS222 Course

75% A d i M d• 75% Attendance is Mandatory 

• Manual  & Electronics Attendance Systemy

• 4 Programming assignment + 2 Take homeA ki d f C /Pl i i l d t `F’–Any kind of Copy/Plagiarism  lead to `F’ Grade

3

Page 4: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

CS222 CourseCS222 Course• Text Book

– Stalling W., Computer Organization & Architecture,  7th Edition, Pearson Education India, 2010

– Hamacher C. etal, Computer Organization, 5th

Edition, McGrawHill, 2002

• Reference Book– Henneyssy J. L., Patterson D., Computer Organization And Design: The Hardware/Software Interface, Morgan Kaufmann, 2008

4

Page 5: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

CS222 Course• Course website: http://jatinga iitg ernet in/~asahu/cs222/http://jatinga.iitg.ernet.in/ asahu/cs222/

• Mark distribution% i k– 15% : Assignment + Home work 

– 40% : Mid Semester

– 45% : End Semester

• Class Timing & Venue– Venue: 1201, Timing : Slot C 

– Mon:10‐11, Tue:11‐12, Thu:8‐9 Makeup Slot, Fri:9‐10

5

Page 6: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

CS222 Course ObjectivesCS222 Course Objectives

To learn ‐To learn • How computers work, basic principles• How to analyze their performance (or how not to!)

• How computers are designed and built• Issues affecting modern processorsIssues affecting modern processors (caches, pipelines, etc.)

6

Page 7: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

CS222 Course MotivationCS222 Course MotivationThis knowledge will be useful if you need to• design/build a new computer

– rare opportunity

• Design/build a new version of a computer• Improve software performancep p• Purchase a computer• Provide a solution with an embeddedProvide a solution with an embedded computer

7

Page 8: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

Course Pre requisiteCourse Pre requisite

• Require Knowledge of• Require Knowledge of –Digital Design Fundamental

–Data Structure and C/C++ Programming

–Basic 10+2 Standard 

• Probability and Mathematics

8

Page 9: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

What is “Computer Architecture”What is  Computer Architecture

Building architecture : Structural designBuilding architecture : Structural design(Civil Engg)

: :

Computer architecture : Circuit designComputer architecture : Circuit design(Electronics/CS Engg)

9

Page 10: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

AbstractionAbstraction• Delving into the depths reveals moreDelving into the depths reveals more information

• An abstraction omits unneeded detail, helps us cope with complexity

10

Page 11: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

Software Abstraction

0x401040 <sum>: 0x55

Software Abstraction 

int sum(int x, int y) 0x401040 <sum>: 0x550x890xe50 8b

( , y){int t = x+y;return t;

C

0x8b0x450x0c

return t;}

sum:0x030x450x08

_sum:pushl %ebpmovl %esp,%ebp

l 12(% b ) %

assembly

0x080x890xec0 5d

movl 12(%ebp),%eaxaddl 8(%ebp),%eaxmovl %ebp,%esp

0x5d0xc3

popl %ebpret

machinecode

11

Page 12: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

Hardware AbstractionHardware AbstractionRegister file

ALUCPU

System bus Memory bus

PC

MainmemorybridgeBus interface

I/O bus Expansion slots for

Disk controller

Graphicsadapter

USBcontroller

pother devices suchas network adapters

Mouse Keyboard DisplayDisk

12

Page 13: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

13

Page 14: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

14

Page 15: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

15

Page 16: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

16

Page 17: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

17

Page 18: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

18

Page 19: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

19

Page 20: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

Hardware/software interfaceHardware/software interface

software

C/C++

m/c instr our

reg, adder

ourfocus

hardware

transistors20

Page 21: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

Architecture levelsArchitecture levels• Instruction set architecture (ISA)Instruction set architecture (ISA)

–Lowest level visible to a programmer–Operation (add/sub/mul/shift)

• Micro architectureMicro architecture –Fills the gap between instructions and logic moduleslogic modules

–Operation Vs Micro Operation

21

Page 22: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

Instruction Set Architecture

• Assembly Language View Application

Instruction Set Architecture

• Assembly Language View

– Processor state (RF, mem)

Instruction set and encoding Compiler OS

pp cat oProgram

– Instruction set and encoding

• Layer of Abstraction

Ab h tISA

Compiler OS

– Above: how to program machine ‐ HLL, OS

Below: what needs to be built

CPUDesign

Circuit– Below: what needs to be built ‐ tricks to make it run fast

CircuitDesign

ChipChipLayout

22

Page 23: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

The Abstract MachineThe Abstract Machine

CPU MemoryAdd

PCRegisters Code + Data

Addresses

DataALUPC Instructions

StackCondition

Codes

ALU

•Programmer‐Visible State

–PC   Program Counter Memory–Register File

•Heavily used dataByte array

Code + data–Condition Codes stack

23

Page 24: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

Some realitiesSome realities• Int’s are not Integers, Float’s are not Realsg ,• You’ve got to know assembly

– Chances are, you’ll never write programs in assembly, but understanding assembly key to machine‐level execution model

• Memory Matters• Memory Matters– Memory is not unbounded– Memory performance is not uniformy p

• There’s more to performance than asymptotic complexity

24

Page 25: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

Embedded computersEmbedded computers

• Processor as an intelligent electronic• Processor as an intelligent electronic component rather than Processor as a computing engine

• Real time operation• Real time operation

• Requires hardware‐software co‐design• Highly customized

25

Page 26: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

Why different processors?Why different processors?

• What is the difference between processorsWhat is the difference between processors used in desk‐tops, lap‐tops, mobile phones, washing machines etc ?washing machines etc.?– Performance / speed

P i– Power consumption

– Cost

– General purpose / special purpose

– Domain Specific: Network, DSP, Image. Crypto

26

Page 27: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

27

Page 28: CS222: Computer Organization and ArchitectureCS222 Course • Text Book – Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010 – HamacherC

Topics to be coveredTopics to be covered

• Performance issues• A specific instruction set architecture• Arithmetic and how  to build an ALU• Constructing a processor to execute instructions

• Pipelining to improve performance• Memory:  caches and virtual memory• Input / output

28