part 1. intel x86/pentium family 32-bit cisc processor sun sparc and ultrasparc 32- and 64-bit...

40
Part 1

Upload: roland-wilson

Post on 26-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

Part 1

Page 2: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

Intel x86/Pentium family 32-bit CISC processor

SUN SPARC and UltraSPARC 32- and 64-bit RISC processors

Java C C++ Java Why Java?

Binaries are not portable nor can they be secured

Complexity of C++

Page 3: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

Java How?

Bytecode (for hypothetical machine) Moved around the web Interpreted by JVM (Java Virtual Machine)

32-bit w/ 226 instructions (some complex) JIT compilation

SUN Pico Java II family of chips No JVM Optional cache and fp unit Example is micro Java 701 Used by embedded systems

Page 4: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

CPU Central Processing Unit

Bus collection of (parallel) wires for transmitting

address, data, and control signals Instruction format

opcode [operand1,…] Opcode = operation code (e.g., add) Operand = (optional) data upon which opcode is

performed (e.g., add 12,r0 – add 12 to register 0 – 12 and r0 are the operands)

Page 5: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

Tanenbaum, Structured Computer Organization, Fifth Edition, (c)

2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0

The organization of a simple computer with one CPU and two I/O devices

Page 6: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

1. CU = control unit

2. ALU = arithmetic logic unit

3. Registers = small amount of high speed memory

Page 7: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

1. CU = control unit Fetches instruction from main memory and

determines their type

2. ALU = arithmetic logic unit

3. Registers = small amount of high speed memory

Page 8: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

1. CU = control unit

2. ALU = arithmetic logic unit Performs operations such as add, subtract, or,

etc.

3. Registers = small amount of high speed memory

Page 9: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

1. CU = control unit

2. ALU = arithmetic logic unit

3. Registers = small amount of high speed memory stores temp results and control info holds (only) one number PC = program counter

points to next instruction to be executed PS = processor status (EFLAGS)

Page 10: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

Tanenbaum, Structured Computer Organization, Fifth Edition, (c)

2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0

The data path of a typical Von Neumann machine.

Page 11: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

1. Register-to-register

2. Register-to-memory (or mem-to-reg)

What’s missing?

Page 12: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

Tanenbaum, Structured Computer Organization, Fifth Edition, (c)

2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0

1. Fetch next instruction from memory into instruction register.

2. Change program counter to point to next instruction.

3. Determine type of instruction just fetched.4. If instructions uses word in memory, determine

where it is.5. If needed, fetch word from memory into CPU

register.6. Execute the instruction.7. Go to step 1 (to begin executing next

instruction).

Page 13: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

Tanenbaum, Structured Computer Organization, Fifth Edition, (c)

2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0

1. Fetch next instruction from memory into instruction register.

2. Change program counter to point to next instruction.

3. Determine type of instruction just fetched.4. If instructions uses word in memory, determine

where it is.5. If needed, fetch word from memory into CPU

register.6. Execute the instruction.7. Go to step 1 (to begin executing next

instruction).

Very similar to the JVM (see http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html#7143).

Page 14: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

A program that fetches, examines, and executes the instructions of another program.

Page 15: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

1. Interpreted

2. Compiled to bytecode

3. Compiled to executable

Page 16: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

1. Interpreted– need additional program (interpreter) to run

2. Compiled to bytecode– need additional program to compile to

bytecode– need additional program (interpreter) to run

bytecode

3. Compiled to executable– need additional program (compiler) to create

executable– nothing required to run

Page 17: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 18: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 19: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 20: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 21: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 22: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 23: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 24: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 25: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 26: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 27: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 28: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 29: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 30: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 31: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

First, recall CPU components: CU ALU registers = small amount of high speed memory

stores temp results and control info holds (only) one number PC = program counter

points to next instruction to be executed PS = processor status (EFLAGS)

We’ll need a PC, a PS, and one other register, the AC.

Page 32: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

Tanenbaum, Structured Computer Organization, Fifth Edition, (c)

2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0

An interpreter for a simple computer (written in Java).. . .

Where’s the PS?

Page 33: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

Tanenbaum, Structured Computer Organization, Fifth Edition, (c)

2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0

An interpreter for a simple computer (written in Java).

Page 34: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Page 35: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

1. Specify microinstructions

2. Specify machine language

3. Implement in software, hardware, or hybrid

Page 36: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

Late 50’s and on…

IBM (dominant company) defines a family or “architecture” Top end machines ($$$) execute all

instructions in hardware. Bottom end machines ($) interpret many

instructions (and therefore run slowly)

Page 37: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

Benefits1. Bugs (in instructions) can later be fixed.2. One may add new instructions.3. Supports development, testing, and documentation.

Big trend in 70s and 80s was towards CISC (complex instruction set computer) with hundreds of instructions.

(Author’s view of DEC is not “complete.” DEC saw the advantages of RISC and introduced the DEC Alpha processor which was much faster and more powerful than Intel processors.)

Page 38: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

70s – CISC simplified compiler design by closing the gap between HLL and architecture.

RISC = reduced instruction set computer 1980 – Patterson et al. @ Berkeley - SPARC

No interpreter – just hardware 1981 – Hennessy – MIPS

Page 39: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

Initial emphasis on quick instruction execution

Issuing (starting the execution of) many instructions in parallel is the key to good performance.

Small number of instructions (~50) compared with 200-300 for CISC.

4 or 5 RISC instruction = 1 CISC instructions But RISC can be 10x faster!

Evolution of compiler technology made this possible.

Page 40: Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?

So why hasn’t RISC beat Intel (CISC)? Market momentum Economy of scale 486 had a RISC core (for frequently executed

instructions) w/ other instructions interpreted