1 College of Charleston, School of Science & Mathematics Dr. Anderson, Computer Science Department...

10
1 College of Charleston, School of Science & Mathematics Dr. Anderson, Computer Science Department CS 250 Comp. Org. & Assembly CS 250 – Computer Organization & Assembly Instructor: Paul Anderson 212 JC Long [email protected] Lecture slides, labs, and other materials courtesy of Dr. Michael Raymer, Wright State University, and Dr. Travis Doom, Wright State University, and Dr. Sridhar Ramachandran, Indiana University Southeast

Transcript of 1 College of Charleston, School of Science & Mathematics Dr. Anderson, Computer Science Department...

Page 1: 1 College of Charleston, School of Science & Mathematics Dr. Anderson, Computer Science Department CS 250 Comp. Org. & Assembly CS 250 – Computer Organization.

1College of Charleston, School of Science & MathematicsDr. Anderson, Computer Science Department

CS 250Comp. Org. & Assembly

CS 250 – Computer Organization & AssemblyInstructor: Paul Anderson

212 JC [email protected]

Lecture slides, labs, and other materials courtesy ofDr. Michael Raymer, Wright State University, andDr. Travis Doom, Wright State University, andDr. Sridhar Ramachandran, Indiana University Southeast

Page 2: 1 College of Charleston, School of Science & Mathematics Dr. Anderson, Computer Science Department CS 250 Comp. Org. & Assembly CS 250 – Computer Organization.

2College of Charleston, School of Science & MathematicsDr. Anderson, Computer Science Department

CS 250Comp. Org. & Assembly

Why study computer organization?

1. You need to understand hardware to program well.– Cache thrashing– Concurrency– Representations

2. You need to understand hardware to program correctly.3. You need to understand assembly language

(at least every once in a while)

Page 3: 1 College of Charleston, School of Science & Mathematics Dr. Anderson, Computer Science Department CS 250 Comp. Org. & Assembly CS 250 – Computer Organization.

3College of Charleston, School of Science & MathematicsDr. Anderson, Computer Science Department

CS 250Comp. Org. & Assembly

Black Boxes

Every level of this hierarchy that you don’t understand is a black box– It might as well be magic– “Debugging by superstition”

The objective of this course is to move the black-box boundary down to the Microarchitecture level!

Algorithm & Language

The Problem

ISA & Microarchitecture

Circuits & Devices

Page 4: 1 College of Charleston, School of Science & Mathematics Dr. Anderson, Computer Science Department CS 250 Comp. Org. & Assembly CS 250 – Computer Organization.

4College of Charleston, School of Science & MathematicsDr. Anderson, Computer Science Department

CS 250Comp. Org. & Assembly

The instruction set architecture (ISA)

The next step is to translate the program into the instruction set of the particular computer that will be used to carry out the work of the program.

The Instruction Set Architecture (ISA) is the complete specification of the interface between programs that have been written and the underlying hardware that must carry out the work of those programs.– Examples: IA-32 (Intel, AMD, and others), PowerPC

(Motorola) Programs are translated from high languages in to

the ISA of the computer on which they will be run by a program called a compiler (specific to the ISA).

Programs are translated from assembly to the ISA by an assembler

Algorithm & Language

The Problem

ISA & Microarchitecture

Circuits & Devices

Page 5: 1 College of Charleston, School of Science & Mathematics Dr. Anderson, Computer Science Department CS 250 Comp. Org. & Assembly CS 250 – Computer Organization.

5College of Charleston, School of Science & MathematicsDr. Anderson, Computer Science Department

CS 250Comp. Org. & Assembly

The microarchitecture

The next step is to transform the ISA into an implementation. The detailed organization of an implementation is called its microarchitecture.– The IA-32 has been implemented by several different

processors over the past twenty years 8086 (Intel, 1979), 8286, 8386, 8486, Pentium, Pentium II, Athlon, Pentium III.

– Each implementation is an opportunity for computer designers to make different trade-offs between cost and performance. [Computer design is always an exercise in trade-offs.]

Algorithm & Language

The Problem

ISA & Microarchitecture

Circuits & Devices

Page 6: 1 College of Charleston, School of Science & Mathematics Dr. Anderson, Computer Science Department CS 250 Comp. Org. & Assembly CS 250 – Computer Organization.

6College of Charleston, School of Science & MathematicsDr. Anderson, Computer Science Department

CS 250Comp. Org. & Assembly

The logic circuit

The next step is to implement each element of the microprocessor out of simple logic circuits.

Here there are also choices, as the logic designer decides how to best make the trade-offs between cost and performance.

Even in the case of addition, there are several choices of logic circuits to perform this operation and differing speeds and corresponding costs.

Algorithm & Language

The Problem

ISA & Microarchitecture

Circuits & Devices

Page 7: 1 College of Charleston, School of Science & Mathematics Dr. Anderson, Computer Science Department CS 250 Comp. Org. & Assembly CS 250 – Computer Organization.

7College of Charleston, School of Science & MathematicsDr. Anderson, Computer Science Department

CS 250Comp. Org. & Assembly

The devices

Finally, each basic logic circuit is implemented in accordance with the requirements of the particular device technology used.

So, CMOS circuits are different from NMOS circuits, which are different, in turn, from gallium arsenide circuits.

Algorithm & Language

The Problem

ISA & Microarchitecture

Circuits & Devices

Vin

Vout

GND

Vcc

Rc

Rb

Page 8: 1 College of Charleston, School of Science & Mathematics Dr. Anderson, Computer Science Department CS 250 Comp. Org. & Assembly CS 250 – Computer Organization.

8College of Charleston, School of Science & MathematicsDr. Anderson, Computer Science Department

CS 250Comp. Org. & Assembly

CS Realities You’ve got to understand binary encodings

– Integers– Floats– Characters– Instructions

You’ve got to understand how a machine processes instructions– The stack

You have to understand memory– Memory references (pointers)

Computers do more than execute your program– I/O– Interrupts– Network behavior

In short: – You must understand the system in order to optimize performance!

Page 9: 1 College of Charleston, School of Science & Mathematics Dr. Anderson, Computer Science Department CS 250 Comp. Org. & Assembly CS 250 – Computer Organization.

9College of Charleston, School of Science & MathematicsDr. Anderson, Computer Science Department

CS 250Comp. Org. & Assembly

Understanding your hardware

Intel® Core™ i7-3930K Processor (12M Cache, 3.20 GHz)

# of Cores 6

# of Threads 12

Clock Speed 3.2 GHz

Max Turbo Frequency 3.8 GHz

Intel® Smart Cache 12 MB

Bus/Core Ratio 57

Instruction Set 64-bit

Lithography 32nm

Recommended Customer Price $583 - $594

Idle States Yes

Enhanced Intel SpeedStep® Technology Yes

Execute Disable Bit Yes

Page 10: 1 College of Charleston, School of Science & Mathematics Dr. Anderson, Computer Science Department CS 250 Comp. Org. & Assembly CS 250 – Computer Organization.

10College of Charleston, School of Science & MathematicsDr. Anderson, Computer Science Department

CS 250Comp. Org. & Assembly

Where we are heading