Upload
riona
View
15
Download
0
Tags:
Embed Size (px)
DESCRIPTION
COM 249 – Computer Organization and Assembly Language Chapter 1 Computer Abstraction and Technology. Based on slides from D. Patterson and www-inst.eecs.berkeley.edu/~cs152/. Arithmetic. Single/multicycle Datapaths. IFetch. Dcd. Exec. Mem. WB. µProc 60%/yr. (2X/1.5yr). 1000. CPU. - PowerPoint PPT Presentation
Citation preview
Modified by S. J. Fritz Spring 2009 (1)
Based on slides from D. Patterson and
www-inst.eecs.berkeley.edu/~cs152/
COM 249 – Computer Organization andAssembly Language
Chapter 1 Computer Abstraction and
Technology
Modified by S. J. Fritz Spring 2009 (2)
Where are we going??
COM 249Spring ‘09
µProc60%/yr.(2X/1.5yr)
DRAM9%/yr.(2X/10 yrs)
1
10
100
1000
19
80 1
98
1 19
83 1
98
4 19
85 1
98
6 19
87 1
98
8 19
89 1
99
0 19
91 1
99
2 19
93 1
99
4 19
95 1
99
6 19
97 1
99
8 19
99 2
00
0
DRAM
CPU
19
82
Processor-MemoryPerformance Gap:(grows 50% / year)
Per
form
ance
Time
“Moore’s Law”
34-b it A LU
LO register(16x2 bits)
Load
HI
Cle
arH
I
Load
LO
M ultiplicandRegister
S h iftA ll
LoadM p
Extra
2 bits
3 232
LO [1 :0 ]
Result[H I] Result[LO]
32 32
Prev
LO[1]
Booth
Encoder E N C [0 ]
E N C [2 ]
"LO
[0]"
Con trolLog ic
InputM ultiplier
32
S ub /A dd
2
34
34
32
InputM ultiplicand
32=>34sig nEx
34
34x2 M U X
32=>34sig nEx
<<13 4
E N C [1 ]
M ulti x2 /x1
2
2HI register(16x2 bits)
2
01
3 4 ArithmeticSingle/multicycleDatapaths
IFetchDcd Exec Mem WB
IFetchDcd Exec Mem WB
IFetchDcd Exec Mem WB
IFetchDcd Exec Mem WB
Pipelining
Memory Systems
I/O
YOUR
CPU
Modified by S. J. Fritz Spring 2009 (3)
Where Are We Going?
°Performance issues (Chapter 1) overview, vocabulary and motivation
°A specific instruction set architecture (Chapter 2)
°Arithmetic and how to build an ALU (Chapter 3)
°Constructing a processor to execute our instructions (Chapter 4)
°Pipelining to improve performance (Chapter 4)
°Memory: caches and virtual memory (Chapter 5)
°I/O (Chapter 6)
°Multicores, Multiprocessors (Chapter 7)
Key to a good grade: reading the book!
Modified by S. J. Fritz Spring 2009 (4)
What You Will Learn°How programs are translated into
the machine language•And how the hardware executes them
°The hardware/software interface
°What determines program performance•And how it can be improved
°How hardware designers improve performance
° What parallel processing is and what implications it has for programmers
Modified by S. J. Fritz Spring 2009 (5)
Introduction° Rapidly changing field:
•vacuum tube -> transistor -> IC -> VLSI (see section 1.3)
•doubling every 1.5 years: (Moore’s Law)memory capacity processor speed (Due to advances in technology and
organization)
° Things you’ll be learning:
•how computers work, a basic foundation
•how to analyze their performance (or how not to!)
•issues affecting modern processors (caches, pipelines)
° Why learn this stuff?
•you want to call yourself a “computer scientist”
•you want to build software people use (need performance)
•you need to make a purchasing decision or offer “expert” advice
Modified by S. J. Fritz Spring 2009 (6)
Understanding Performance
AlgorithmDetermines number of operations executed
Programming language, compiler, architectureDetermine number of machine instructions executed per operation
Processor and memory systemDetermine how fast instructions are executed
I/O system (including OS)Determines how fast I/O operations are executed
Modified by S. J. Fritz Spring 2009 (7)
COM 249: So what's in it for me?
•Learn some of the big ideas in CS & engineering:
•5 Classic components of a Computer•Data can be anything (integers, floating point, characters): the program determines what it is•Stored program concept: instructions just data•Principle of Locality, exploited via a memory hierarchy (cache)•Greater performance by exploiting parallelism•Principle of abstraction, used to build systems as layers•Compilation vs. interpretation through system layers•Principles/Pitfalls of Performance Measurement•Designer’s “conceptual” toolbox
Modified by S. J. Fritz Spring 2009 (8)
“Conceptual” Tool Box?°Evaluation Techniques
°Levels of translation (e.g., Compilation)
°Levels of Interpretation (e.g., Microprogramming)
°Hierarchy (e.g, registers, cache, memory, disk, tape)
°Pipelining and Parallelism
°Indirection and Address Translation
°Synchronous /Asynchronous Control Transfer
°Timing, Clocking, and Latching
°CAD Programs, Hardware Description Languages, Simulation
°Static / Dynamic Scheduling
°Physical Building Blocks (e.g., Carry Lookahead)
°Understanding Technology Trends
Modified by S. J. Fritz Spring 2009 (9)
Our Goals
° To understand modern computer architecture in its rapidly changing form
° To explore the relationship between hardware and software
°To design by leading you through the process of challenging design problems and by examining real designs
°To learn how to test and to design for improved performance
Modified by S. J. Fritz Spring 2009 (10)
COM249
Where is “Computer Organization and Assembly Language”?
*Coordination of many levels of abstraction
I/O systemProcessor
CompilerOperatingSystem
(Windows 2K)
Application (Netscape)
Digital DesignCircuit Design
Instruction Set Architecture
Datapath & Control
transistors
MemoryHardware
Software Assembler
Modified by S. J. Fritz Spring 2009 (11)
Dual Level Abstraction
SOFTWARENegation, Add,
Double, Subtract
HARDWARENegation,
Add
Higher Levels
Lower Levels
Modified by S. J. Fritz Spring 2009 (12)
Computer ArchitectureIncludes:
°Instruction set architecture (ISA) (programmer’s abstraction of a computer)
°Organization or microarchitecture (internal implementation of a computer at the register and functional unit level)
°System architecture (organization of the computer at the cache and bus level)
°See Computing Curriculum 2001 – pages 97-101
http://www.acm.org/education/education/curric_vols/cc2001.pdf
Modified by S. J. Fritz Spring 2009 (13)
Instruction Set Architecture (ISA)
°A very important abstraction
•interface between hardware and low-level software
•standardizes instructions, machine language bit patterns, etc.
•advantage: different implementations of the same architecture
•disadvantage: sometimes prevents using new innovations
Modern instruction set architectures:
•80x86/Pentium/K6, PowerPC, DEC Alpha, MIPS, SPARC, HP
Modified by S. J. Fritz Spring 2009 (14)
Hardware Levels
Level 0
Level 1
Level 2 CPU, Memory, Etc.
Digital Logic Circuits
Transistors
Modified by S. J. Fritz Spring 2009 (15)
Software Levels
High-Level Languages
Assembly Language
Operating Systems
Machine Language
Level 6
Level 5
Level 4
Level 3
Modified by S. J. Fritz Spring 2009 (16)
Software°At higher levels (above Level 2)•Level 3: Machine language•Level 4: Operating system services
•Level 5: Assembly language•Level 6: High-level languages
° Most programs are written at Level 6.
° Hardware only understands Level 3 instructions.
Modified by S. J. Fritz Spring 2009 (17)
Below Your Program
°Application software•Written in high-level language (HLL)
°System software•Compiler: translates HLL code to machine code
•Operating System: service code- Handling input/output
- Managing memory and storage
- Scheduling tasks & sharing resources
°Hardware•Processor, memory, I/O controllers
§1.2 Below Your
Program
Modified by S. J. Fritz Spring 2009 (18)
Levels of Representation
High Level Language Program (e.g., C)
Assembly Language Program (e.g.,MIPS)
Machine Language Program (MIPS)
Hardware Architecture Description (e.g., Verilog Language)
Compiler
Assembler
Machine Interpretation
temp = v[k];
v[k] = v[k+1];
v[k+1] = temp;
lw $t0, 0($2) #load word
lw $t1, 4($2)sw $t1, 0($2)
#store wordsw $t0, 4($2)0000 1001 1100 0110 1010 1111 0101 1000
1010 1111 0101 1000 0000 1001 1100 0110 1100 0110 1010 1111 0101 1000 0000 1001 0101 1000 0000 1001 1100 0110 1010 1111
Logic Circuit Description (Verilog Language)
Architecture Implementation
wire [31:0] dataBus;
regFile registers (databus);
ALU ALUBlock (inA, inB, databus);
wire w0;
XOR (w0, a, b);
AND (s, w0, a);
Modified by S. J. Fritz Spring 2009 (19)
Revolutions
1. Agricultural
2. Industrial
3. Information / computer
Computers have become part of daily life and are ubiquitous (in cars, ATMs, microwave ovens, cell phones, etc.)
Classes: desktops, servers, supercomputers, embedded
Software: •Systems- Operating systems, compilers, assemblers
•Applications- Word processors, databases, spreadsheets, games, etc...
Modified by S. J. Fritz Spring 2009 (20)
1/22/2008 CS152-Spring’08 2
Computing Devices Then…
EDSAC, University of Cambridge, UK, 1949
Modified by S. J. Fritz Spring 2009 (21)
1/22/2008 CS152-Spring’08 3
Computing Devices Now
QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.
Quic k T ime™ and aT IF F (Unc ompres s ed) dec ompres s orare needed to s ee this pic ture.
QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.
QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see thi s picture.
Robots
SupercomputersAutomobiles
Laptops
Set-top boxes
Games
Smart phones
Servers
Media Players
Sensor Nets
Routers
Cameras
Modified by S. J. Fritz Spring 2009 (22)
Classes of Computers°Desktop computers
•General purpose, variety of software
•Subject to cost/performance tradeoff
°Server computers
•Network based
•High capacity, performance, reliability
•Range from small servers to building sized
°Embedded computers
•Hidden as components of systems
•Stringent power/performance/cost constraints
Modified by S. J. Fritz Spring 2009 (23)
Embedded Computers
°Run one set of related applications, such as those in cell phones, TVs, cars, game machines, etc.
°Growth of cell phones, with embedded computers, has been faster than desktop computers.
°In 2004 there were 1 PC, 2.2 cell phones, and 2.5 TVs for every 8 people on the planet.
°In 2006, a US family owned 12 gadgets (3 TVs, 2 PCs, and others –MP3 players, cell phones, game consoles.)
Modified by S. J. Fritz Spring 2009 (24)
The Processor Market
Modified by S. J. Fritz Spring 2009 (25)
°Progress in computer technology•Underpinned by Moore’s Law
°Makes novel applications feasible•Computers in automobiles
•Cell phones
•Human genome project
•World Wide Web
•Search Engines
°Computers are pervasive
§1.1 IntroductionThe Computer Revolution
Modified by S. J. Fritz Spring 2009 (26)
Moore’s Law
°Moore's Law, states that the number of transistors on a chip will double about every two years.
°Almost every measure of the capabilities of digital electronic devices is linked to Moore's law: processing speed, memory capacity, even the number and size of pixels in digital cameras
°http://en.wikipedia.org/wiki/Moore's_law
°http://www.intel.com/technology/mooreslaw/index.htm
Modified by S. J. Fritz Spring 2009 (27)
From High Level to Low LevelAdvantages of High Level Languages
°Think in more natural terms about real world objects
°Improve programmer productivity
°Programmers independent of machine
Advantages of Low Level Language
°Faster
°Communicate directly with hardware
Modified by S. J. Fritz Spring 2009 (28)
Components of a Computer
Same components forall kinds of computer
Desktop, server,embedded
Input/output includesUser-interface devices
Display, keyboard, mouse
Storage devicesHard disk, CD/DVD, flash
Network adaptersFor communicating with other computers
The BIG Picture
Modified by S. J. Fritz Spring 2009 (29)
Anatomy: 5 components of any Computer
Personal Computer
Processor
Computer
Control(“brain”)
Datapath(“brawn”)
Memory
(where programs, data live whenrunning)
Devices
Input
Output
Keyboard, Mouse
Display, Printer
Disk (where programs, data live whennot running)
Modified by S. J. Fritz Spring 2009 (30)
Anatomy of a Computer
Output device
Input device
Input device
Network cable
Modified by S. J. Fritz Spring 2009 (31)
Anatomy of a Mouse
°Invented by Doug Englebart (1967)
°Mechanical (roller ball)
°Optical mouse•LED illuminates desktop
•Small low-res camera
•Basic image processor- Looks for x, y movement
•Buttons & wheel
°Supersedes roller-ball mechanical mouse
Modified by S. J. Fritz Spring 2009 (32)
Through the Looking Glass
°LCD screen: picture elements (pixels)•Mirrors content of frame buffer memory
Modified by S. J. Fritz Spring 2009 (33)
LCD Displays
°Liquid Crystal Display- thin, low power
°Uses rod shape molecules in a liquid forming a twisted helix that bends light.
°Rods straighten when current is applied and do not bend the light.
°Uses an active matrix of tiny transistors to control current and form sharper images.
°Images are composed of red, green and blue dots.
Modified by S. J. Fritz Spring 2009 (34)
Forming Images
°An image is composed of picture elements or pixels, represented as a matrix of bits, called a bit map.
°Display matrix can be 640 x 480 to 2560 x 1600 pixels in size.
°A color display uses 8 bits for each of the 3 (RGB) colors, or 24 bits/pixel, creating millions of colors.
°A raster refresh or frame buffer is the hardware to support graphics. It stores the bit map.
Modified by S. J. Fritz Spring 2009 (35)
Opening the Box
Modified by S. J. Fritz Spring 2009 (36)
Inside the Processor (CPU)
°Datapath: performs operations on data
°Control: sequences datapath, memory, ...
°Cache memory•Small fast SRAM memory for immediate access to data
Modified by S. J. Fritz Spring 2009 (37)
Inside the Processor
°AMD Barcelona: 4 processor cores
Modified by S. J. Fritz Spring 2009 (38)
Abstractions
°Abstraction helps us deal with complexity•Hide lower-level detail
°Instruction set architecture (ISA)•The hardware/software interface
°Application binary interface (ABI)•The ISA plus system software interface
°Implementation•The details underlying and interface
The BIG Picture
Modified by S. J. Fritz Spring 2009 (39)
A Safe Place for Data
°Volatile main memory•Loses instructions and data when power off
°Non-volatile secondary memory•Magnetic disk
•Flash memory
•Optical disk (CDROM, DVD)
Modified by S. J. Fritz Spring 2009 (40)
Networks
°Communication and resource sharing
°Local area network (LAN): Ethernet•Within a building
°Wide area network (WAN: the Internet
°Wireless network: WiFi, Bluetooth
Modified by S. J. Fritz Spring 2009 (41)
Technology Trends
°Electronics technology continues to evolve•Increased capacity and performance
•Reduced cost
Year Technology Relative performance/cost
1951 Vacuum tube 1
1965 Transistor 35
1975 Integrated circuit (IC) 900
1995 Very large scale IC (VLSI) 2,400,000
2005 Ultra large scale IC 6,200,000,000
DRAM capacity
Modified by S. J. Fritz Spring 2009 (42)
Overview of Physical Implementations
°Integrated Circuits (ICs)•Combinational logic circuits, memory elements, analog interfaces.
°Printed Circuits (PC) boards•substrate for ICs and interconnection, distribution of CLK, Vdd, and GND signals, heat dissipation.
°Power Supplies•Converts line AC voltage to regulated DC low voltage levels.
°Chassis (rack, card case, ...) •holds boards, power supply, provides physical interface to user or other systems.
°Connectors and Cables.
The hardware out of which we make systems.
Modified by S. J. Fritz Spring 2009 (43)
Review of Major Components
°Mouse ( mechanical, optical)
°Display (CRT, LCD)
°Motherboard
°Integrated Circuits (transistors, CMOS)
°CPU - controls memory, I/O, datapath according to instructions
°Datapath- performs arithmetic operations
Modified by S. J. Fritz Spring 2009 (44)
Review of Major Components°Memory
•DRAM - Dynamic RAM - main memory
•SRAM - Static RAM- faster, more expensive
•Cache- fast buffer for main memory
•DIMM and SIMM - small boards that contain DRAM chips
•RAM, ROM, volatile, non-volatile, primary, secondary, magnetic disk, optical disks (CD, DVD), FLASH based
Modified by S. J. Fritz Spring 2009 (45)
Memory Comparisons
°Main Memory vs. Disk
°Volatile Non Volatile
°Fast(electrical)Slower(mechanical)
°Expensive (100 * more) CheaperMemory AccessDRAM Disk
40 -80 nanoseconds 5- 15 milliseconds
10-9 10-3
(100,000 times faster)
Modified by S. J. Fritz Spring 2009 (46)
Computer Technology - Dramatic Change!°Processor
•2X in speed every 1.5 years (since ‘85); 100X performance in last decade.
°Memory•DRAM capacity: 2x / 2 years (since ‘96); 64x size improvement in last decade.
°Disk•Capacity: 2X / 1 year (since ‘97)
•250X size in last decade.
Modified by S. J. Fritz Spring 2009 (47)
Technology Trends: Processor Performance
0100200300400500600700800900
87 88 89 90 91 92 93 94 95 96 97
DEC Alpha 21264/600
DEC Alpha 5/500
DEC Alpha 5/300
DEC Alpha 4/266
IBM POWER 100
1.54X/yr
Intel P4 2000 MHz(Fall 2001)
We’ll talk about processor performance later on…
year
Performance measure
Modified by S. J. Fritz Spring 2009 (48)
Technology Trends: Memory Capacity(Single-Chip DRAM)size
Year
Bit
s
1000
10000
100000
1000000
10000000
100000000
1000000000
1970 1975 1980 1985 1990 1995 2000
year size (Mbit)
1980 0.0625
1983 0.25
1986 1
1989 4
1992 16
1996 64
1998 128
2000 256
2002 512• Now 1.4X/yr, or 2X every 2 years.• 8000X since 1980!
Modified by S. J. Fritz Spring 2009 (49)
Tech. Trends: Microprocessor Complexity
2X transistors/Chip Every 1.5 to 2.0 yearsCalled “Moore’s Law”
Modified by S. J. Fritz Spring 2009 (50)
NetworksAdvantages
°Communication
°Resource Sharing
°Non-local access
Types
°LANs - Ethernet
°WANs
Modified by S. J. Fritz Spring 2009 (51)
Computer Technology - Dramatic Change!
°State-of-the-art PC when you graduate: (at least…)•Processor clock speed: 5000 MegaHertz (5.0 GigaHertz)
•Memory capacity: 4000 MegaBytes (4.0 GigaBytes)
•Disk capacity: 2000 GigaBytes (2.0 TeraBytes)
•New units! Mega <= Giga, Giga <= Tera …
(Kilo, Mega, Giga, Tera, Peta, Exa, Zetta, Yotta = 1024)
Come up with a clever mnemonic, fame!
Modified by S. J. Fritz Spring 2009 (52)
Technology in the News
°BIG•LaCie the first to offer consumer-level 1.6 Terabyte disk!
•$2,200
•Weighs 11 pounds!
°SMALL•Pretec is soon offering a 12GB CompactFlash card
•Size of a silver dollar
•Cost??
www.lacie.com/products/product.htm?
id=10129
www.engadget.com/entry/
4463693158281236/
Modified by S. J. Fritz Spring 2009 (53)
And in conclusion...°Continued rapid improvement in
Computing•2X every 1.5 years in processor speed; every 2.0 years in memory size; every 1.0 year in disk capacity; Moore’s Law enables processor, memory (2X transistors/chip/ ~ 1.5 or 2.0 yrs)
°5 classic components of all computers Control Datapath Memory Input Output
}Processor