Course Details

• Course Code: COMP303 Prof. Dr. Nizamettin AYDIN • Course Name: Computer Architecture • Credit: 3 • Nature of the course: Lecture [email protected] • Course web page: http://www.yildiz.edu.tr/~naydin/na_CAr.htm http://www.yildiz.edu.tr/~naydin • Instructors: Nizamettin AYDIN Room: …. Email: [email protected], [email protected]

1 2

Assesment Rules of the Conduct

• No eating /drinking in class • Midterm : 30% – except water • Cell phones must be kept outside of class or • Final : 40% switched-off during class • Project : 10% • No talking with your peers • Homework : 15% • No late arrival or early leave to/from the • Attendance & participation : 05% lecture • No web surfing and/or unrelated use of computers – when computers are used in class or lab

3 4

Rules of the Conduct Recommended Texts

• You are responsible for checking the class web • Computer Organization and Design, David A. page often for announcements. Patterson and John L. Hennessy – http://www.yildiz.edu.tr/~naydin/na_CAr.htm • Computer Architecture: A Quantitative Approach, John L. Hennessy, David A. Patterson • Academic dishonesty and cheating • Computer Organization and Architecture: – will not be tolerated Designing for Performance, William Stallings – will be dealt with according to university rules and • Computer System Architecture, M. Morris Mano regulations • Logic and Computer Design Fundamentals, M. • http://www.yok.gov.tr/content/view/475/ Morris Mano, Charles Kime • Presenting any work that does not belong to you is also • … considered academic dishonesty.

5 6

Copyright 2000 N. AYDIN. All rights reserved. 1 Week’s Agenda Objectives

• What is computer architecture? • Know the difference between computer organization and computer architecture. • Why study computer architecture? • Understand units of measure common to • HW/SW abstractions computer systems. • Manufacturing of a chip • Appreciate the evolution of computers. • Course Info • Understand the computer as a layered system. • … • Be able to explain the von Neumann architecture and the function of basic computer components.

7 8

Why study Computer Architecture? What is Computer Architecture?

• Design better programs, including system such as • Fred Brooks (IBM) – compilers, operating systems, and device drivers. – “Computer architecture, like other architecture, is the • Optimize program behaviour. art of determining the needs of the user of a structure • Parallelism and then designing to meet those needs as effectively – Primary source of performance is now parallelism as opposed to the speed of transistors, clock frequency, instruction level as possible within economic and technological parallelism or pipelining constraints.” • Programmer has to be aware of the parallel architecture • Source: Wikipedia • Evaluate (benchmark) computer system performance. – Employers are looking for people who know ‘how’ things work • Understand time, space, and price trade-offs. • Required Class

9 10

Computer Organization vs Computer Architecture Computer Organization vs Computer Architecture

• There is no clear distinction between matters • Computer organization related to computer organization and matters – Encompasses all physical aspects of computer systems. relevant to computer architecture. • Control signals, interfaces, memory technology. – e.g. Is there a hardware multiply unit or is it done by repeated addition? • Principle of Equivalence of Hardware and – How does a computer work? Software: • Computer architecture – Anything that can be done with software can also be – Logical aspects of system implementation as seen by the done with hardware, and anything that can be done programmer. with hardware can also be done with software, • Instruction set, number of used for data representation, I/O • assuming speed is not a concern. mechanisms, addressing techniques. – e.g. Is there a multiply instruction? – How do I design a computer?

11 12

Copyright 2000 N. AYDIN. All rights reserved. 2 Computer Organization vs Computer Architecture Computer Components - Structure & Function

• All Intel x86 family share the same basic • Structure is the way in which components relate to architecture each other – Processor • The IBM System/370 family share the same basic – Memory architecture – IO – System Interconnection • This gives code compatibility • Function is the operation of individual components as part of the structure – at least backwards – Data processing – Data movement • Organization differs between different versions – Data storage – Control

13 14

An example system An example system

• Consider this advertisement: • Measures of capacity and speed: Decimal Binary Kilo () = 1 thousand = 103 210 Mega (M) = 1 million = 106 220 Giga (G) = 1 billion = 109 230 Tera (T) = 1 trillion = 1012 240 Peta (P) = 1 quadrillion = 1015 250 • Whether a metric refers to a power of ten or a power of two typically depends upon what is • What does it all mean?? being measured.

15 16

An example system An example system • Measures of time and space: • Hertz = clock cycles per second (frequency) Milli (m) = 1 thousandth = 10 -3 – 1MHz = 1,000,000 Hz Micro () = 1 millionth = 10 -6 – Processor speeds are measured in MHz or GHz. Nano (n) = 1 billionth = 10 -9 • = a unit of storage Pico (p) = 1 trillionth = 10 -12 – 1KB = 210 = 1024 Femto(f) = 1 quadrillionth = 10 -15 – 1MB = 220 = 1,048,576 Bytes • Millisecond = 1 thousandth of a second – Main memory (RAM) is measured in MB – Hard disk drive access times are often 10 to 20 milliseconds. • Nanosecond = 1 billionth of a second – Disk storage is measured in GB for small systems, – Main memory access times are often 50 to 70 nanoseconds. TB for large systems. • Micron (micrometer) = 1 millionth of a meter – Circuits on computer chips are measured in microns.

17 18

Copyright 2000 N. AYDIN. All rights reserved. 3 An example system An example system

• We note that cycle time is the reciprocal of clock frequency: The microprocessor is the “brain” of the system. It executes program T = 1/f instructions. This one is a Pentium III • A bus operating at 133 MHz has a cycle time (Intel) running at 667MHz. of 7.52 nanoseconds: T = 1/f = 1/(133×106) = 0.00751879×10-6 T = 7.51879×10-9 second/cycle A system bus moves data within the T = 7.52 nanosecond/cycle computer. The faster the bus the better. This one runs at 133MHz. Now back to the advertisement ...

19 20

An example system An example system

• Computers with large main memory capacity can run larger programs with greater speed This system has 64MB of (fast) synchronous dynamic RAM than computers having small memories. (SDRAM) . . . • RAM is an acronym for random access memory. – Random access means that memory contents can be accessed directly if you know its location. … and two levels of cache memory, the level 1 (L1) cache is smaller and (probably) faster than the L2 cache. • Cache is a type of temporary memory that can Note that these cache sizes are measured in KB. be accessed faster than RAM.

21 22

An example system An example system

Hard disk capacity determines the amount of data and size of EIDE stands for enhanced integrated drive electronics, which describes how the hard disk interfaces with (or programs you can store. connects to) other system components.

This one can store 30GB. 7200 RPM is the rotational speed of the disk. Generally, the faster a disk rotates, A CD-ROM can store about 650MB of data, making the faster it can deliver data to RAM. (There are many it an ideal medium for distribution of commercial other factors involved.) software packages. 48x describes its speed.

23 24

Copyright 2000 N. AYDIN. All rights reserved. 4 An example system An example system

Ports allow movement of System buses can be augmented by • Serial ports send data as a series of pulses data between a system and its dedicated I/O buses. PCI, peripheral along one or two data lines. external devices. component interface, is one such bus. • Parallel ports send data as a single pulse along This system has at least eight data lines. four ports. • USB (universal serial bus) is an intelligent serial interface that is self-configuring. This system has two PCI – It supports “plug and play.” devices: a sound card, and a modem for connecting to the Internet.

25 26

An example system An example system

The number of times per second that the image on • Throughout the remainder of this course you the monitor is repainted is its refresh rate. The dot will see how these components work and how pitch of a monitor tells us how clear the image is. they interact with software to make complete This monitor has a dot pitch of computer systems. 0.28mm and a refresh rate of 85Hz. • The above statement raises two important questions: – What assurance do we have that computer components will operate as we expect? The graphics card contains memory and – And what assurance do we have that computer programs that support the monitor. components will operate together?

27 28

Standards Organizations Standards Organizations

• There are many organizations that set computer • The Institute of Electrical and Electronic hardware standards Engineers (IEEE) – to include the interoperability of computer – Promotes the interests of the worldwide electrical components. engineering community. • Throughout this course, and in your career, you – Establishes standards for will encounter many of them. • computer components, • data representation, • Some of the most important standards-setting • signaling protocols, groups are . . . • ...

29 30

Copyright 2000 N. AYDIN. All rights reserved. 5 Standards Organizations Standards Organizations

• The International Telecommunications Union • The International Organization for (ITU) Standardization (ISO) – Concerns itself with the interoperability of telecommunications systems, including data – establishes worldwide standards for everything communications and telephony. from screw threads to photographic film. • National groups establish standards within their – is influential in formulating standards for computer respective countries: hardware and software, including their methods of – The American National Standards Institute (ANSI) manufacture. – The British Standards Institution (BSI) – Türk Standartları Enstitüsü • Note: ISO is not an acronym. ISO comes from the – … Greek, isos, meaning equal.

31 32

Historical Development Historical Development

• To fully appreciate the computers of today, it is • Generation Zero helpful to understand how things got the way – Mechanical Calculating Machines (1642 - 1945) they are. • Calculating Clock - Wilhelm Schickard (1592 - 1635). • The evolution of computing machinery has • Pascaline - Blaise Pascal (1623 - 1662). • Difference Engine - Charles Babbage (1791 - 1871), taken place over several centuries. also designed but never built the Analytical Engine. • In modern times computer evolution is usually • Punched card tabulating machines - Herman Hollerith classified into four generations according to the (1860 - 1929). – Hollerith cards were commonly used for computer salient technology of the era. input well into the 1970s.

– We note that many of the following dates are approximate.

33 34

Historical Development Historical Development • Mechanical Brains • The First Generation – Abacus – Vacuum Tube Computers (1945 - 1953) – Slide Rule Atanasoff Berry Computer (1937 - 1938) – Difference Engine solved systems of linear equations. – Mechanical Calculators John Atanasoff and Clifford Berry of Iowa State University. – Differential Analyzer • http://web.mit.edu/mindell/www/analyzer.htm

35 36

Copyright 2000 N. AYDIN. All rights reserved. 6 Historical Development Historical Development

• The First Generation • The First Generation – Vacuum Tube Computers (1945 - 1953) – Vacuum Tube Computers (1945 - 1953) – The first general-purpose computer. – The first mass-produced computer. • Electronic • IBM 650 (1955) Numerical • Phased out in 1969. Integrator and Computer (ENIAC) – John Mauchly and . Presper Eckert – University of Pennsylvania, 1946

37 38

Historical Development Historical Development

• The Second Generation • The Third Generation – Transistorized Computers (1954 - 1965) – Integrated Circuit Computers (1965 - 1980) • IBM 7094 (scientific) • IBM 360 and 1401 (business) • DEC PDP-8 and • Digital Equipment PDP-11 Corporation (DEC) • Cray-1 PDP-1 supercomputer • Univac 1100 • . . . and many others. • . . . and many others.

39 40

Historical Development Historical Development

• The Fourth Generation • Moore’s Law (1965) – VLSI Computers (1980 - ????) – Gordon Moore, Intel founder – Very large scale integrated circuits (VLSI) have – “The density of transistors in an integrated circuit more than 10,000 components per chip. will double every year.” – Enabled the creation of microprocessors. • Contemporary version: – The first was the 4- Intel 4004. – “The density of silicon chips doubles every 18 months.”

– Later versions, such as the 8080, 8086, and 8088 – But this “law” cannot hold forever ... spawned the idea of “personal computing.”

41 42

Copyright 2000 N. AYDIN. All rights reserved. 7 Historical Development Historical Development

• Rock’s Law • Rock’s Law – Arthur Rock, Intel financier – In 2003, a chip plants under construction will cost – “The cost of capital equipment to build over $2.5 billion. semiconductors will double every four years.” • $2.5 billion is more than the gross domestic product of some small countries, including Belize, Bhutan, and the – In 1968, a new chip plant cost about $12,000. Republic of Sierra Leone. – For Moore’s Law to hold, Rock’s Law must fall, or • At the time, $12,000 would buy a nice home in the vice versa. suburbs. • But no one can say which will give out first. • An executive earning $12,000 per year was “making a very comfortable living.”

43 44

What is Computer Architecture? Instruction Set Architecture (subset of Comp Arch.)

• ... the attributes of a [computing] system as seen by Computer Architecture the programmer, i.e. the conceptual structure and functional behavior, as distinct from the organization = of the data flows and controls the logic design, and the physical implementation. Instruction Set Architecture -Amdahl, Blaaw, and Brooks, 1964 – Organization of Programmable Storage + • Data Types & Data Structures: Encodings & Representations – Instruction Set Machine Organization – Instruction Formats – Modes of Addressing and Accessing Data Items and Instructions – Exceptional Conditions

45 46

The Instruction Set: a Critical Interface What is Computer Architecture? • Coordination of many levels of abstraction

Application software Compiler Firmware instruction set Instruction Set Architecture Instr. Set Proc. I/O system Datapath & Control hardware Digital Design Circuit Design Layout • under a rapidly changing set of forces • Design, Measurement, and Evaluation

47 48

Copyright 2000 N. AYDIN. All rights reserved. 8 Forces on Computer Architecture The Computer Level Hierarchy

Programming • Computers consist of many things besides chips. Technology Languages • Before a computer can do anything worthwhile, it must also use software. Applications Computer • Writing complex programs requires a “divide and Architecture conquer” approach, where each program module solves a smaller problem.

Operating History • Complex computer systems employ a similar Systems technique through a series of virtual machine layers.

49 50

The Computer Level Hierarchy The Computer Level Hierarchy

• Each virtual machine layer • Level 6 is an abstraction of the – The User Level level below it. • Program execution and user • The machines at each level interface level. execute their own • The level with which we are particular instructions, most familiar. calling upon machines at • Level 5 lower levels to perform – High-Level Language tasks as required. Level • Computer circuits • The level with which we ultimately carry out the interact when we write programs in languages such work. as C, Pascal, Lisp, and Java.

51 52

The Computer Level Hierarchy The Computer Level Hierarchy

• Level 4 • Level 2 – Assembly Language Level – Machine Level • Acts upon assembly language produced from – Also known as the Level 5, as well as instructions programmed Instruction Set directly at this level. Architecture (ISA) Level. • Level 3 • Consists of instructions – System Software Level that are particular to the architecture of the • Controls executing processes on the system. machine. • Protects system resources. • Programs written in • Assembly language machine language need no instructions often pass compilers, interpreters, or through Level 3 without assemblers. modification.

53 54

Copyright 2000 N. AYDIN. All rights reserved. 9 The Computer Level Hierarchy The Computer Level Hierarchy

• Level 1 • Level 0 – Control Level – Digital Logic Level • A control unit decodes and executes instructions and moves • This level is where we data through the system. find digital circuits (the • Control units can be chips). microprogrammed or hardwired. • Digital circuits consist • A microprogram is a program of gates and wires. written in a low-level language that is implemented by the • These components hardware. implement the • Hardwired control units consist mathematical logic of all of hardware that directly other levels. executes machine instructions.

55 56

Two Recurring Themes Universal Computing Device

• Abstraction • All computers, given enough time and memory, – Productivity enhancer – don’t need to worry about details… are capable of computing exactly the same things. • Can drive a car without knowing how the internal combustion engine works. • …until something goes wrong! – Where’s the dipstick? What’s a spark plug? – Important to understand the components and = = how they work together. • Hardware vs. Software – It’s not either/or – both are components of a computer PDA Workstation system. Supercomputer – Even if you specialize in one, you should understand capabilities and limitations of both.

57 58

Turing Machine Universal Turing Machine

• Mathematical model of a device that can perform • A machine that can implement all Turing machines any computation – Alan Turing (1937) Tadd, Tmul – ability to read/write symbols on an infinite “tape” U a,b,c c(a+b) – state transitions, based on current state and symbol Universal Turing Machine • Every computation can be performed by some – this is also a Turing machine! Turing machine. (Turing’s thesis) – inputs: • data, plus a description of computation (other TMs) a,b a+b a,b ab • U is programmable – so is a computer! Tadd T mul – instructions are part of the input data – a computer can emulate a Universal Turing Machine Turing machine that adds Turing machine that multiplies • A computer is a universal computing device.

59 60

Copyright 2000 N. AYDIN. All rights reserved. 10 From Theory to Practice Transformations Between Layers

• In theory, computer can compute anything that’s possible to compute Problems – given enough memory and time Algorithms • In practice, solving problems involves computing under constraints. Language – time Instruction Set Architecture • weather forecast, next frame of animation, ... Microarchitecture – cost • cell phone, automotive engine controller, ... Circuits

– power Devices • cell phone, handheld video game, ...

61 62

How do we solve a problem using a computer? Deeper and Deeper…

A systematic sequence of transformations between layers of abstraction. Instr Set Architecture Problem Processor Design: : choose structures to implement ISA choose algorithms and data structures Microarch Logic/Circuit Design: Algorithm gates and low-level circuits to Programming: implement components use language to express design Circuits Program Process Engineering & Fabrication: Compiling/Interpreting: develop and manufacture convert language to Devices lowest-level components Instr Set machine instructions Architecture

63 64

Descriptions of Each Level Descriptions of Each Level

• Problem Statement • Microarchitecture – stated using "natural language" – detailed organization of a processor implementation – may be ambiguous, imprecise – different implementations of a single ISA • Algorithm – step-by-step procedure, guaranteed to finish • Logic Circuits – definiteness, effective computability, finiteness – combine basic operations to realize microarchitecture • Program – many different ways to implement a single function – express the algorithm using a computer language (e.g., addition) – high-level language, low-level language • Devices • Instruction Set Architecture (ISA) – properties of materials, manufacturability – specifies the set of instructions the computer can perform – data types, addressing mode

65 66

Copyright 2000 N. AYDIN. All rights reserved. 11 Many Choices at Each Level Course Outline - What is Next?

Solve a system of partial differential equations • How to represent information

Gaussian Jacobi • The building blocks of computers: logic gates Red-black SOR Multigrid elimination iteration • The basic algorithm: the von Neumann model FORTRAN C C++ Java • Example 1: VVM (Visible Virtual Machine) Tradeoffs: • Example 2: The MIPS structure and language PowerPC Intel x86 Atmel AVR cost performance • Programming the machine: assembly language Centrino Pentium 4 Xeon power • A higher-level language: C (etc.) Ripple-carry adder Carry-lookahead adder

CMOS Bipolar GaAs

67 68

Copyright 2000 N. AYDIN. All rights reserved. 12