You are on page 1of 28

CS222:ComputerOrganization

and Architecture
andArchitecture

Dr.A.Sahu
Dept of Comp. Sc. & Engg.
DeptofComp.Sc.&Engg.
IndianInstituteofTechnologyGuwahati
1

Outline

Course,Attendance,ReferenceBook
Course
Attendance Reference Book
Whatdowestudyinthiscourse?
Whyshouldthisbestudied?
What is Computer
Whatis
ComputerArchitecture
Architecture??
Howisthecoursestructured?

CS222 Course
CS222Course
75%AttendanceisMandatory
75% A
d
i M d
Manual&ElectronicsAttendanceSystem
y
4Programmingassignment+2Takehome
AnykindofCopy/Plagiarismleadto`F
A ki d f C
/Pl i i
l d t `F
Grade

CS222 Course
CS222Course
TextBook
StallingW.,ComputerOrganization&Architecture,
7th Edition,PearsonEducationIndia,2010
Hamacher C.etal,ComputerOrganization,5th
Edition,McGrawHill,2002

ReferenceBook
Henneyssy J.L.,PattersonD.,Computer
OrganizationAndDesign:TheHardware/Software
Interface,MorganKaufmann,2008
4

CS222Course
Coursewebsite:
http://jatinga iitg ernet in/~asahu/cs222/
http://jatinga.iitg.ernet.in/
asahu/cs222/
Markdistribution
15%:Assignment+Homework
%
i
k
40%:MidSemester
45%:EndSemester

ClassTiming&Venue
Venue:1201,Timing:SlotC
Mon:1011,Tue:1112,Thu:89MakeupSlot,Fri:910
5

CS222 Course Objectives


CS222CourseObjectives
To learn
Tolearn
Howcomputerswork,basicprinciples
Howtoanalyzetheirperformance(or
hownotto!)
Howcomputersaredesignedandbuilt
Issuesaffectingmodernprocessors
Issues affecting modern processors
(caches,pipelines,etc.)
6

CS222 Course Motivation


CS222CourseMotivation
Thisknowledgewillbeusefulifyouneedto
design/buildanewcomputer
rareopportunity

Design/buildanewversionofacomputer
Improvesoftwareperformance
p
p
Purchaseacomputer
Provide a solution with an embedded
Provideasolutionwithanembedded
computer
7

Course Pre requisite


CoursePrerequisite
Require Knowledgeof
Knowledge of
DigitalDesignFundamental
DataStructureandC/C++Programming
Basic10+2Standard
ProbabilityandMathematics

What is Computer
Whatis
ComputerArchitecture
Architecture
Buildingarchitecture
Building
architecture : Structuraldesign
Structural design
(CivilEngg)

::
Computerarchitecture
Computer
architecture : Circuitdesign
Circuit design
(Electronics/CSEngg)
9

Abstraction
Delving
Delvingintothedepthsrevealsmore
into the depths reveals more
information
Anabstractionomitsunneededdetail,
helpsuscopewithcomplexity

10

Software
Abstraction
SoftwareAbstraction
intsum(intx,inty)
(
,
y)
{
intt=x+y;
return t;
returnt;
}

_sum:
sum:
assembly
pushl%ebp
movl%esp,%ebp
movl12(%ebp),%eax
l 12(% b ) %
addl8(%ebp),%eax
movl%ebp,%esp
popl%ebp
ret

0x401040 <sum>:
0x401040<sum>:

machine
code

0x55
0x89
0xe5
0 8b
0x8b
0x45
0x0c
0x03
0x45
0x08
0x89
0xec
0 5d
0x5d
0xc3

11

Hardware Abstraction
HardwareAbstraction
Register file
CPU

PC

ALU
System bus

Bus interface

Memory bus
Main
memory

bridge

I/O bus
USB
controller
Mouse

Graphics
adapter

Keyboard Display

Disk
controller

Expansion
p
slots for
other devices such
as network adapters

Disk
12

13

14

15

16

17

18

19

Hardware/software interface
Hardware/softwareinterface
C/C++
software
m/cinstr
reg,adder

our
focus

hardware
transistors
20

Architecture levels
Architecturelevels
Instructionsetarchitecture(ISA)
Instruction set architecture (ISA)
Lowestlevelvisibletoaprogrammer
Operation(add/sub/mul/shift)

Microarchitecture
Micro architecture
Fillsthegapbetweeninstructionsand
logic modules
logicmodules
OperationVsMicroOperation
21

Instruction Set Architecture


InstructionSetArchitecture
Application
pp cat o
Assembly
AssemblyLanguageView
Language View
Program
Processorstate(RF,mem)
set and encoding Compiler OS
Instruction
Instructionsetandencoding
LayerofAbstraction
ISA
Above:howtoprogram
Ab
h t
CPU
Design
machine HLL,OS
Circuit
Below:whatneedstobebuilt
Below: what needs to be built
Design
trickstomakeitrunfast
Chip
Layout
22

The Abstract Machine


TheAbstractMachine
CPU

PC

ALU

Memory
Add
Addresses
Code + Data

Registers

Data

Condition
Codes

Instructions

ProgrammerVisibleState
PCProgramCounter
RegisterFile
Heavilyuseddata
ConditionCodes

Stack

Memory
Bytearray
Code+data
stack
23

Some realities
Somerealities
Ints arenotIntegers,FloatsarenotReals
g ,
Youvegottoknowassembly
Chancesare,youllneverwriteprogramsin
assembly,butunderstandingassemblykeyto
machinelevelexecutionmodel

MemoryMatters
Memory Matters
Memoryisnotunbounded
Memoryperformanceisnotuniform
yp

Theresmoretoperformancethanasymptotic
complexity
24

Embedded computers
Embeddedcomputers
Processor
Processorasanintelligentelectronic
as an intelligent electronic
componentratherthanProcessorasa
computingengine
Realtimeoperation
Real time operation
Requireshardwaresoftwarecodesign
Highlycustomized
25

Why different processors?


Whydifferentprocessors?
What
Whatisthedifferencebetweenprocessors
is the difference between processors
usedindesktops,laptops,mobilephones,
washing machines etc ?
washingmachinesetc.?
Performance/speed
Powerconsumption
P
i
Cost
Generalpurpose/specialpurpose
DomainSpecific:Network,DSP,Image.Crypto
26

27

Topics to be covered
Topicstobecovered
Performanceissues
Aspecificinstructionsetarchitecture
ArithmeticandhowtobuildanALU
Constructingaprocessortoexecute
instructions
Pipeliningtoimproveperformance
Memory:cachesandvirtualmemory
Input/output

28

You might also like