orange coast college business division computer science department cs 116- computer architecture...

54
Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

Upload: edwina-daniela-wade

Post on 22-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

Orange Coast CollegeBusiness Division

Computer Science Department

CS 116- Computer Architecture

Computer Technology & Abstraction

Page 2: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 21998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 2OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

“Civilization advances by extending the number of operations which can be performed without thinking about them”

Alfred North WhiteheadAn Introduction to Mathematics, 1911

Page 3: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 31998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 3OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Science Fiction or Science Fact• Yesterday's Dreams -> Today's Reality

– ATM

– Embedded Computers

– Laptops, Palmtops, Wearable Computers

– The Internet, eh

Page 4: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 41998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 4OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Science Fact and Science Fiction• Today's Dream -> Tomorrow's Technology

– Cashless Society

– Computers Automated Machines

– Artificial People

– What else?

Page 5: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 51998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 5OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Rapid Pace of Technology• Hardware

Vacuum Tube1897

Edison Labs

Transistor1947

AT&T Labs

Integrated Circuit1958

Texas InstrumentsFairchild Camera

Page 6: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 61998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 6OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Rapid Pace of Technology

Currently the largest processor: ~400,000,000 transistors

Page 7: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 71998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 7OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Summarized• Computer technology advances rapidly

– Processor• Logic capacity: increases ~ 30% / yr• Clock rate: increases ~ 20% / yr

– Memory• DRAM capacity: increases ~ 60% / yr • Memory speed: increases ~ 10% / yr• Cost per bit: increases ~ 25% / yr

– Disk• Capacity: increases ~ 60% / yr

Page 8: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 81998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 8OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Moore's Law

• Transistor count doubles of every 18 months• Generalized

– Computer technology doubles every 18 months

– See Page 30

Page 9: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 91998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 9OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

The Virtuous Circle

Advances in

techno

logy

Low prices

& better product

s

Competition

New market &

companies

New

applications

• Result of Moore's Law

Page 10: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 101998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 10OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Rapid Pace of Technology• But what about Software• Has also evolved

– Machine Language: On/Off, 1/0, Up/Down

– Assembly Language: Mnemonic

– High-level languages: Fortran

– Block languages- Functions and logic

– Object Oriented Language- Data encapsulation

Page 11: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 111998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 11OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Evolution of Languages

...101010...

MOV 42, R1STORE R1, $A

A = (42 + B) / C

Machine Language

Assembly

High level

Page 12: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 121998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 12OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Nathan's First of Law of Software

• Meaning:– Software continues to acquire features that

demand faster processors, bigger memories, & more I/O capacities

• Corollary: Wirth's Law– “Software gets slower faster than hardware gets

faster” -Niklaus Wirth

“Software is a gas. It expands to fill the container holding it”

-Nathan Myhrvold

Page 13: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 131998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 13OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

The Language Barrier• There is a large gap between what is convenient

for computers & what is convenient for humans

Translation and/or Interpretation is needed

Page 14: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 141998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 14OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Machine Language• Is the language of the machines• Based on a two letter alphabet

– 1 and 0 (binary)

• Basis for everything a computer deals with– Instructions

– Data

• Tedious to handle

Page 15: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 151998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 15OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Assembly Language• One line for every instruction

– 1-to-1 correspondence to machine language

• Programmer thinks as the machine• Machine-dependent• Assembler is needed to translate into

machine language– Assembler is itself software

Page 16: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 161998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 16OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

High Level Languages• High-level languages

– One line to many assembly instructions

– Near natural language

– Machine independent

– Compiler is needed to translate into either assembly or machine language

• Subroutine libraries– Modular

– Code reuse

Page 17: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 171998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 17OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Bringing it all together

swap (int v[], int k){ int temp temp = v[k]; v[k] = v[k+1]; v[k+1] = temp;}

0 00 000 0 01 01 0 00 01 00 0 00 00 00 00 11 00 00 00 000 0 01 0 0011 1 0 00 011 00 00 01 00 00 11 00 01 1 0 0 01 1 0 001 0 00 0 00 00 00 00 00 00 01 00 01 1 0 01 1 11 001 0 00 0 00 00 00 00 00 1 0 01 01 01 1 0 01 1 11 001 0 00 0 00 00 00 00 00 00 01 01 011 0 0 01 1 0 00 10 000 00 00 00 00 00 1 0 00 00 0001 111 1 0 0000 000 00 00 00 00 01 00 0

swap: muli $2, $5, 4 add $2, $4, $2 lw $15, 0($2) lw $18, 4($2) sw $18, 0($2) sw $15, 4($2) jr $31

C - Compiler

Assembler

High-level language

Assembly language

Machine language

m/c Interpreter

Control Signals

Page 18: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 181998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 18OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Hardware-Software Link• Hardware

– Computer components• CPU• Memory• Peripherals

• Software– System SW

• Compilers/Interpreters• Linkage editors• Operating system

– Application SW• MS-Office

Sy s t e

ms softw

are

Ap pli cations soft wa re

User

Hardware

Page 19: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 191998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 19OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Another way of looking at it...

Application programsSymbolic

Systems programsNumeric

Assembly language level

Problem-oriented language level

Operating system machine level

Instruction set architecture(ISA) level

Micro-architecture level

Digital logic level

Translation (Compiler)

Translation (Assembler)

Partial interpretation (OS)

Interpretation (microprogram) or direct execution

Hardware

Device (transistor) level

Page 20: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 201998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 20OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Hardware and Software Components• Hardware

– Memory components• Registers• Register file• Memory• Disks

– Functional components• Adder, multiplier,

dividers, . . .• Comparators• Control signals

• Software– Data

• Simple• Characters• Numbers

– Structured• Arrays• Structures/Objects

– Instructions• Data transfer• Arithmetic• Control flow

Page 21: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 211998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 21OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Closer look at Software Components...Software

Applications Software Systems Software

Compilers OperatingSystems

Assemblers

VirtualMemory

File System I/O devicedrivers

MS Office ...

... ...

... ... ... ...

...

... ...

...as

Page 22: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 221998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 22OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

What we will learn• Basic foundation on how computers work

• Assembly language introduction/Review

• How to analyze program performance

• How to design processor components

• How to enhance processors performance (caches, pipelines, parallel processors, multiprocessors)

Page 23: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 231998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 23OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Organization and Architecture• Architecture is a Specification• Organization is the Implementation

Page 24: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 241998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 24OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Architecture is Specification• Attributes visible to the programmer• Attributes:

– Instruction set

– Number of bits representing data

– I/O mechanism

– Addressing modes used

• Has direct impact on logical program execution

• Example– Itanium

Page 25: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 251998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 25OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Organization is Implementation• Operational units and their interconnection

that realizes the architecture• Attributes:

– HW details

– Control signals

– I/O interfaces

– Memory technology used

• Example– McKinley

Page 26: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 261998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 26OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

The Motherboard1. RAM sockets2. Power connectors3. Cache4. CPU socket5. Floppy & hard drives6. External connectors

for I/O devices7. Expansion slots

Page 27: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 271998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 27OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

More Motherboard

FourISAcardslots

FourPCIcardslots Four

SIMMslots

CPU

Two IDEConnectors

Audio Parallel/Serial

• Main memory• DRAM (Dynamic Random Access Memory)• Mounted on SIMM Slots (Single Inline Memory Module)• Contains instructions & data

● Processor● Covered by heat sinks for

cooling● Connectors for I/O devices

● Audio/MIDI● Parallel/Serial● PCI card slots● ISA card slots● IDE connectors

Page 28: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 281998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 28OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Computer Components• Logical Components

– Input• Mouse, Keyboard

– Output• Display, Printer

– Memory• Hard disk, DRAM, Cache

– CPU• Datapath [ALU + Registers]• Control Path

Page 29: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 291998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 29OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

The Breakdown

Computer

Processor (CPU)

Memory

Control

Dat

a pa

th

Output

Input

keyboard

Mouse

Disk. . .

Printer

Screen

Disk. . .

Page 30: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 301998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 30OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Lets look a little closer...• Processor(CPU):

– Active part of the motherboard

– Performs calculations & activates devices

– Gets instructions & data from memory

– Components are connected via Buses

• Bus:– Collection of parallel wires

– Transmits data, instructions, or control signals

• Motherboard– Physical chips for I/O connections, memory, &

CPU

Page 31: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 311998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 31OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

The CPU• Datapath (ALU+ Registers):

– Performs arithmetic & logical operations

– ALU = Arithmetic Logic Unit

– Register= Source of operands for the ALU

• Control (CU): – Controls the data path, memory, & I/O devices

– Sends signals that determine operations of datapath, memory, input & output

Page 32: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 321998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 32OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Details of the CPU

Data cache

ControlBranch

Instruction

cache

Bus Integer data-path

Floating-point datapa

th

•Example: Intel Pentium •Area: 91 mm2

•~ 3.3 million transistors ( 1 million for cache memory)

Page 33: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 331998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 33OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

A more modern approach...

Page 34: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 341998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 34OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Memory• Volatile memory

– Loses information when power is switched-off

– RAM

• Non-volatile memory– Keeps information when power is switched-off

– Hard disk, Tape

Page 35: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 351998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 35OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Volatile Memory• Cache

– Fast but expensive

– Smaller capacity

– Placed closer to the processor

• Main Memory (RAM)– Less expensive

– Slower than cache

– LOTS more capacity

Page 36: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 361998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 36OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Non-volatile memory• Secondary Memory

– Low cost

– Slower than RAM

• Hard disks– 2003: $1/GB ($.001/MB)

– 1988: $11.54/MB

• Flash Devices– USB Key

• Almost unlimited capacity– Think Internet

Page 37: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 371998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 37OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Input/Output (I/O)• I/O devices have the hardest organization

– Wide range of speeds• Graphics vs. keyboard

– Wide range of requirements• Speed• Standard• Cost . . .

– Least amount of research done in this area

Page 38: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 381998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 38OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Networking• Connecting computers

– Extend computing power

– Communicate

– Share resources

– Have non-local access

• Advantages– Communication

– Resource sharing

– Non-local access

Page 39: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 391998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 39OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

More Networking...• Local-Area Network (LAN)

– Connects computers on the same floor of a building

– Example: Ethernet• Length ~1 km• Speed 100 Mbytes/sec up to 1GBit/sec

• Wide-Area Network (WAN)– Connects computers across continents

– The backbone of the Internet.

– Use optical fibers

– Leased from telecommunication companies

Page 40: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 401998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 40OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Shameless Plug• If you want to know more about Networking

– CS 191 Thursday night

Page 41: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 411998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 41OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

What is our Primary Concern?• The processor (datapath and control)

– Implemented using millions of transistors

– Impossible to understand by looking at each transistor

– We need abstraction• Hides lower-level details to offer simple model at

higher level

Page 42: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 421998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 42OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Why Abstraction?• Intensive & thorough research into the depths • Reveals more information• Omits unneeded details• Helps us cope with complexity• Examples of abstraction:

– Language hierarchy

– Instruction set architecture (ISA)

Page 43: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 431998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 43OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Instructions (Finally!)• Instruction

– Smallest operation a processor can perform• Add/Multiply two numbers

• ISA (Instruction Set Architecture)– Architecture = Specification

– ISA is a contract• This instruction will have this effect• Encompasses information needed to write

machine-language programs

– Abstract interface between the hardware and lowest-level software

Page 44: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 441998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 44OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

More ISA• ISA considered software• Organization = Implementation• Several implementations of an ISA may exist• Modern ISAs

– x86: 8086, 286, 386, 486, Pentium, Athlon

– Others: PowerPC, MIPS, SPARC, Alpha

Page 45: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 451998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 45OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Why Multiple Implementations?• Advantages

– Easier to change than hardware

– Standardizes instructions, machine language bit patterns, etc.

– Increases competetion

• Disadvantage (why not?)– It can prevent new innovations

• Example: Intel

Page 46: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 461998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 46OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

But how do instructions work?• Smallest unit of operation a processor can

perform• Instruction is represented as a series of bits

(1's and 0's) that the processor interprets– Based on a given pattern, it does something

specific, like add

• ISA specifies what a particular instruction does– What operands it uses

– Where the result is stored

Page 47: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 471998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 47OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Basic Flow

ALU

OP1 + OP2

Op1 Op2

OP1 + OP2...

Op1Op2

General-purpose Register

sALU i/p

registers

ALU o/p register

Bus

Page 48: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 481998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 48OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

The Instruction Cycle• Every processor follows the same cycle

Fetch Next Instruction From Memory

Decode Instruction determine its size & action

Fetch Operand data

Execute instruction & compute results or status

• Called the von Neumann machine

Page 49: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 491998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 49OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

A little closer... Issues to consider• Instruction Fetch:

– What is the instruction Format?

– How is the instruction decoded?

• Instruction decoding:– Location of operands and result

• Where is the operand stored?• How many explicit operands are allowed for the

instruction?• How are memory operands located?• Which operands can (or cannot) be in memory?

Page 50: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 501998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 50OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

A little closer... Issues to consider• Operand fetch:

– What is the data type & size of the operand?

• Execution: – What are the supported operations?

• Next Instruction:– Should the next instruction to be executed be

• Successor instruction?• Some other instruction?

– Jumps, conditions, or branches

Page 51: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 511998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 51OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Typical InstructionsExamplesOperation Category

Parallel sub-word ops (4 16bit add)Graphics (MMX)

Test & set (atomic r-m-w)Synchronization

IntInterruptCall, returnSubroutine LinkageUnconditional, conditionalControl (Jump/Branch)

Search, translateString

Not, and, or, set, clearLogical

Shift left/right, rotate left/rightShift

Integer (binary + decimal) or FPAdd, Subtract, Multiply, Divide

Arithmetic

Memory Load / StoreMemory-to-memory move Register-to-register moveInput / output (to/from I/O device)Push, pop (to/from stack)

Data Movement

Page 52: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 521998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 52OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Motivation• Not just for chip designers and compiler

writers• Computers are becoming omnipresent

– Everywhere you go, there they are

• Computer Architecture gives you– Foundation for understanding how they work

– Foundation for what they can do

• Basis for rapidly learning new technology

Page 53: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 531998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 53OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

How to get the most• Read textbook (& some topics of the optional

texts!)• Be up-to-date by continuously searching the

library & Internet!– Becomes more interesting as you learn more

• Solve self-exercise and other exercises! • Come back with your input & questions for

discussion!• Appreciate and participate in teamwork!

Page 54: Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Computer Technology & Abstraction

OCC - CS/CIS CS116-Ch00-Orientation 541998 Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 54OCC-CS 116 Fall 2003 1998 Morgan Kaufmann Publishers (Augmented & Modified by M.Malaty and M. Beers)

Homework• Team Project:

– Write a short paper (1-2 pages) comparing two of the hardware characteristics of the following processor families:• Pentium Pro• Pentium 4• Celeron• Athlon• UltraSPARC • PicoJava

– Present Results next Monday• Short 5-10 minutes