Computer Architecture Fall 2017 - SKKU...
Transcript of Computer Architecture Fall 2017 - SKKU...
1Dongkun Shin, SKKU
Computer Architecture
Fall 2017
2Dongkun Shin, SKKU
Syllabus
• Instructors:
– Dongkun Shin
– Office : Room 85470
– E-mail : [email protected]
– Office Hours: Wed. 15:00-17:30 or by appointment
• Lecture notes
– nyx.skku.ac.kr Courses Computer Architecture (2017 Fall)
– http://nyx.skku.ac.kr/?page_id=1267
• Lecture notes and talks will be given in English.
3Dongkun Shin, SKKU
Syllabus (cont’d)
• Main text
– D. A. Patterson and J. L. Hennessy,
Computer Organization & Design, the Hardware/Software Interface, Elsevier, 2013 (5th Edition).
• Grading policy (subject to change)
– Attendance: 5% (I’ll check at random.)
– Midterm exam: 30%
– Final exam: 50%
– Assignment: 15%
– Cheating on tests and other assignments will not be tolerated and you will fail the class.
4th edition
5th edition
4Dongkun Shin, SKKU
출석인정사유
연번 출석인정사유 제출서류
1가족이사망하여상중(喪中)인경우
<배우자, 자녀, 본인 및 배우자의 부모․조부모(7일이내), 본인 및 배우자의 형제자매․백숙부모․형제자매의 배우자(3일이내)>
사망진단서혹은병원의확인서
2학교공식행사(교내각기관이인정하는외부기관행사를포함한다)․교육실습․현장수업․예비군훈련등행사(훈련)참석확인서등으로결석
사유가확인되는경우
행사참석확인서/훈련참석확인서등
3 스포츠단선수로스포츠단이공식인정하는대회에참가하는경우 대회참석확인서
4학기중취업이확정되어출석하지못하는경우,해당수업을담당하는교수가학생에게그에상응하는별도의추가과제를부과하고이를성
실히이행했다고판단하는경우
취업확인서또는재직증명서및출근의무를입증할자료등
5 기타학장이부득이하다고인정하는사유가있는경우출석인정사유확인서
5Dongkun Shin, SKKU
Syllabus (cont’d)
• Course Outline
– 1. Introduction, Motivation, Computer Abstraction & Technology (Chapter 1)
– 2. Performance Measurements & Evaluation (Chapter 1)
– 3. Instruction Set Architecture, MIPS (Chapter2)
– 4. Arithmetic: Addition, Subtraction, Multiplication, Division and Floating Point (Chapter 3)
– 5. Processor Implementation (Chapter 4)
– 6. Memory Hierarchy: Cache, Virtual Memory (Chapter 5)
– 7. Parallel Processors (Chapter 6)
6Dongkun Shin, SKKU
Syllabus (cont’d)
• Assignments– programming assignments
• Branch Predictor (C++)• Cache simulator (C or C++)
• Prerequisites– Digital systems– C programming– System Programming
7Dongkun Shin, SKKU
If you have any questions,
please feel free to interrupt me
in English
or Korean.
8Dongkun Shin, SKKU
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/energy
• What is parallel processing
• 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
9Dongkun Shin, SKKU
Understanding Performance
• Algorithm
– Determines number of operations executed
• Programming language, compiler, architecture
– Determine number of machine instructions executed per
operation
• Processor and memory system
– Determine how fast instructions are executed
• I/O system (including OS)
– Determines how fast I/O operations are executed
10Dongkun Shin, SKKU
Components of a Computer
• Same components forall kinds of computer
– Desktop, server,embedded
• Input/output includes
– User-interface devices
• Display, keyboard, mouse
– Storage devices
• Hard disk, CD/DVD, flash
– Network adapters
• For communicating with other computers
• Our primary focus: Processor
The BIG Picture
11Dongkun Shin, SKKU
Apple iPad2
Capacitive multitouch LCD screen
3.8 V, 25 Watt-hour battery
Computer board
Apple 1GHz A5 dual-core Processor (512 MB RAM)
Toshiba 16GB NAND Flashpower management chip
Power Management IC
touchscreen line driver
12Dongkun Shin, SKKU
Inside the Processor
• Apple A6
13Dongkun Shin, SKKU
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)
14Dongkun Shin, SKKU
Decimal vs. Binary Notation
15Dongkun Shin, SKKU
Classes of Computers
• Personal 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
• Supercomputers
– High-end scientific and engineering calculations
– Highest capability but represent a small fraction of the overall computer market
16Dongkun Shin, SKKU
Classes of Computers
• Embedded computers
– Hidden as components of systems
– Most prevalent type (cell phones, DTV, car computers, dish washers, toys, videogame consoles..)
– Stringent power/performance/cost constraints
– Designed to run one application, and use a processor core (processor and application-specific hardware on a single chip)
– Annual growth rate of 40% vs. 9% for desktops and servers
• SW is integrated with H/W and delivered as a single system
• Unique application requirements (performance, cost, and power)
• Low tolerance for failure
17Dongkun Shin, SKKU
The PostPC Era
18Dongkun Shin, SKKU
The PostPC Era
• Personal Mobile Device (PMD)
– Battery operated
– Connects to the Internet
– Hundreds of dollars
– Smart phones, tablets, electronic glasses
• Cloud computing
– Warehouse Scale Computers (WSC)
– Software as a Service (SaaS)
– Portion of software run on a PMD and a portion run in the Cloud
– Amazon and Google
19Dongkun Shin, SKKU
The Computer Revolution
• 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
20Dongkun Shin, SKKU
Uniprocessor Performance
21Dongkun Shin, SKKU
Contributor 1: Technology
• Processor
– logic capacity: about 30% per year
– clock rate: about 20% per year
• Memory
– DRAM capacity: about 60% per year (4x every 3 years)
– Memory speed: about 10% per year
– Cost per bit: improves about 25% per year
• Disk
– capacity: about 60% per year
22Dongkun Shin, SKKU
Technology improvement
• Moore's law
– the number of transistors per integrated circuit would double every 18 months
Growth of capacity per DRAM
23Dongkun Shin, SKKU
Contributor 2: Computer Architecture
• Exploiting Parallelism (Single processor)
– Pipelining
– Superscalar
– VLIW
• Multiprocessor
• Media Instructions (SIMD)
• Cache Memory
24Dongkun Shin, SKKU
Contributor 2: Computer Architecture
Technology Contribution
25Dongkun Shin, SKKU
Superscalar Processors
ALPHA Pentium
Multiple functional units
26Dongkun Shin, SKKU
Multicore Processor
Intel Core i7-970 Architecture
27Dongkun Shin, SKKU
Eight Great Ideas
• Design for Moore’s Law
• Use abstraction to simplify design
• Make the common case fast
• Performance via parallelism
• Performance via pipelining
• Performance via prediction
• Hierarchy of memories
• Dependability via redundancy
28Dongkun Shin, SKKU
Below Your Program
• Application software
– Written in high-level language
• System software
– Operating System
• I/O operations,
• memory and storage allocation,
• Scheduling tasks & sharing resources
– Compiler
• translate a high-level language program into the hardware instructions
• Hardware
– Processor, memory, I/O controllers
Application software
Programs userwrites and runs
Hardware
Systems software
Operating systemcompiler
assembler
User
29Dongkun Shin, SKKU
Levels of Program Code
• High-level language
– Level of abstraction closer to
problem domain
– Provides for productivity and
portability
• Assembly language
– Textual representation of
instructions
• Hardware representation
– Binary digits (bits)
– Encoded instructions and data
30Dongkun Shin, SKKU
Computer System Organization
Control
Datapath MemoryCentral Processing
Unit (CPU)
or “processor”
Input
Output
Datapath performs the arithmetic operationsControl tells the datapath, memory, and I/O devices what to do
31Dongkun Shin, SKKU
Input Device Inputs Object Code
32Dongkun Shin, SKKU
Programs (as Machine Code) are stored in memory
33Dongkun Shin, SKKU
How does a machine code program execute?
• Sequential execution
34Dongkun Shin, SKKU
Processor Fetches an Instruction
• Processor fetches an instruction from memory
35Dongkun Shin, SKKU
Instruction Decode
• Control decodes the instruction to determine what to execute
36Dongkun Shin, SKKU
Instruction Execution
• Datapath executes the instruction as directed by control
37Dongkun Shin, SKKU
Completion
• At program completion the data to be output resides in memory
38Dongkun Shin, SKKU
Output Device Outputs Data
39Dongkun Shin, SKKU
The Hardware/Software Interface
• Why the text sub-title is The Hardware/Software Interface ?
– Hardware needs software to operate
• The instruction set architecture includes everything programmers need to know to make a binary program to work (Instructions, Arithmetic and Logic Unit (ALU), registers available, register size, etc.)
• The interface is important since it influences the performance of the computer;
• It also allows a given instruction set to work on different machines
• A given Instruction Set Architecture may have different implementations in hardware.
– Computer Architecture vs. Computer Organization
40Dongkun Shin, SKKU
Instruction Set Architecture (ISA)
41Dongkun Shin, SKKU
Instruction Set Architecture (ISA)
• A set of assembly language instructions (ISA) provides a link between software and hardware.
• Given an instruction set, software programmers and hardware engineers work more or less independently. (Abstraction)
• ISA is designed to extract the most performance out of the available hardware technology.
Ins
tru
cti
on
se
t
Software Hardware
42Dongkun Shin, SKKU
Sales of Microprocessors
Instruction set architectures
43Dongkun Shin, SKKU
Computer Architecture
• Architecture: System attributes that have a direct impact on the logical execution of a program
• Architecture is visible to a programmer:– Instruction set– Data representation– I/O mechanisms– Memory addressing
• Types of ISA: RISC, CISC, VLIW, Superscalar, CRISC
• Examples:
– IBM370/x86/Pentium/K6 (CISC)
– PowerPC (Superscalar)
– Alpha (Superscalar)
– MIPS (RISC and Superscalar)
– Sparc (RISC), UltraSparc (Superscalar)
– ARM (RISC), Cortex (CRISC)
– Intel Core (CRISC)
CISC and RISC is of no more interest in today’s computer technology.Computers today are truly hybrid systems. RISC architects have adopted a larger set of instructions and CISC architects have realized the benefits of implementing a core set of instructions that can execute in a single CPU cycle
44Dongkun Shin, SKKU
Computer Organization
• Organization: Physical details that are transparent to a programmer, such as
– Hardware implementation of an instruction
– Control signals
– Memory technology used
• Example: System/370 architecture has been used in many IBM computers, which widely differ in their organization.
45Dongkun Shin, SKKU
ARM Architecture Versions