8/21/2011
Computer Architecture
Introduction
Ren Cumplido and Claudia Feregrino CCC INAOE Some material taken from: Vishwani D. Agrawal
Auburn University
Text book: D. A. Patterson and J. L. Hennessy, Computer Organization & Design, the Hardware/Software Interface, Fourth Edition, San Francisco, California: Morgan Kaufman Publishers, Inc., 2008, ISBN 978-0-12374493-7. Instructors: Ren Cumplido, Claudia Feregrino Assistant: Juan Manuel Campos Prerequisites:
Logic Design Basis of Assembly Language Programming
Course Organization
8/21/2011
Student Performance Evaluation
Three exams: 35% Homeworks: 15% (~6) Lab assignments: 15% (~5) CPU Design Project: 15% Class Presentation: 10% Participation: 10%
Class attendance in NOT optional
Course Objective
Learn what a digital computer contains and how it works. Learn design concepts of a modern computer. Gain design experience (through project). 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 is parallel processing
4
8/21/2011
The Concept of a Computer
User
Application software
Systems software Hardware
Operating system compiler assembler Programs user writes and runs
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
Software
Compiler
Application software, a program in C:
Assembler
MIPS binary machine code:
00000000101000010000000000011000 00000000000110000001100000100001 10001100011000100000000000000000 10001100111100100000000000000100 10101100111100100000000000000000 10101100011000100000000000000100 00000011111000000000000000001000
MIPS compiler output, assembly language program:
swap (int v[ ], int k) swap; {int temp; temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; }
Application software Systems software Hardware
muli add lw lw sw sw jr
$2, $2, $15, $16, $16, $15, $31
$5, 4 $4, $2 0 ($2) 4 ($2) 0 ($2) 4 ($2)
8/21/2011
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
Fall 2011
The Hardware of a Computer
Control Datapath
Central Processing Unit (CPU) or processor
Input Memory Output
Application software Systems software Hardware
FIVE EASY PIECES
8
8/21/2011
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. ISA is designed to extract the most performance out of the available hardware technology.
Systems software Hardware
Software
Instruction set
Application software
Hardware
ISA
Defines registers Defines data transfer modes between registers, memory and I/O Types of ISA: RISC, CISC, VLIW, Superscalar Examples:
IBM370/X86/Pentium/K6 (CISC) PowerPC (Superscalar) Alpha (Superscalar) MIPS (RISC and Superscalar) Sparc (RISC), UltraSparc (Superscalar)
10
8/21/2011
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
11
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.
12
8/21/2011
How Do the Pieces Fit Together?
Application Operating System Compiler Memory system Firmware Instruction Set Architecture I/O system
Instr. Set Proc. Datapath & Control Digital Design Circuit Design
Coordination of many levels of abstraction Under a rapidly changing set of forces Design, measurement, and evaluation
Fall 2011 13
Research and Development of Continuing Interest
Instruction level parallelism (ILP) Multi-core processors and Chip multiprocessing (CMP) Energy efficiency and low power design Embedded systems Network processing
14
8/21/2011
The Computer Revolution
Progress in computer technology
Underpinned by Moores Law
Makes novel applications feasible
Computers in automobiles Cell phones Human genome project World Wide Web Search Engines
Computers are everywhere
Fall 2011 15
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
Fall 2011 16
8/21/2011
The Computer/Processor Market
Fall 2011
17
In 1965, Gordon Moore predicted that the number of transistors that can be integrated on a die would double every 18 to 24 months (i.e., grow exponentially with time). Amazingly visionary million transistor/chip barrier was crossed in the 1980s.
2300 transistors, 1 MHz clock (Intel 4004) - 1971 16 Million transistors (Ultra Sparc III) 42 Million transistors, 2 GHz clock (Intel Xeon) 2001 55 Million transistors, 3 GHz, 130nm technology, 250mm2 die (Intel Pentium 4) - 2004 140 Million transistor (HP PA-8500) 1000 Million Intel Xeon - 2009
Fall 2011 18
8/21/2011
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
Fall 2011 19
Impacts of Advancing Technology
Processor
logic capacity: performance: increases about 30% per year 2x every 1.5 years
ClockCycle = 1/ClockRate 500 MHz ClockRate = 2 nsec ClockCycle 1 GHz ClockRate = 1 nsec ClockCycle 4 GHz ClockRate = 250 psec ClockCycle
Memory
DRAM capacity: memory speed: cost per bit: 4x every 3 years, now 2x every 2 years 1.5x every 10 years decreases about 25% per year increases about 60% per year
20
Disk
capacity:
Fall 2011
10
8/21/2011
Inside some embedded systems
Fall 2011
21
DSP Processors
Fall 2011
22
11
8/21/2011
Summary
A computer processes digital data. A user solves a problem by writing and/or running a program written in a high-level programming language like C. Inside computer, system programs called compiler and assembler break the user program down into assembly code (instruction set) and then into binary machine code. The machine code is processed by the 5-piece hardware (control unit, datapath, memory, input and output) to obtain the desired result.
23
12